use of org.voltdb.CommandLog in project voltdb by VoltDB.
the class TestSpSchedulerSpHandle method createObjs.
public void createObjs() throws JSONException {
mbox = mock(Mailbox.class);
when(mbox.getHSId()).thenReturn(dut_hsid);
iv2masters = mock(MapCache.class);
snapMonitor = mock(SnapshotCompletionMonitor.class);
// make fake MapCache of iv2masters
HashMap<String, JSONObject> fakecache = new HashMap<String, JSONObject>();
fakecache.put("0", new JSONObject("{hsid:0}"));
when(iv2masters.pointInTimeCache()).thenReturn(ImmutableMap.copyOf(fakecache));
final CommandLog cl = mock(CommandLog.class);
doReturn(CoreUtils.COMPLETED_FUTURE).when(cl).log(any(Iv2InitiateTaskMessage.class), anyLong(), any(int[].class), any(CommandLog.DurabilityListener.class), any(TransactionTask.class));
dut = new SpScheduler(0, getSiteTaskerQueue(), snapMonitor);
dut.setMailbox(mbox);
dut.setCommandLog(cl);
dut.setLock(mbox);
}
use of org.voltdb.CommandLog in project voltdb by VoltDB.
the class TestSpSchedulerDedupe method createObjs.
public void createObjs() throws JSONException {
mbox = mock(Mailbox.class);
when(mbox.getHSId()).thenReturn(dut_hsid);
iv2masters = mock(MapCache.class);
snapMonitor = mock(SnapshotCompletionMonitor.class);
// make fake MapCache of iv2masters
HashMap<String, JSONObject> fakecache = new HashMap<String, JSONObject>();
fakecache.put("0", new JSONObject("{hsid:0}"));
when(iv2masters.pointInTimeCache()).thenReturn(ImmutableMap.copyOf(fakecache));
final CommandLog cl = mock(CommandLog.class);
doReturn(CoreUtils.COMPLETED_FUTURE).when(cl).log(any(Iv2InitiateTaskMessage.class), anyLong(), any(int[].class), any(CommandLog.DurabilityListener.class), any(TransactionTask.class));
dut = new SpScheduler(0, getSiteTaskerQueue(), snapMonitor);
dut.setMailbox(mbox);
dut.setCommandLog(cl);
dut.setLock(mbox);
((SpScheduler) dut).setConsistentReadLevelForTestOnly(m_readLevel);
}
Aggregations