Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.OStorageException


      } finally {
        lockManager.releaseLock(Thread.currentThread(), iRid, LOCK.EXCLUSIVE);
      }
    } catch (IOException e) {
      throw new OStorageException("Error on update record " + iRid, e);

    } finally {
      lock.releaseSharedLock();
      OProfiler.getInstance().stopChrono("OStorageMemory.updateRecord", timer);
    }
View Full Code Here


      } finally {
        lockManager.releaseLock(Thread.currentThread(), iRid, LOCK.EXCLUSIVE);
      }

    } catch (IOException e) {
      throw new OStorageException("Error on delete record " + iRid, e);

    } finally {
      lock.releaseSharedLock();
      OProfiler.getInstance().stopChrono("OStorageMemory.deleteRecord", timer);
    }
View Full Code Here

    try {

      return new long[] { cluster.getFirstEntryPosition(), cluster.getLastEntryPosition() };

    } catch (IOException e) {
      throw new OStorageException("Error on getting last entry position in cluster: " + iClusterId, e);
    } finally {
      lock.releaseSharedLock();
    }
  }
View Full Code Here

  /**
   * Check if the storage is open. If it's closed an exception is raised.
   */
  protected void checkOpeness() {
    if (status != STATUS.OPEN)
      throw new OStorageException("Storage " + name + " is not opened.");
  }
View Full Code Here

   */
  public OStorageConfiguration load() throws OSerializationException {
    final byte[] record = storage.readRecord(null, CONFIG_RID, null).buffer;

    if (record == null)
      throw new OStorageException("Can't load database's configuration. The database seems to be corrupted.");

    fromStream(record);
    return this;
  }
View Full Code Here

      if (recordSize <= 0)
        // RECORD DELETED
        return null;

      if (pos[1] + RECORD_FIX_SIZE + recordSize > file.getFilledUpTo())
        throw new OStorageException(
            "Error on reading record from file '"
                + file.getOsFile().getName()
                + "', position "
                + iPosition
                + ", size "
View Full Code Here

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

      cluster.setPhysicalPosition(clusterPosition, iDestinationPosition);
    }
View Full Code Here

    }

    // TRY TO CREATE A NEW FILE
    if (maxSize > 0 && getSize() >= maxSize)
      // OUT OF MAX SIZE
      throw new OStorageException("Unable to allocate the requested space of " + iRecordSize
          + " bytes because the segment is full: max-Size=" + maxSize + ", currentSize=" + getFilledUpTo());

    // COPY THE OLD ARRAY TO THE NEW ONE
    OFile[] newFiles = new OFile[files.length + 1];
    for (int i = 0; i < files.length; ++i)
View Full Code Here

    cursor.dataOffset = iHolePosition + iHoleSize;
    ODataHoleInfo higherHole = availableHolesByPosition.higherKey(cursor);

    if (lowerHole != null && higherHole != null && lowerHole.dataOffset >= higherHole.dataOffset)
      // CHECK ERROR
      throw new OStorageException("Found bad order in hole list: " + lowerHole + " is higher than " + higherHole);

    final ODataHoleInfo closestHole;
    if (lowerHole != null && (lowerHole.dataOffset + lowerHole.size < iLowerRange))
      // OUT OF RANGE: INVALID IT
      lowerHole = null;
View Full Code Here

      if (e instanceof OException)
        // PASS THROUGH
        throw (OException) e;
      else
        throw new OStorageException("Can't open the remote storage: " + name, e);

    } finally {
      lock.releaseExclusiveLock();
    }
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.OStorageException

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.