boolean padBetweenBlocks() { return padBetweenBlocks(blockType) || (blockType == INDEX_BLOCK_TYPE && padBetweenBlocks(keyType)); }
void writeIndex() throws IOException { if (padBetweenBlocks(keyType)) { out.padBetweenBlocksToNextBlock(); } long startPos = out.size(); writeMultiLevelIndex(entries); bytes = (int) (out.size() - startPos); entries = null; }
private List<IndexEntry> writeOneLevel(List<IndexEntry> keys) throws IOException { Section thisLevel = new Section(keyType); for (Entry e : keys) { thisLevel.write(e); } if (!thisLevel.idx.entries.isEmpty()) { thisLevel.flushCurBlock(); if (cur.padBetweenBlocks()) { out.padBetweenBlocksToNextBlock(); } cur = null; return thisLevel.idx.entries; } // The current block fit entire level; make it the root. rootPosition = out.size(); cur.writeTo(out); cur = null; return null; } }
long write(BlockWriter.Entry entry) throws IOException { if (cur == null) { beginBlock(entry); } else if (!cur.tryAdd(entry)) { flushCurBlock(); if (cur.padBetweenBlocks()) { out.padBetweenBlocksToNextBlock(); } beginBlock(entry); } entryCnt++; return out.size(); }
boolean padBetweenBlocks() { return padBetweenBlocks(blockType) || (blockType == INDEX_BLOCK_TYPE && padBetweenBlocks(keyType)); }
void writeIndex() throws IOException { if (padBetweenBlocks(keyType)) { out.padBetweenBlocksToNextBlock(); } long startPos = out.size(); writeMultiLevelIndex(entries); bytes = (int) (out.size() - startPos); entries = null; }
private List<IndexEntry> writeOneLevel(List<IndexEntry> keys) throws IOException { Section thisLevel = new Section(keyType); for (Entry e : keys) { thisLevel.write(e); } if (!thisLevel.idx.entries.isEmpty()) { thisLevel.flushCurBlock(); if (cur.padBetweenBlocks()) { out.padBetweenBlocksToNextBlock(); } cur = null; return thisLevel.idx.entries; } // The current block fit entire level; make it the root. rootPosition = out.size(); cur.writeTo(out); cur = null; return null; } }
long write(BlockWriter.Entry entry) throws IOException { if (cur == null) { beginBlock(entry); } else if (!cur.tryAdd(entry)) { flushCurBlock(); if (cur.padBetweenBlocks()) { out.padBetweenBlocksToNextBlock(); } beginBlock(entry); } entryCnt++; return out.size(); }