예제 #1
0
 public long hash(Key key, int depth) {
   key.indexTo(depth);
   int startPosition = key.getIndex();
   key.indexTo(depth + 1);
   int endPosition = key.getIndex();
   return hashFunction
       .hashBytes(key.getEncodedBytes(), startPosition, endPosition - startPosition)
       .asLong();
 }
예제 #2
0
 protected void getKeyBytes(Row row) {
   Key key = ((PersistitHKey) row.hKey()).key();
   keyEncodedString = encodeBytes(key.getEncodedBytes(), 0, key.getEncodedSize());
   Field field = new StringField(IndexedField.KEY_FIELD, keyEncodedString, Store.YES);
   currentDocument.add(field);
 }