Examples of OPhysicalPosition


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

   *
   * @throws IOException
   */
  public long addPhysicalPosition(final int iDataSegmentId, final long iRecordPosition, final byte iRecordType) throws IOException {
    final long pos = ++total.dataPosition;
    map.put(new Long(pos), new OPhysicalPosition(iDataSegmentId, iRecordPosition, iRecordType));

    map.put(new Long(-1), total);
    return pos;
  }
View Full Code Here

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

   * @return Number of records recovered
   *
   * @throws IOException
   */
  private int recoverTransaction(final int iTxId) throws IOException {
    final OPhysicalPosition ppos = new OPhysicalPosition();

    int recordsRecovered = 0;
    final ORecordId rid = new ORecordId();

    final int size = (file.getFilledUpTo() / RECORD_SIZE);
View Full Code Here

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

    final boolean locked = iAtomicLock ? lock.acquireSharedLock() : false;

    try {
      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.SHARED);
      try {
        final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());
        if (ppos == null || !checkForRecordValidity(ppos))
          // DELETED
          return null;

        final ODataLocal data = getDataSegment(ppos.dataSegment);
View Full Code Here

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

    final boolean locked = lock.acquireSharedLock();

    try {
      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.EXCLUSIVE);
      try {
        final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());
        if (!checkForRecordValidity(ppos))
          // DELETED
          return -1;

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

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

    final boolean locked = lock.acquireSharedLock();

    try {
      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.EXCLUSIVE);
      try {
        final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());

        if (!checkForRecordValidity(ppos))
          // ALREADY DELETED
          return false;
View Full Code Here

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

  }

  public long addPhysicalPosition(final int iDataSegmentId, final long iRecordPosition, final byte iRecordType) {
    if (removed.size() > 0) {
      final int recycledPosition = removed.remove(removed.size() - 1);
      entries.set(recycledPosition, new OPhysicalPosition(iDataSegmentId, iRecordPosition, iRecordType));
      return recycledPosition;
    } else {
      entries.add(new OPhysicalPosition(iDataSegmentId, iRecordPosition, iRecordType));
      return entries.size() - 1;
    }
  }
View Full Code Here

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

      // ADD A REMOVED
      removed.add(new Integer((int) iPosition));
  }

  public void setPhysicalPosition(final long iPosition, final long iDataPosition) {
    final OPhysicalPosition ppos = entries.get((int) iPosition);
    ppos.dataPosition = iDataPosition;
  }
View Full Code Here

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

    final OPhysicalPosition ppos = entries.get((int) iPosition);
    ppos.dataPosition = iDataPosition;
  }

  public void setPhysicalPosition(final long iPosition, final int iDataId, final long iDataPosition, final byte iRecordType) {
    final OPhysicalPosition ppos = entries.get((int) iPosition);
    ppos.dataSegment = iDataId;
    ppos.dataPosition = iDataPosition;
    ppos.type = iRecordType;
  }
View Full Code Here

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

    try {
      map = new OMVRBTreeStorage<Long, OPhysicalPosition>(iStorage, iStorage.getClusterById(iPhysicalClusterId).getName(),
          OStreamSerializerLong.INSTANCE, OStreamSerializerAnyStreamable.INSTANCE);
      map.getRecord().setIdentity(iPhysicalClusterId, ORID.CLUSTER_POS_INVALID);

      total = new OPhysicalPosition(0, -1, (byte) 0);
      map.put(new Long(-1), total);

    } catch (Exception e) {
      throw new ODatabaseException("Error on creating internal map for logical cluster: " + iName, e);
    }
View Full Code Here

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

          iRecordId);
      map.load();

      total = map.get(new Long(-1));
      if (total == null) {
        total = new OPhysicalPosition(0, map.size(), (byte) 0);
        map.put(new Long(-1), total);
      }
    } catch (Exception e) {
      throw new ODatabaseException("Error on load internal map for logical cluster: " + name, e);
    }
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.