use of org.apache.jackrabbit.oak.stats.Clock in project jackrabbit-oak by apache.
the class MissingLastRevSeekerTest method before.
@Before
public void before() throws Exception {
clock = new Clock.Virtual();
clock.waitUntil(System.currentTimeMillis());
Revision.setClock(clock);
ClusterNodeInfo.setClock(clock);
store = new MemoryDocumentStore();
seeker = new MissingLastRevSeeker(store, clock);
}
use of org.apache.jackrabbit.oak.stats.Clock in project jackrabbit-oak by apache.
the class LastRevRecoveryRandomizedIT method setUp.
@Before
public void setUp() throws Exception {
LOG.info("Running " + getClass().getSimpleName() + " with seed " + SEED);
clock = new Clock.Virtual();
Revision.setClock(clock);
ClusterNodeInfo.setClock(clock);
random.setSeed(SEED);
store = new MemoryDocumentStore();
ns = new DocumentMK.Builder().setDocumentStore(store).setLeaseCheck(false).clock(clock).setAsyncDelay(0).getNodeStore();
builder = newBuilder(ns);
builder.child("root");
merge(ns, builder);
currentState.put("/root", ns.getRoot().getChildNode("root"));
builder = newBuilder(ns);
}
use of org.apache.jackrabbit.oak.stats.Clock in project jackrabbit-oak by apache.
the class VersionGCQueryTest method before.
@Before
public void before() throws Exception {
clock = new Clock.Virtual();
clock.waitUntil(System.currentTimeMillis());
Revision.setClock(clock);
store = new MemoryDocumentStore() {
@Override
public <T extends Document> T find(Collection<T> collection, String key) {
if (collection == Collection.NODES && Utils.isPreviousDocId(key)) {
prevDocIds.add(key);
}
return super.find(collection, key);
}
};
ns = provider.newBuilder().setDocumentStore(store).setAsyncDelay(0).clock(clock).getNodeStore();
}
use of org.apache.jackrabbit.oak.stats.Clock in project jackrabbit-oak by apache.
the class VersionGCTest method setUp.
@Before
public void setUp() throws Exception {
execService = Executors.newCachedThreadPool();
Clock clock = new Clock.Virtual();
clock.waitUntil(System.currentTimeMillis());
Revision.setClock(clock);
ns = builderProvider.newBuilder().clock(clock).setLeaseCheck(false).setDocumentStore(store).setAsyncDelay(0).getNodeStore();
// create test content
createNode("foo");
removeNode("foo");
// wait one hour
clock.waitUntil(clock.getTime() + HOURS.toMillis(1));
gc = ns.getVersionGarbageCollector();
}
use of org.apache.jackrabbit.oak.stats.Clock in project jackrabbit-oak by apache.
the class ReadPreferenceIT method setUpConnection.
@Override
public void setUpConnection() throws Exception {
clock = new Clock.Virtual();
setRevisionClock(clock);
setClusterNodeInfoClock(clock);
mongoConnection = connectionFactory.getConnection();
MongoUtils.dropCollections(mongoConnection.getDB());
replica = ReplicaSetInfoMock.create(clock);
mk = new DocumentMK.Builder().clock(clock).setClusterId(1).setMongoDB(mongoConnection.getDB()).setLeaseCheck(false).open();
mongoDS = (MongoDocumentStore) mk.getDocumentStore();
// use a separate connection for cluster node 2
MongoConnection mongoConnection2 = connectionFactory.getConnection();
mk2 = new DocumentMK.Builder().clock(clock).setClusterId(2).setMongoDB(mongoConnection2.getDB()).setLeaseCheck(false).open();
}
Aggregations