protected void waitTx(DatastoreTransaction... txs) { U.sleep(1000); // FIXME }
@Override public void commit(DatastoreTransaction tx) { while (!txs.offer(tx)) { U.sleep(5); } }
public static void waitFor(AtomicInteger n, int value) { while (n.get() != value) { U.sleep(10); } }
@Override public void commit(DatastoreTransaction tx) { while (!txs.offer(tx)) { U.sleep(5); } }
@Override public void commit(DatastoreTransaction tx) { while (!txs.offer(tx)) { U.sleep(5); } }
public static void waitFor(AtomicBoolean done) { while (!done.get()) { U.sleep(10); } }
@Override public void sync() throws TransactionException { addListener(this); while (!finished) { U.sleep(5); } if (failure != null) { throw failure; } }
@Override public void sync() throws TransactionException { addListener(this); while (!finished) { U.sleep(5); } if (failure != null) { throw failure; } }
@Override public void sync() throws TransactionException { addListener(this); while (!finished) { U.sleep(5); } if (failure != null) { throw failure; } }
@Override public void shutdown() { super.shutdown(); while (!finished.get()) { U.sleep(10); } try { file.close(); } catch (IOException e) { throw Errors.rte("Couldn't close database file!", e); } }
@Override public void shutdown() { super.shutdown(); while (!finished.get()) { U.sleep(10); } try { file.close(); } catch (IOException e) { throw Errors.rte("Couldn't close database file!", e); } }
@Override public void shutdown() { super.shutdown(); while (!finished.get()) { U.sleep(10); } try { file.close(); } catch (IOException e) { throw Errors.rte("Couldn't close database file!", e); } }
public static Db newInstance(String filename) { Throwable err = null; for (int i = 0; i < 3; i++) { try { return filename != null ? new OhmDBImpl(filename) : new OhmDBImpl(); } catch (Exception e) { e.printStackTrace(); err = e; U.sleep(1000); } } throw Errors.rte("Cannot initialize the database!", err); }
public static Db newInstance(String filename) { Throwable err = null; for (int i = 0; i < 3; i++) { try { return filename != null ? new OhmDBImpl(filename) : new OhmDBImpl(); } catch (Exception e) { e.printStackTrace(); err = e; U.sleep(1000); } } throw Errors.rte("Cannot initialize the database!", err); }
public static Db newInstance(String filename) { Throwable err = null; for (int i = 0; i < 3; i++) { try { return filename != null ? new OhmDBImpl(filename) : new OhmDBImpl(); } catch (Exception e) { e.printStackTrace(); err = e; U.sleep(1000); } } throw Errors.rte("Cannot initialize the database!", err); }
public static void finish(ThreadPack... packs) { while (true) { int n = 0; for (ThreadPack pack : packs) { if (pack.hasError()) { Assert.fail("Error in thread!", pack.getError()); } if (pack.finished()) { n++; } } if (n == packs.length) { return; } U.sleep(10); } }
public static void finishFirst(Db db, ThreadPack... packs) { while (true) { for (int i = 0; i < packs.length; i++) { ThreadPack pack = packs[i]; if (pack.hasError()) { Assert.fail("Error in thread!", pack.getError()); } if (pack.finished()) { if (i == 0) { for (int j = 1; j < packs.length; j++) { packs[j].stop(); } return; } else { Assert.fail("The first thread pack must finish before the others!"); } } } U.sleep(1000); } }
U.sleep(10);