Examples of ORawBuffer


Examples of com.orientechnologies.orient.core.storage.ORawBuffer

        final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());

        if (ppos == null)
          return null;

        return new ORawBuffer(data.readRecord(ppos.dataPosition), ppos.version, ppos.type);

      } finally {
        lockManager.releaseLock(Thread.currentThread(), iRid, LOCK.SHARED);
      }
    } catch (IOException e) {
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

        if (ppos == null || !checkForRecordValidity(ppos))
          // DELETED
          return null;

        final ODataLocal data = getDataSegment(ppos.dataSegment);
        return new ORawBuffer(data.getRecord(ppos.dataPosition), ppos.version, ppos.type);

      } finally {
        lockManager.releaseLock(Thread.currentThread(), iRid, LOCK.SHARED);
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

  }

  @Override
  public OMVRBTreePersistent<K, V> load() throws IOException {
    ((ORecordId) record.getIdentity()).clusterId = clusterId;
    ORawBuffer raw = storage.readRecord(null, (ORecordId) record.getIdentity(), null);

    if (raw == null)
      throw new OConfigurationException("Can't load map with id " + clusterId + ":" + record.getIdentity().getClusterPosition());

    record.setVersion(raw.version);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

  protected int updateRecord(final int iTxId, final OCluster iClusterSegment, final ORecordId iRid, final byte[] iContent,
      final int iVersion, final byte iRecordType) {
    try {
      // READ CURRENT RECORD CONTENT
      final ORawBuffer buffer = storage.readRecord(iClusterSegment, iRid, true);

      if (buffer == null)
        throw new OTransactionException("Can't retrieve the updated record #" + iRid);

      // MVCC TRANSACTION: CHECK IF VERSION IS THE SAME
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

    load();
  }

  @Override
  public OMVRBTreeEntryStorage<K, V> load() throws IOException {
    ORawBuffer raw = ((OMVRBTreeStorage<K, V>) tree).storage.readRecord(null, (ORecordId) record.getIdentity(), null);

    record.setVersion(raw.version);

    fromStream(raw.buffer);
    super.load();
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

        callbackHooks(TYPE.AFTER_READ, record);
        return (RET) record;
      }

      final ORawBuffer recordBuffer = underlying.read(iRid, iFetchPlan);
      if (recordBuffer == null)
        return null;

      if (iRecord == null || iRecord.getRecordType() != recordBuffer.recordType)
        // NO SAME RECORD TYPE: CAN'T REUSE OLD ONE BUT CREATE A NEW ONE FOR IT
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

    db = new ODatabaseRaw("embedded:database/test");
  }

  @Override
  public void cycle() throws UnsupportedEncodingException {
    ORawBuffer buffer;
    objectsRead = 0;

    int clusterId = db.getClusterIdByName(CLUSTER_NAME);

    final ORecordId rid = new ORecordId(clusterId);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

          beginResponse(network);

          if (network.readByte() == 0)
            return null;

          final ORawBuffer buffer = new ORawBuffer(network.readBytes(), network.readInt(), network.readByte());

          ORecordInternal<?> record;
          while (network.readByte() == 2) {
            record = (ORecordInternal<?>) readIdentifiable(network, iDatabase);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

  @ConsoleCommand(description = "Display a record as raw bytes")
  public void displayRawRecord(@ConsoleParameter(name = "rid", description = "The record id to display") final String iRecordId) {
    checkCurrentDatabase();

    ORecordId rid = new ORecordId(iRecordId);
    final ORawBuffer buffer = currentDatabase.getStorage().readRecord(currentDatabase, rid, null);

    if (buffer == null)
      throw new OException("The record has been deleted");

    out.println("Raw record content (size=" + buffer.buffer.length + "):\n\n" + new String(buffer.buffer));
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORawBuffer

  @ConsoleCommand(description = "Display a record as raw bytes")
  public void displayRawRecord(@ConsoleParameter(name = "rid", description = "The record id to display") final String iRecordId) {
    checkCurrentDatabase();

    ORecordId rid = new ORecordId(iRecordId);
    final ORawBuffer buffer = currentDatabase.getStorage().readRecord(currentDatabase, rid, null);

    if (buffer == null)
      throw new OException("The record has been deleted");

    out.println("Raw record content (size=" + buffer.buffer.length + "):\n\n" + new String(buffer.buffer));
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.