assertEquals(segment.dataBlockCount, 2);
assertEquals(segment.checkBlockCount, 3);
assertEquals(segment.crossCheckBlockCount, 0);
assertTrue(resumed.getStatus() == Status.ENCODED);
BlockInsert chosen = segment.chooseBlock();
assertTrue(chosen != null);
keys.addInsert(chosen);
assertFalse(chosenBlocks[chosen.blockNumber]);
chosenBlocks[chosen.blockNumber] = true;
segment.onFailure(chosen.blockNumber, new InsertException(InsertExceptionMode.ROUTE_NOT_FOUND));
}
keys.clear();
// Choose and succeed all blocks.
chosenBlocks = new boolean[totalBlockCount];
for(int i=0;i<totalBlockCount;i++) {
executor.waitForIdle();
resumed = new SplitFileInserterStorage(storage.getRAF(), data, cb, r,
memoryLimitedJobRunner, jobRunner, ticker, keys, fg, persistentFileTracker, null);
assertEquals(resumed.segments.length, 1);
SplitFileInserterSegmentStorage segment = resumed.segments[0];
assertEquals(segment.dataBlockCount, 2);
assertEquals(segment.checkBlockCount, 3);
assertEquals(segment.crossCheckBlockCount, 0);
assertTrue(resumed.getStatus() == Status.ENCODED);
BlockInsert chosen = segment.chooseBlock();
keys.addInsert(chosen);
assertTrue(chosen != null);
assertFalse(chosenBlocks[chosen.blockNumber]);
chosenBlocks[chosen.blockNumber] = true;
segment.onInsertedBlock(chosen.blockNumber, segment.encodeBlock(chosen.blockNumber).getClientKey());