List of usage examples for com.mongodb MongoClient isLocked
@Deprecated public boolean isLocked()
From source file:com.edgytech.umongo.ServerPanel.java
License:Apache License
public void fsyncAndLock(ButtonBase button) { if (!UMongo.instance.getGlobalStore().confirmLockingOperation()) { return;//from www . j a va2 s.c o m } new DbJob() { @Override public Object doRun() throws IOException { MongoClient mongo = getServerNode().getServerMongoClient(); boolean locked = mongo.isLocked(); if (locked) { return mongo.unlock(); } return mongo.fsyncAndLock(); } @Override public String getNS() { return null; } @Override public String getShortName() { return "FSync And Lock"; } @Override public void wrapUp(Object res) { try { // looks like the unlock doesnt take effect right away Thread.sleep(1000); } catch (InterruptedException ex) { } super.wrapUp(res); } }.addJob(); }
From source file:org.apache.rya.indexing.external.PcjIntegrationTestingUtil.java
License:Apache License
public static void deleteCoreRyaTables(final MongoClient client, final String instance, final String collName) { final boolean bool = client.isLocked(); client.getDatabase(instance).getCollection(collName).drop(); }