use of voldemort.MockTime in project voldemort by voldemort.
the class DataCleanupJobTest method setUp.
@Before
public void setUp() throws Exception {
time = new MockTime();
storeDir = TestUtils.createTempDir();
FileDeleteStrategy.FORCE.delete(storeDir);
// lets use all the default values.
Props props = new Props();
props.put("node.id", 1);
props.put("voldemort.home", "test/common/voldemort/config");
VoldemortConfig voldemortConfig = new VoldemortConfig(props);
voldemortConfig.setBdbCacheSize(1024 * 1024);
voldemortConfig.setBdbOneEnvPerStore(true);
voldemortConfig.setBdbDataDirectory(storeDir.toURI().getPath());
voldemortConfig.setBdbPrefixKeysWithPartitionId(prefixPartitionId);
bdbStorage = new BdbStorageConfiguration(voldemortConfig);
StoreDefinition storeDef = getStoreDef(START_RETENTION);
engine = bdbStorage.getStore(storeDef, TestUtils.makeSingleNodeRoutingStrategy());
List<Node> nodes = Lists.newArrayList();
nodes.add(new Node(0, "test-host", 1234, 1235, 1236, Arrays.asList(0)));
Cluster cluster = new Cluster("cluster", nodes);
StoreRepository repo = new StoreRepository();
repo.setSlopStore(new SlopStorageEngine(new InMemoryStorageEngine<ByteArray, byte[], byte[]>("slop"), cluster));
repo.addNodeStore(0, engine);
metadataStore = ServerTestUtils.createMetadataStore(cluster, Arrays.asList(storeDef));
}
Aggregations