private boolean fetchnextKey() { if (this.innerIterator.isValid()) { byte[] keyEntry = this.innerIterator.key(); // Check if the next key returned starts with the expected // prefix if (StoreBinaryFormat.extractPartition(keyEntry) != partitionId) { return false; } this.innerIterator.next(); cache = new ByteArray(StoreBinaryFormat.extractKey(keyEntry)); return true; } return false; }
protected boolean makeMore() { if (innerIterator.isValid()) { byte[] keyEntry = innerIterator.key(); // Check if the next key returned starts with the expected // prefix if (StoreBinaryFormat.extractPartition(keyEntry) != partitionId) { return false; } byte[] valueEntry = innerIterator.value(); innerIterator.next(); ByteArray key = new ByteArray(StoreBinaryFormat.extractKey(keyEntry)); for (Versioned<byte[]> val : StoreBinaryFormat.fromByteArray(valueEntry)) { cache.add(new Pair<ByteArray, Versioned<byte[]>>(key, val)); } return true; } return false; }