Examples of OPhysicalPosition


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

    try {

      // REMOVE ALL DATA BLOCKS
      final long begin = getFirstEntryPosition();
      final long end = getLastEntryPosition();
      final OPhysicalPosition ppos = new OPhysicalPosition();
      for (long i = begin; i <= end; ++i) {
        getPhysicalPosition(i, ppos);

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

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

  }

  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

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

    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

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);
      storage = iStorage;

    } 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

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

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

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

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

    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

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

    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

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

    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
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.