Examples of ORecordSerializationContext


Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

      else
        c.applyDiff(delta);
    }
    newEntries.clear();

    final ORecordSerializationContext context;
    boolean remoteMode = ODatabaseRecordThreadLocal.INSTANCE.get().getStorage() instanceof OStorageProxy;
    if (remoteMode) {
      context = null;
    } else
      context = ORecordSerializationContext.getContext();

    // make sure that we really save underlying record.
    if (collectionPointer == null) {
      if (context != null) {
        final int clusterId = getHighLevelDocClusterId();
        assert clusterId > -1;
        collectionPointer = ODatabaseRecordThreadLocal.INSTANCE.get().getSbTreeCollectionManager()
            .createSBTree(clusterId, ownerUuid);
      }
    }

    OBonsaiCollectionPointer collectionPointer;
    if (this.collectionPointer != null)
      collectionPointer = this.collectionPointer;
    else {
      collectionPointer = OBonsaiCollectionPointer.INVALID;
    }

    OLongSerializer.INSTANCE.serializeLiteral(collectionPointer.getFileId(), stream, offset);
    offset += OLongSerializer.LONG_SIZE;

    OBonsaiBucketPointer rootPointer = collectionPointer.getRootPointer();
    OLongSerializer.INSTANCE.serializeLiteral(rootPointer.getPageIndex(), stream, offset);
    offset += OLongSerializer.LONG_SIZE;

    OIntegerSerializer.INSTANCE.serializeLiteral(rootPointer.getPageOffset(), stream, offset);
    offset += OIntegerSerializer.INT_SIZE;

    // Keep this section for binary compatibility with versions older then 1.7.5
    OIntegerSerializer.INSTANCE.serializeLiteral(size, stream, offset);
    offset += OIntegerSerializer.INT_SIZE;

    if (context == null) {
      ChangeSerializationHelper.INSTANCE.serializeChanges(changes, OLinkSerializer.INSTANCE, stream, offset);
    } else {
      context.push(new ORidBagUpdateSerializationOperation(changes, collectionPointer));

      // 0-length serialized list of changes
      OIntegerSerializer.INSTANCE.serializeLiteral(0, stream, offset);
      offset += OIntegerSerializer.INT_SIZE;
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

    changes.clear();
  }

  @Override
  public void requestDelete() {
    final ORecordSerializationContext context = ORecordSerializationContext.getContext();
    if (context != null && collectionPointer != null)
      context.push(new ORidBagDeleteSerializationOperation(collectionPointer, this));
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

    return delegate instanceof OEmbeddedRidBag;
  }

  public int toStream(BytesContainer bytesContainer) throws OSerializationException {

    final ORecordSerializationContext context = ORecordSerializationContext.getContext();
    if (context != null) {
      if (delegate.size() >= topThreshold && isEmbedded()
          && ODatabaseRecordThreadLocal.INSTANCE.get().getSbTreeCollectionManager() != null) {
        ORidBagDelegate oldDelegate = delegate;
        delegate = new OSBTreeRidBag();
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

            atomicOperationsManager.startAtomicOperation();
            try {
              ppos = cluster.createRecord(content, recordVersion, recordType);
              rid.clusterPosition = ppos.clusterPosition;

              final ORecordSerializationContext context = ORecordSerializationContext.getContext();
              if (context != null)
                context.executeOperations(this);
              atomicOperationsManager.endAtomicOperation(false);
            } catch (Throwable throwable) {
              atomicOperationsManager.endAtomicOperation(true);

              OLogManager.instance().error(this, "Error on creating record in cluster: " + cluster, throwable);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

            atomicOperationsManager.startAtomicOperation();
            try {
              if (updateContent)
                cluster.updateRecord(rid.clusterPosition, content, ppos.recordVersion, recordType);

              final ORecordSerializationContext context = ORecordSerializationContext.getContext();
              if (context != null)
                context.executeOperations(this);
              atomicOperationsManager.endAtomicOperation(false);
            } catch (Throwable e) {
              atomicOperationsManager.endAtomicOperation(true);

              OLogManager.instance().error(this, "Error on updating record " + rid + " (cluster: " + cluster + ")", e);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

                throw new OConcurrentModificationException(rid, ppos.recordVersion, version, ORecordOperation.DELETED);

            makeStorageDirty();
            atomicOperationsManager.startAtomicOperation();
            try {
              final ORecordSerializationContext context = ORecordSerializationContext.getContext();
              if (context != null)
                context.executeOperations(this);

              cluster.deleteRecord(ppos.clusterPosition);
              atomicOperationsManager.endAtomicOperation(false);
            } catch (Throwable e) {
              atomicOperationsManager.endAtomicOperation(true);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext

              return new OStorageOperationResult<Boolean>(false);

            makeStorageDirty();
            atomicOperationsManager.startAtomicOperation();
            try {
              final ORecordSerializationContext context = ORecordSerializationContext.getContext();
              if (context != null)
                context.executeOperations(this);

              cluster.hideRecord(ppos.clusterPosition);
              atomicOperationsManager.endAtomicOperation(false);
            } catch (Throwable e) {
              atomicOperationsManager.endAtomicOperation(true);
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.