Examples of OIndexKeyCursor


Examples of com.orientechnologies.orient.core.index.OIndexKeyCursor

    };
  }

  @Override
  public OIndexKeyCursor keyCursor() {
    return new OIndexKeyCursor() {
      private int                                 nextEntriesIndex;
      private OHashIndexBucket.Entry<Object, V>[] entries;

      {
        OHashIndexBucket.Entry<Object, V> firstEntry = hashTable.firstEntry();
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexKeyCursor

          ++differences;
        }
      }

      if (((compareEntriesForAutomaticIndexes && !indexOne.getType().equals("DICTIONARY")) || !indexOne.isAutomatic())) {
        final OIndexKeyCursor indexKeyCursorOne = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<OIndexKeyCursor>() {
          public OIndexKeyCursor call() {
            return indexOne.keyCursor();
          }
        });

        Object key = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Object>() {
          @Override
          public Object call() {
            return indexKeyCursorOne.next(-1);
          }
        });

        while (key != null) {
          final Object indexKey = key;

          Object indexOneValue = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Object>() {
            public Object call() {
              return indexOne.get(indexKey);
            }
          });

          final Object indexTwoValue = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<Object>() {
            public Object call() {
              return indexTwo.get(indexKey);
            }
          });

          if (indexTwoValue == null) {
            ok = false;
            listener.onMessage("\n- ERR: Entry with key " + key + " is absent in index " + indexOne.getName() + " for DB2.");
            ++differences;
          } else if (indexOneValue instanceof Set && indexTwoValue instanceof Set) {
            final Set<Object> indexOneValueSet = (Set<Object>) indexOneValue;
            final Set<Object> indexTwoValueSet = (Set<Object>) indexTwoValue;

            if (!ODocumentHelper.compareSets(databaseDocumentTxOne, indexOneValueSet, databaseDocumentTxTwo, indexTwoValueSet,
                ridMapper)) {
              ok = false;
              reportIndexDiff(indexOne, key, indexOneValue, indexTwoValue);
            }
          } else if (indexOneValue instanceof ORID && indexTwoValue instanceof ORID) {
            if (ridMapper != null && ((ORID) indexOneValue).isPersistent()) {
              OIdentifiable identifiable = ridMapper.map((ORID) indexOneValue);

              if (identifiable != null)
                indexOneValue = identifiable.getIdentity();
            }
            if (!indexOneValue.equals(indexTwoValue)) {
              ok = false;
              reportIndexDiff(indexOne, key, indexOneValue, indexTwoValue);
            }
          } else if (!indexOneValue.equals(indexTwoValue)) {
            ok = false;
            reportIndexDiff(indexOne, key, indexOneValue, indexTwoValue);
          }

          key = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Object>() {
            @Override
            public Object call() {
              return indexKeyCursorOne.next(-1);
            }
          });
        }
      }
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexKeyCursor

  @Override
  public OIndexKeyCursor keyCursor() {
    acquireSharedLock();
    try {
      return new OIndexKeyCursor() {
        private final OSBTree.OSBTreeKeyCursor<Object> sbTreeKeyCursor = sbTree.keyCursor();

        @Override
        public Object next(int prefetchSize) {
          return sbTreeKeyCursor.next(prefetchSize);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.