Package com.orientechnologies.orient.core.version

Examples of com.orientechnologies.orient.core.version.ORecordVersion$ORecordVersionSerializer


      int lastPosition;
      byte counter = 0;
      int freeSpace = localPage.getFreeSpace();

      ORecordVersion recordVersion = OVersionFactory.instance().createVersion();
      recordVersion.increment();

      do {
        lastPosition = localPage.appendRecord(recordVersion, new byte[] { counter, counter, counter }, false);
        if (lastPosition >= 0) {
          Assert.assertEquals(lastPosition, positions.size());
View Full Code Here


      int lastPosition;
      byte counter = 0;
      int freeSpace = localPage.getFreeSpace();

      ORecordVersion recordVersion = OVersionFactory.instance().createVersion();
      recordVersion.increment();

      do {
        lastPosition = localPage.appendRecord(recordVersion, new byte[] { counter, counter, counter }, false);
        if (lastPosition >= 0) {
          Assert.assertEquals(lastPosition, positions.size());
View Full Code Here

    OCacheEntry cacheEntry = new OCacheEntry(0, 0, cachePointer, false);
    try {
      OClusterPage localPage = new OClusterPage(cacheEntry, true, ODurablePage.TrackMode.FULL);
      Assert.assertEquals(localPage.getRecordsCount(), 0);

      ORecordVersion recordVersion = OVersionFactory.instance().createVersion();
      recordVersion.increment();

      int index = localPage.appendRecord(recordVersion, new byte[] { 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 }, false);
      int freeSpace = localPage.getFreeSpace();

      ORecordVersion newRecordVersion = OVersionFactory.instance().createVersion();
      newRecordVersion.copyFrom(recordVersion);
      newRecordVersion.increment();

      int written = localPage.replaceRecord(index, new byte[] { 5, 2, 3, 4, 5, 11, 5, 4, 3, 2, 1, 3 }, newRecordVersion);
      Assert.assertEquals(localPage.getFreeSpace(), freeSpace);
      Assert.assertEquals(written, 11);
View Full Code Here

     if (!isConnectionAlive())
       return;

     final ORID rid = channel.readRID();
     final ORecordVersion version = channel.readVersion();
     final byte mode = channel.readByte();

     final int result = deleteRecord(connection.database, rid, version);

     if (mode < 2) {
View Full Code Here

     if (!isConnectionAlive())
       return;

     final ORID rid = channel.readRID();
     final ORecordVersion version = channel.readVersion();
     final byte mode = channel.readByte();

     final int result = cleanOutRecord(connection.database, rid, version);

     if (mode < 2) {
View Full Code Here

     final ORecordId rid = channel.readRID();
     boolean updateContent = true;
     if (connection.data.protocolVersion >= 23)
       updateContent = channel.readBoolean();
     final byte[] buffer = channel.readBytes();
     final ORecordVersion version = channel.readVersion();
     final byte recordType = channel.readByte();
     final byte mode = channel.readByte();

     final ORecordVersion newVersion = updateRecord(connection.database, rid, buffer, version, recordType, updateContent);

     if (mode < 2) {
       beginResponse();
       try {
         sendOk(clientTxId);
View Full Code Here

      setIntValue(entryIndexPosition, freePosition);

      byte[] serializedVersion = getBinaryValue(entryIndexPosition + OIntegerSerializer.INT_SIZE, OVersionFactory.instance()
          .getVersionSize());

      ORecordVersion existingRecordVersion = OVersionFactory.instance().createVersion();
      existingRecordVersion.getSerializer().fastReadFrom(serializedVersion, 0, existingRecordVersion);

      if (existingRecordVersion.compareTo(recordVersion) < 0) {
        recordVersion.getSerializer().fastWriteTo(serializedVersion, 0, recordVersion);
        setBinaryValue(entryIndexPosition + OIntegerSerializer.INT_SIZE, serializedVersion);
      } else {
        if (!keepTombstoneVersion) {
          existingRecordVersion.increment();
          existingRecordVersion.getSerializer().fastWriteTo(serializedVersion, 0, existingRecordVersion);
          setBinaryValue(entryIndexPosition + OIntegerSerializer.INT_SIZE, serializedVersion);
        }
      }

    } else {
View Full Code Here

    if (recordVersion != null) {
      byte[] serializedVersion = getBinaryValue(entryIndexPosition + OIntegerSerializer.INT_SIZE, OVersionFactory.instance()
          .getVersionSize());

      ORecordVersion storedRecordVersion = OVersionFactory.instance().createVersion();
      storedRecordVersion.getSerializer().fastReadFrom(serializedVersion, 0, storedRecordVersion);
      if (recordVersion.compareTo(storedRecordVersion) > 0) {
        recordVersion.getSerializer().fastWriteTo(serializedVersion, 0, recordVersion);
        setBinaryValue(entryIndexPosition + OIntegerSerializer.INT_SIZE, serializedVersion);
      }
    }
View Full Code Here

    int entryIndexPosition = PAGE_INDEXES_OFFSET + position * INDEX_ITEM_SIZE;
    byte[] serializedVersion = getBinaryValue(entryIndexPosition + OIntegerSerializer.INT_SIZE, OVersionFactory.instance()
        .getVersionSize());

    ORecordVersion recordVersion = OVersionFactory.instance().createVersion();
    recordVersion.getSerializer().fastReadFrom(serializedVersion, 0, recordVersion);

    return recordVersion;
  }
View Full Code Here

    final OPhysicalPosition physicalPosition = new OPhysicalPosition();
    int position = startPosition;
    physicalPosition.clusterPosition = OClusterPositionSerializer.INSTANCE.deserialize(stream, position);
    position += OClusterPositionSerializer.INSTANCE.getFixedLength();

    final ORecordVersion version = OVersionFactory.instance().createVersion();
    version.getSerializer().readFrom(stream, position, version);
    position += OVersionFactory.instance().getVersionSize();

    physicalPosition.recordSize = OIntegerSerializer.INSTANCE.deserializeLiteral(stream, position);
    position += OIntegerSerializer.INT_SIZE;
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.version.ORecordVersion$ORecordVersionSerializer

Copyright © 2018 www.massapicom. 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.