Package com.orientechnologies.orient.core.storage

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


  /**
   * Update position in data segment (usually on defrag)
   */
  public void setPhysicalPosition(final long iPosition, final long iDataPosition) {
    Long key = new Long(iPosition);
    final OPhysicalPosition ppos = map.get(key);
    ppos.dataPosition = iDataPosition;
    map.put(key, ppos);
  }
View Full Code Here


  /**
   * Change the PhysicalPosition of the logical record iPosition.
   */
  public void setPhysicalPosition(final long iPosition, final int iDataId, final long iDataPosition, final byte iRecordType) {
    Long key = new Long(iPosition);
    final OPhysicalPosition ppos = map.get(key);
    ppos.dataSegment = iDataId;
    ppos.dataPosition = iDataPosition;
    ppos.type = iRecordType;
    map.put(key, ppos);
  }
View Full Code Here

    map.put(key, ppos);
  }

  public void updateRecordType(final long iPosition, final byte iRecordType) throws IOException {
    final Long key = new Long(iPosition);
    final OPhysicalPosition ppos = map.get(key);
    ppos.type = iRecordType;
    map.put(key, ppos);
  }
View Full Code Here

    map.put(key, ppos);
  }

  public void updateVersion(long iPosition, final int iVersion) throws IOException {
    final Long key = new Long(iPosition);
    final OPhysicalPosition ppos = map.get(key);
    ppos.version = iVersion;
    map.put(key, ppos);
  }
View Full Code Here

    map.put(key, ppos);
  }

  public void truncate() throws IOException {
    map.clear();
    total = new OPhysicalPosition(0, -1, (byte) 0);
    map.put(new Long(-1), total);
    map.save();
  }
View Full Code Here

   *
   * @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

  }

  protected void deleteRecord(final int iTxId, final OCluster iClusterSegment, final long iPosition, final int iVersion) {
    try {
      // GET THE PPOS OF THE RECORD
      final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iPosition, new OPhysicalPosition());

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

  protected ORawBuffer readRecord(final OCluster iClusterSegment, final ORecordId iRid, final boolean iAtomicLock) {
    final long timer = OProfiler.getInstance().startChrono();

    final boolean locked = lock.acquireSharedLock();
    try {
      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);
View Full Code Here

    final OCluster cluster = getClusterById(iRid.clusterId);

    final boolean locked = lock.acquireSharedLock();
    try {
      OPhysicalPosition ppos = cluster.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());
      if (ppos == null)
        return -1;

      // MVCC TRANSACTION: CHECK IF VERSION IS THE SAME
      if (iVersion > -1 && ppos.version != iVersion)
View Full Code Here

    final OCluster cluster = getClusterById(iRid.clusterId);

    final boolean locked = lock.acquireSharedLock();
    try {
      final OPhysicalPosition ppos = cluster.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());

      if (ppos == null)
        return false;

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

TOP

Related Classes of com.orientechnologies.orient.core.storage.OPhysicalPosition

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.