final void writeCachePrimer(final DataOutput dout) throws IOException { traverseLoaded((node) -> { byte[] midKey; try { if (!node.isLeaf()) { return; } int numKeys = node.numKeys(); if (numKeys > 1) { int highPos = numKeys & ~1; midKey = node.midKey(highPos - 2, node, highPos); } else if (numKeys == 1) { midKey = node.retrieveKey(0); } else { return; } } finally { node.releaseExclusive(); } // Omit entries with very large keys. Primer encoding format needs to change // for supporting larger keys. if (midKey.length < 0xffff) { dout.writeShort(midKey.length); dout.write(midKey); } }); // Terminator. dout.writeShort(0xffff); }
final void writeCachePrimer(final DataOutput dout) throws IOException { traverseLoaded((node) -> { byte[] midKey; try { if (!node.isLeaf()) { return; } int numKeys = node.numKeys(); if (numKeys > 1) { int highPos = numKeys & ~1; midKey = node.midKey(highPos - 2, node, highPos); } else if (numKeys == 1) { midKey = node.retrieveKey(0); } else { return; } } finally { node.releaseExclusive(); } // Omit entries with very large keys. Primer encoding format needs to change // for supporting larger keys. if (midKey.length < 0xffff) { dout.writeShort(midKey.length); dout.write(midKey); } }); // Terminator. dout.writeShort(0xffff); }
final void writeCachePrimer(final DataOutput dout) throws IOException { traverseLoaded((node) -> { byte[] midKey; try { if (!node.isLeaf()) { return; } int numKeys = node.numKeys(); if (numKeys > 1) { int highPos = numKeys & ~1; midKey = node.midKey(highPos - 2, node, highPos); } else if (numKeys == 1) { midKey = node.retrieveKey(0); } else { return; } } finally { node.releaseExclusive(); } // Omit entries with very large keys. Primer encoding format needs to change // for supporting larger keys. if (midKey.length < 0xffff) { dout.writeShort(midKey.length); dout.write(midKey); } }); // Terminator. dout.writeShort(0xffff); }
Node node = frame.mNode; try { entryCount = node.numKeys(); totalBytes = pageSize(node.mPage); if (pos < 0 || (numKeys = node.numKeys()) <= 0) { keyBytes = 0; valueBytes = 0; scalar = node.numKeys() + 1; // internal nodes have +1 children availBytes = node.availableInternalBytes(); pageSize = pageSize(node.mPage);
Node node = frame.mNode; try { entryCount = node.numKeys(); totalBytes = pageSize(node.mPage); if (pos < 0 || (numKeys = node.numKeys()) <= 0) { keyBytes = 0; valueBytes = 0; scalar = node.numKeys() + 1; // internal nodes have +1 children availBytes = node.availableInternalBytes(); pageSize = pageSize(node.mPage);
Node node = frame.mNode; try { entryCount = node.numKeys(); totalBytes = pageSize(node.mPage); if (pos < 0 || (numKeys = node.numKeys()) <= 0) { keyBytes = 0; valueBytes = 0; scalar = node.numKeys() + 1; // internal nodes have +1 children availBytes = node.availableInternalBytes(); pageSize = pageSize(node.mPage);
int entryCount = numKeys(); int freeBytes = availableBytes();
rootNode.acquireExclusive(); if (rootNode.numKeys() == 1 && rootNode.isInternal()) {
int entryCount = numKeys(); int freeBytes = availableBytes();
int entryCount = numKeys(); int freeBytes = availableBytes();