Examples of OTransactionIndexChanges


Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

  }

  @Override
  public Collection<OIdentifiable> get(final Object iKey) {

    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());

    final List<OIdentifiable> result;
    if (indexChanges == null || !indexChanges.cleared)
      // BEGIN FROM THE UNDERLYING RESULT SET
      result = new ArrayList<OIdentifiable>(super.get(iKey));
    else
      // BEGIN FROM EMPTY RESULT SET
      result = new ArrayList<OIdentifiable>();

    // FILTER RESULT SET WITH TRANSACTIONAL CHANGES
    if (indexChanges != null && indexChanges.containsChangesPerKey(iKey)) {
      final OTransactionIndexChangesPerKey value = indexChanges.getChangesPerKey(iKey);
      if (value != null) {
        for (OTransactionIndexEntry entry : value.entries) {
          if (entry.operation == OPERATION.REMOVE) {
            if (entry.value == null) {
              // REMOVE THE ENTIRE KEY, SO RESULT SET IS EMPTY
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

  }

  public long getSize() {
    long tot = delegate.getSize();

    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());
    if (indexChanges != null) {
      if (indexChanges.cleared)
        // BEGIN FROM 0
        tot = 0;
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

  }

  @Override
  public Collection<OIdentifiable> get(Object iKey) {

    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndex(delegate.getName());

    final List<OIdentifiable> result;
    if (indexChanges == null || !indexChanges.cleared)
      // BEGIN FROM THE UNDERLYING RESULT SET
      result = new ArrayList<OIdentifiable>(super.get(iKey));
    else
      // BEGIN FROM EMPTY RESULT SET
      result = new ArrayList<OIdentifiable>();

    // FILTER RESULT SET WITH TRANSACTIONAL CHANGES
    if (indexChanges != null && indexChanges.containsChangesPerKey(iKey)) {
      final OTransactionIndexChangesPerKey value = indexChanges.getChangesPerKey(iKey);
      if (value != null) {
        for (OTransactionIndexEntry entry : value.entries) {
          if (entry.operation == OPERATION.REMOVE) {
            if (entry.value == null) {
              // REMOVE THE ENTIRE KEY, SO RESULT SET IS EMPTY
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

  }

  @Override
  public Collection<OIdentifiable> get(final Object iKey) {

    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());

    final List<OIdentifiable> result;
    if (indexChanges == null || !indexChanges.cleared)
      // BEGIN FROM THE UNDERLYING RESULT SET
      result = new ArrayList<OIdentifiable>(super.get(iKey));
    else
      // BEGIN FROM EMPTY RESULT SET
      result = new ArrayList<OIdentifiable>();

    // FILTER RESULT SET WITH TRANSACTIONAL CHANGES
    if (indexChanges != null && indexChanges.containsChangesPerKey(iKey)) {
      final OTransactionIndexChangesPerKey value = indexChanges.getChangesPerKey(iKey);
      if (value != null) {
        for (OTransactionIndexEntry entry : value.entries) {
          if (entry.operation == OPERATION.REMOVE) {
            if (entry.value == null) {
              // REMOVE THE ENTIRE KEY, SO RESULT SET IS EMPTY
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

  }

  public long getSize() {
    long tot = delegate.getSize();

    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());
    if (indexChanges != null) {
      if (indexChanges.cleared)
        // BEGIN FROM 0
        tot = 0;
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

    return null;
  }

  @Override
  public OIdentifiable get(final Object key) {
    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());

    if (indexChanges == null)
      return super.get(key);

    OIdentifiable result;
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

  @Override
  public OIndexCursor iterateEntriesBetween(final Object fromKey, final boolean fromInclusive, final Object toKey,
      final boolean toInclusive, final boolean ascOrder) {

    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());
    if (indexChanges == null)
      return super.iterateEntriesBetween(fromKey, fromInclusive, toKey, toInclusive, ascOrder);

    final OIndexCursor txCursor;
    if (ascOrder)
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

    return new OIndexTxCursor(txCursor, backedCursor, ascOrder, indexChanges);
  }

  @Override
  public OIndexCursor iterateEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder) {
    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());
    if (indexChanges == null)
      return super.iterateEntriesMajor(fromKey, fromInclusive, ascOrder);

    final OIndexCursor txCursor;

    final Object lastKey = indexChanges.getLastKey();
    if (ascOrder)
      txCursor = new PureTxBetweenIndexForwardCursor(fromKey, fromInclusive, lastKey, true, indexChanges);
    else
      txCursor = new PureTxBetweenIndexBackwardCursor(fromKey, fromInclusive, lastKey, true, indexChanges);
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

    return new OIndexTxCursor(txCursor, backedCursor, ascOrder, indexChanges);
  }

  @Override
  public OIndexCursor iterateEntriesMinor(Object toKey, boolean toInclusive, boolean ascOrder) {
    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());
    if (indexChanges == null)
      return super.iterateEntriesMinor(toKey, toInclusive, ascOrder);

    final OIndexCursor txCursor;

    final Object firstKey = indexChanges.getFirstKey();
    if (ascOrder)
      txCursor = new PureTxBetweenIndexForwardCursor(firstKey, true, toKey, toInclusive, indexChanges);
    else
      txCursor = new PureTxBetweenIndexBackwardCursor(firstKey, true, toKey, toInclusive, indexChanges);
View Full Code Here

Examples of com.orientechnologies.orient.core.tx.OTransactionIndexChanges

    return new OIndexTxCursor(txCursor, backedCursor, ascOrder, indexChanges);
  }

  @Override
  public OIndexCursor iterateEntries(Collection<?> keys, boolean ascSortOrder) {
    final OTransactionIndexChanges indexChanges = database.getTransaction().getIndexChanges(delegate.getName());
    if (indexChanges == null)
      return super.iterateEntries(keys, ascSortOrder);

    final List<Object> sortedKeys = new ArrayList<Object>(keys);
    if (ascSortOrder)
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.