public long getCachedSize() {
if(dirtySizeInBytes) {
+ long oldSize = sizeInBytes;
+ if (oldSize > 0)
+ clusterTable.adjustCachedSize(-oldSize, this);
try {
sizeInBytes = getUsedSpace();
- //System.err.println("recomputed size of cluster " + getClusterId() + " => " + sizeInBytes);
+ //System.out.println("recomputed size of cluster " + getClusterId() + ": " + oldSize + " => " + sizeInBytes);
} catch (DatabaseException e) {
Logger.defaultLogError(e);
}
+ if (sizeInBytes != 0)
+ clusterTable.adjustCachedSize(sizeInBytes, this);
dirtySizeInBytes = false;
}
return sizeInBytes;