@Override public void close() { close(false, false); }
@Override public boolean dropCluster(final String iClusterName, final boolean iTruncate) { return dropCluster(getClusterIdByName(iClusterName), iTruncate); }
public OStorageAbstract(final String name, final String iURL, final String mode) { this.name = normalizeName(name); if (OStringSerializerHelper.contains(this.name, ',')) throw new IllegalArgumentException("Invalid character in storage name: " + this.name); url = iURL; this.mode = mode; stateLock = new OReadersWriterSpinLock(); }
@Override public long countRecords() { long tot = 0; for (OCluster c : getClusterInstances()) if (c != null) tot += c.getEntries() - c.getTombstonesCount(); return tot; }
@Override public final <V> V callInLock(final Callable<V> iCallable, final boolean iExclusiveLock) { try { stateLock.acquireReadLock(); try { if (iExclusiveLock) { return super.callInLock(iCallable, true); } else { return super.callInLock(iCallable, false); } } finally { stateLock.releaseReadLock(); } } catch (final RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (final Error ee) { throw logAndPrepareForRethrow(ee); } catch (final Throwable t) { throw logAndPrepareForRethrow(t); } }
@Override public final boolean isClosed() { try { stateLock.acquireReadLock(); try { return super.isClosed(); } finally { stateLock.releaseReadLock(); } } catch (final RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (final Error ee) { throw logAndPrepareForRethrow(ee); } catch (final Throwable t) { throw logAndPrepareForRethrow(t); } }
@Override public void shutdown() { close(true, false); }
super.close(force, onDelete);