Examples of OPhysicalPosition


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

    int reqId;
    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

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

  @Override
  public void truncate() throws IOException {
    // 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

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

    int reqId;
    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

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

    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

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

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