Package com.orientechnologies.orient.core.storage

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


    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


    byte operation;
    int txId;
    long oldDataOffset;

    int offset;
    OPhysicalPosition ppos = new OPhysicalPosition();

    int size = (file.getFilledUpTo() / RECORD_SIZE);
    int recordsRecovered = 0;
    final ORecordId rid = new ORecordId();
View Full Code Here

    acquireExclusiveLock();
    try {

      // REMOVE ALL DATA BLOCKS
      final long tot = getEntries();
      final OPhysicalPosition ppos = new OPhysicalPosition();
      for (long i = 0; i < tot; ++i) {
        getPhysicalPosition(i, ppos);

        if (storage.checkForRecordValidity(ppos))
          storage.getDataSegment(ppos.dataSegment).deleteRecord(ppos.dataPosition);
View Full Code Here

  }

  public long getRecordsSize() throws IOException {
    long size = 0l;
    OClusterPositionIterator it = absoluteIterator();
    OPhysicalPosition pos = new OPhysicalPosition();
    while (it.hasNext()) {
      Long position = it.next();
      pos = getPhysicalPosition(position.longValue(), pos);
      if (pos.dataPosition > -1)
        size += storage.getDataSegment(pos.dataSegment).getRecordSize(pos.dataPosition);
View Full Code Here

    file.read(pos[1] + RECORD_FIX_SIZE, content, recordSize);

    if (clusterId > -1) {
      // CHANGE THE POINTMENT OF CLUSTER TO THE NEW POSITION
      final OCluster cluster = storage.getClusterById(clusterId);
      final OPhysicalPosition ppos = cluster.getPhysicalPosition(clusterPosition, new OPhysicalPosition());

      if (ppos.dataPosition != iSourcePosition)
        throw new OStorageException("Found corrupted record hole for rid " + clusterId + ":" + clusterPosition
            + ": data position is wrong: " + ppos.dataPosition + "<->" + iSourcePosition);
View Full Code Here

    lock.acquireSharedLock();
    try {
      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.SHARED);

      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

    try {

      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.EXCLUSIVE);
      try {

        final 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

    try {

      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.EXCLUSIVE);
      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

    acquireExclusiveLock();
    try {

      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;
      }

    } finally {
      releaseExclusiveLock();
View Full Code Here

  public void setPhysicalPosition(final long iPosition, final long iDataPosition) {
    acquireExclusiveLock();
    try {

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

    } finally {
      releaseExclusiveLock();
    }
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.