/** {@inheritDoc} */ @Override public void close() throws IOException { try { mCloser.close(); } finally { if (mDebugRegistered) { ResourceTracker.get().unregisterResource(this); mDebugRegistered = false; } } }
/** {@inheritDoc} */ @Override public Object invoke( final Object proxy, final Method method, final Object[] args ) throws Throwable { if (method.getName().equals("close") && args == null) { get().unregisterResource(mResource); } return method.invoke(mResource, args); } }
/** {@inheritDoc} */ @Override public synchronized void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close MetaTable instance in state %s.", oldState); ResourceTracker.get().unregisterResource(this); mTable.close(); }
/** {@inheritDoc} */ @Override public synchronized void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close FijiSystemTable instance in state %s.", oldState); ResourceTracker.get().unregisterResource(this); mTable.close(); }
/** * Releases the resources used by this table. * * @throws java.io.IOException on I/O error. */ private void closeResources() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close FijiTable instance %s in state %s.", this, oldState); LOG.debug("Closing CassandraFijiTable '{}'.", this); ResourceUtils.releaseOrLog(mFiji); if (oldState != State.UNINITIALIZED) { ResourceTracker.get().unregisterResource(this); } // Relinquish strong reference to the TableLayoutMonitor in case the user keeps their reference // to this FijiTable. mLayoutMonitor = null; LOG.debug("CassandraFijiTable '{}' closed.", mTableURI); }
/** {@inheritDoc} */ @Override public synchronized void close() throws IOException { flush(); final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close SchemaTable instance in state %s.", oldState); ResourceTracker.get().unregisterResource(this); mZKLock.close(); mZKClient.close(); }
/** {@inheritDoc} */ @Override public Object invoke( final Object proxy, final Method method, final Object[] args ) throws Throwable { if (method.getName().equals("close") && args == null) { if (mTrackedProxy) { ResourceTracker.get().unregisterResource(this); } mCache.release(mKey); return this; } else { return method.invoke(mValue, args); } } }
/** {@inheritDoc} */ @Override public void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close FijiRowScanner instance in state %s.", oldState); ResourceTracker.get().unregisterResource(this); mResultScanner.close(); mHTable.close(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close FijiTableReader instance %s in state %s.", this, oldState); ResourceTracker.get().unregisterResource(this); mLayoutConsumerRegistration.close(); mTable.release(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close FijiTableReader instance %s in state %s.", this, oldState); mLayoutConsumerRegistration.close(); mTable.release(); ResourceTracker.get().unregisterResource(this); } }
/** {@inheritDoc} */ @Override public void unlock() throws IOException { synchronized (this) { ResourceTracker.get().unregisterResource(mCreatedPath); unlockInternal(); } }
/** {@inheritDoc} */ @Override public void close() throws IOException { ResourceTracker.get().unregisterResource(this); mTable.release(); } }
/** * Releases the tables in the pool. * * @throws IOException If there is an error closing the pool. */ @Override public synchronized void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close FijiTablePool instance in state %s.", oldState); ResourceTracker.get().unregisterResource(this); if (null != mCleanupThread) { mCleanupThread.interrupt(); } for (Pool pool : mPoolCache.values()) { ResourceUtils.closeOrLog(pool); } mPoolCache.clear(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { synchronized (this) { if (mCreatedPath != null) { // This will trigger a leaked acquired lock resource error in the cleanup log by not // unregistering mCreatedPath with the ResourceTracker. unlockInternal(); } ResourceTracker.get().unregisterResource(this); } } }
/** * Releases the resources used by this table. * * @throws IOException on I/O error. */ private void closeResources() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN || oldState == State.UNINITIALIZED, "Cannot close FijiTable instance %s in state %s.", this, oldState); LOG.debug("Closing HBaseFijiTable '{}'.", this); ResourceUtils.closeOrLog(mHConnection); ResourceUtils.closeOrLog(mLayoutMonitor); ResourceUtils.releaseOrLog(mFiji); if (oldState != State.UNINITIALIZED) { ResourceTracker.get().unregisterResource(this); } LOG.debug("HBaseFijiTable '{}' closed.", mTableURI); }
/** {@inheritDoc} */ @Override public void close() { try { mCache.release(mCacheKey); } catch (IOException e) { // Impossible since {@link CuratorFramework#close()} does not throw IOException. throw new InternalFijiError(e); } finally { ResourceTracker.get().unregisterResource(this); } } }
/** {@inheritDoc} */ @Override public void close() { try { mCache.release(mCacheKey); } catch (IOException e) { // Impossible since {@link CuratorFramework#close()} does not throw IOException. throw new InternalFijiError(e); } finally { ResourceTracker.get().unregisterResource(this); } } }
/** {@inheritDoc} */ @Override public void close() throws IOException { synchronized (mMonitor) { flush(); Preconditions.checkState(mState == State.OPEN, "Cannot close BufferedWriter instance %s in state %s.", this, mState); mState = State.CLOSED; mLayoutConsumerRegistration.close(); mTable.release(); ResourceTracker.get().unregisterResource(this); } } }
/** {@inheritDoc} */ @Override public synchronized void close() throws IOException { flush(); final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close SchemaTable instance in state %s.", oldState); ResourceTracker.get().unregisterResource(this); ResourceUtils.closeOrLog(mSchemaHashTable); ResourceUtils.closeOrLog(mSchemaIdTable); ResourceUtils.closeOrLog(mZKLock); ResourceUtils.closeOrLog(mZKClient); }
/** {@inheritDoc} */ @Override public void close() throws IOException { synchronized (mInternalLock) { flush(); Preconditions.checkState(mState == State.OPEN, "Cannot close BufferedWriter instance %s in state %s.", this, mState); mState = State.CLOSED; ResourceTracker.get().unregisterResource(this); mLayoutConsumerRegistration.close(); mHTable.close(); mTable.release(); } } }