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(); }
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); }