コード例 #1
0
 @Override
 public void load(
     String indexName,
     OBinarySerializer valueSerializer,
     boolean isAutomatic,
     OBinarySerializer keySerializer,
     OType[] keyTypes,
     boolean nullPointerSupport,
     int keySize,
     Map<String, String> engineProperties) {
   hashTable.load(indexName, keyTypes, nullPointerSupport);
   hashFunction.setValueSerializer(hashTable.getKeySerializer());
 }
コード例 #2
0
  @Override
  public long size(ValuesTransformer transformer) {
    if (transformer == null) return hashTable.size();
    else {
      OHashIndexBucket.Entry<Object, Object> firstEntry = hashTable.firstEntry();
      if (firstEntry == null) return 0;

      OHashIndexBucket.Entry<Object, Object>[] entries = hashTable.ceilingEntries(firstEntry.key);
      long counter = 0;

      while (entries.length > 0) {
        for (OHashIndexBucket.Entry<Object, Object> entry : entries)
          counter += transformer.transformFromValue(entry.value).size();

        entries = hashTable.higherEntries(entries[entries.length - 1].key);
      }

      return counter;
    }
  }
コード例 #3
0
  @Override
  public void create(
      OBinarySerializer valueSerializer,
      boolean isAutomatic,
      OType[] keyTypes,
      boolean nullPointerSupport,
      OBinarySerializer keySerializer,
      int keySize,
      Set<String> clustersToIndex,
      Map<String, String> engineProperties,
      ODocument metadata) {
    hashFunction.setValueSerializer(keySerializer);

    hashTable.create(keySerializer, valueSerializer, keyTypes, nullPointerSupport);
  }
コード例 #4
0
 @Override
 public boolean acquireAtomicExclusiveLock(Object key) {
   hashTable.acquireAtomicExclusiveLock();
   return true;
 }
コード例 #5
0
 @Override
 public void put(Object key, Object value) {
   hashTable.put(key, value);
 }
コード例 #6
0
 @Override
 public Object get(Object key) {
   return hashTable.get(key);
 }
コード例 #7
0
 @Override
 public void close() {
   hashTable.close();
 }
コード例 #8
0
 @Override
 public void clear() {
   hashTable.clear();
 }
コード例 #9
0
 @Override
 public boolean remove(Object key) {
   return hashTable.remove(key) != null;
 }
コード例 #10
0
 @Override
 public boolean contains(Object key) {
   return hashTable.get(key) != null;
 }
コード例 #11
0
 @Override
 public void delete() {
   hashTable.delete();
 }
コード例 #12
0
 @Override
 public void deleteWithoutLoad(String indexName) {
   hashTable.deleteWithoutLoad(
       indexName, (OAbstractPaginatedStorage) getDatabase().getStorage().getUnderlying());
 }