voldemort.store.readonly
Class BinarySearchStrategy

java.lang.Object
  extended by voldemort.store.readonly.BinarySearchStrategy
All Implemented Interfaces:
SearchStrategy

public class BinarySearchStrategy
extends java.lang.Object
implements SearchStrategy

A search strategy that does a simple binary search into the buffer to find the key


Constructor Summary
BinarySearchStrategy()
           
 
Method Summary
 int indexOf(java.nio.ByteBuffer index, byte[] key, int indexFileSize)
          Search for the key in the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinarySearchStrategy

public BinarySearchStrategy()
Method Detail

indexOf

public int indexOf(java.nio.ByteBuffer index,
                   byte[] key,
                   int indexFileSize)
Description copied from interface: SearchStrategy
Search for the key in the buffer.

Specified by:
indexOf in interface SearchStrategy
Parameters:
index - The index buffer
key - The key to search for
indexFileSize - The size of the index
Returns:
The integer offset of the position offset, if the key is found, else -1


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu