Package com.orientechnologies.orient.core.storage.fs

Examples of com.orientechnologies.orient.core.storage.fs.OFile.readInt()


      long p = pos[1];

      iPPosition.dataSegment = file.readShort(p);
      iPPosition.dataPosition = file.readLong(p += OConstants.SIZE_SHORT);
      iPPosition.type = file.readByte(p += OConstants.SIZE_LONG);
      iPPosition.version = file.readInt(p += OConstants.SIZE_BYTE);
      return iPPosition;

    } finally {
      releaseSharedLock();
    }
View Full Code Here


      // SAVE THE OLD DATA AND RETRIEVE THEM TO THE CALLER
      iPPosition.dataSegment = file.readShort(p);
      iPPosition.dataPosition = file.readLong(p += OConstants.SIZE_SHORT);
      iPPosition.type = file.readByte(p += OConstants.SIZE_LONG);
      iPPosition.version = file.readInt(p += OConstants.SIZE_BYTE);

      holeSegment.pushPosition(position);

      // SET VERSION = -1
      file.writeInt(p, -1);
View Full Code Here

    try {

      final long[] pos = getRelativePosition(iPosition);
      final OFile file = files[(int) pos[0]];

      final int recordSize = file.readInt(pos[1]);
      if (recordSize <= 0)
        // RECORD DELETED
        return null;

      if (pos[1] + RECORD_FIX_SIZE + recordSize > file.getFilledUpTo())
View Full Code Here

    try {

      final long[] pos = getRelativePosition(iPosition);
      final OFile file = files[(int) pos[0]];

      return file.readInt(pos[1]);

    } finally {
      releaseSharedLock();
    }
  }
View Full Code Here

    try {

      long[] pos = getRelativePosition(iPosition);
      final OFile file = files[(int) pos[0]];

      final int recordSize = file.readInt(pos[1]);
      // if (recordSize <= 0)
      // OLogManager.instance().error(this, "Error while writing to data file. The record size was invalid", OIOException.class);

      if (iContent.length == recordSize) {
        // USE THE OLD SPACE SINCE SIZE IT ISN'T CHANGED
View Full Code Here

    try {

      final long[] pos = getRelativePosition(iPosition);
      final OFile file = files[(int) pos[0]];

      final int recordSize = file.readInt(pos[1]);
      handleHole(iPosition, recordSize);
      return recordSize;

    } finally {
      releaseExclusiveLock();
View Full Code Here

            if (pos[1] >= file.getFilledUpTo())
              // END OF FILE
              break;

            int recordContentSize = file.readInt(pos[1]);
            if (recordContentSize < 0)
              // FOUND HOLE
              break;

            recordSize = recordContentSize + RECORD_FIX_SIZE;
View Full Code Here

  private int moveRecord(long iSourcePosition, long iDestinationPosition) throws IOException {
    // GET RECORD TO MOVE
    final long[] pos = getRelativePosition(iSourcePosition);
    final OFile file = files[(int) pos[0]];

    final int recordSize = file.readInt(pos[1]);

    if (recordSize < 0)
      // FOUND HOLE
      return -1;
View Full Code Here

      long p = pos[1];

      iPPosition.dataSegment = file.readShort(p);
      iPPosition.dataPosition = file.readLong(p += OConstants.SIZE_SHORT);
      iPPosition.type = file.readByte(p += OConstants.SIZE_LONG);
      iPPosition.version = file.readInt(p += OConstants.SIZE_BYTE);
      return iPPosition;

    } finally {
      releaseSharedLock();
    }
View Full Code Here

      // SAVE THE OLD DATA AND RETRIEVE THEM TO THE CALLER
      iPPosition.dataSegment = file.readShort(p);
      iPPosition.dataPosition = file.readLong(p += OConstants.SIZE_SHORT);
      iPPosition.type = file.readByte(p += OConstants.SIZE_LONG);
      iPPosition.version = file.readInt(p += OConstants.SIZE_BYTE);

      holeSegment.pushPosition(position);

      // SET VERSION = -1
      file.writeInt(p, -1);
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.