@Override public long getClusterRecordSizeById(final int clusterId) { checkIfActive(); try { return getStorage().getClusterById(clusterId).getRecordsSize(); } catch (Exception e) { throw OException .wrapException(new ODatabaseException("Error on reading records size for cluster with id '" + clusterId + "'"), e); } }
@Override public long getClusterRecordSizeByName(final String clusterName) { checkIfActive(); try { return getStorage().getClusterById(getClusterIdByName(clusterName)).getRecordsSize(); } catch (Exception e) { throw OException.wrapException(new ODatabaseException("Error on reading records size for cluster '" + clusterName + "'"), e); } }
@Override public final long getSize() { try { try { long size = 0; stateLock.acquireReadLock(); try { for (final OCluster c : clusters) { if (c != null) { size += c.getRecordsSize(); } } } finally { stateLock.releaseReadLock(); } return size; } catch (final IOException ioe) { throw OException.wrapException(new OStorageException("Cannot calculate records size"), ioe); } } catch (final RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (final Error ee) { throw logAndPrepareForRethrow(ee); } catch (final Throwable t) { throw logAndPrepareForRethrow(t); } }
totalElements += count; final long spaceUsed = !isRemote ? cluster.getRecordsSize() : 0; totalSpaceUsed += spaceUsed;