コード例 #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
ファイル: RowIndexer.java プロジェクト: ianblenke/sql-layer
 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);
 }