@Test public void testNextRevision() { final RevisionManager revisionManager = new RevisionManager(ds); assertEquals(Long.MIN_VALUE + 1, revisionManager.nextRevision()); assertEquals(Long.MIN_VALUE + 2, revisionManager.nextRevision()); assertEquals(Long.MIN_VALUE + 3, revisionManager.nextRevision()); verify(updateOperations, times(3)).inc(anyString()); }
public long nextRevision() { return (Long) ds .findAndModify( ds.createQuery(MetadataEntity.class).field("name").equal(NAME), ds.createUpdateOperations(MetadataEntity.class).inc("value") ).value; }
RevisionManager { public long nextRevision() { return (Long) ds .findAndModify( ds.createQuery(MetadataEntity.class).field("name").equal(NAME), ds.createUpdateOperations(MetadataEntity.class).inc("value") ).value; } }
RevisionManager { public long nextRevision() { return (Long) ds .findAndModify( ds.createQuery(MetadataEntity.class).field("name").equal(NAME), ds.createUpdateOperations(MetadataEntity.class).inc("value") ).value; } RevisionManager(AdvancedDatastore ds); }
RevisionManager { public long nextRevision() { return (Long) ds .findAndModify( ds.createQuery(MetadataEntity.class).field("name").equal(NAME), ds.createUpdateOperations(MetadataEntity.class).inc("value") ).value; } RevisionManager(AdvancedDatastore ds); long nextRevision(); void setLatestRevision(Long revision); boolean checkIfAnyStale(); boolean checkIfStale(String experimentName); }
RevisionManager { public long nextRevision() { return (Long) ds .findAndModify( ds.createQuery(MetadataEntity.class).field("name").equal(NAME), ds.createUpdateOperations(MetadataEntity.class).inc("value") ).value; } RevisionManager(AdvancedDatastore ds); long nextRevision(); void setLatestRevision(Long revision); boolean checkIfAnyStale(); boolean checkIfStale(String experimentName);  }