@Override public void get(ByteBuffer key, ReaderResult result) throws IOException { // we want at least readBufferSize bytes of available space. we might resize // again later. result.requiresBufferSize(readBufferSize); // ask the keyfile for this key keyFileReader.get(key, result); // if the key is found, then we are prepared to do the second lookup. if (result.isFound()) { // now we know where to look readRecord(result.getBuffer(), result); } }
public HankResponse get(ByteBuffer key, ReaderResult result) throws IOException { // Increment requests counter LOG.trace("Partition GET"); reader.get(key, result); int l1CacheHit = result.getL1CacheHit() ? 1 : 0; int l2CacheHit = result.getL2CacheHit() ? 1 : 0; if (result.isFound()) { countersWindow.increment(1, 1, result.getBuffer().remaining(), l1CacheHit, l2CacheHit); return HankResponse.value(result.getBuffer()); } else { countersWindow.increment(1, 0, 0, l1CacheHit, l2CacheHit); return NOT_FOUND; } }