Skip to content

Commit

Permalink
Merge 4aa78c2 into 74a3302
Browse files Browse the repository at this point in the history
  • Loading branch information
sijie committed Dec 21, 2016
2 parents 74a3302 + 4aa78c2 commit 66826a7
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ public void testGetFirstDLSNWithOpenLedger() throws Exception {

DistributedLogConfiguration confLocal = new DistributedLogConfiguration();
confLocal.loadConf(conf);
confLocal.setImmediateFlushEnabled(true);
confLocal.setImmediateFlushEnabled(false);
confLocal.setOutputBufferSize(0);

int numEntriesPerSegment = 100;
int numEntriesPerSegment = 10;
DistributedLogManager dlm1 = createNewDLM(confLocal, dlName);
long txid = 1;

Expand All @@ -177,15 +177,14 @@ public void testGetFirstDLSNWithOpenLedger() throws Exception {
futures.add(out.write(DLMTestUtil.getLogRecordInstance(txid)));
++txid;
}
for (Future<DLSN> future : futures) {
Await.result(future);
}

BKLogReadHandler readHandler =
((BKDistributedLogManager) dlm1).createReadHandler();
FutureUtils.result(Future.collect(futures));
// commit
LogRecord controlRecord = new LogRecord(txid, DistributedLogConstants.CONTROL_RECORD_CONTENT);
controlRecord.setControl();
FutureUtils.result(out.write(controlRecord));

DLSN last = dlm1.getLastDLSN();
assertEquals(new DLSN(1,99,0), last);
assertEquals(new DLSN(1,9,0), last);
DLSN first = Await.result(dlm1.getFirstDLSNAsync());
assertEquals(new DLSN(1,0,0), first);
Utils.close(out);
Expand Down

0 comments on commit 66826a7

Please sign in to comment.