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