@SuppressWarnings("resource") AutoCloseableLock writeLock() { return new AutoCloseableLock(writeLock).open(); }
public RocksDBStore(String name, ColumnFamilyDescriptor family, ColumnFamilyHandle handle, RocksDB db, int stripes) { super(); this.family = family; this.name = name; this.db = db; this.parallel = stripes; this.handle = handle; this.sharedLocks = new AutoCloseableLock[stripes]; this.exclusiveLocks = new AutoCloseableLock[stripes]; for (int i = 0; i < stripes; i++) { ReadWriteLock core = new ReentrantReadWriteLock(); sharedLocks[i] = new AutoCloseableLock(core.readLock()); exclusiveLocks[i] = new AutoCloseableLock(core.writeLock()); } if (COLLECT_METRICS) { registerMetrics(); } }
@SuppressWarnings("resource") public AutoCloseableLock readLock() { return new AutoCloseableLock(readLock).open(); }
@SuppressWarnings("resource") public AutoCloseableLock writeLock() { return new AutoCloseableLock(writeLock).open(); }
@SuppressWarnings("resource") AutoCloseableLock readLock() { return new AutoCloseableLock(readLock).open(); }