congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ResourceUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
ResourceUtils
in
com.moz.fiji.schema.util

Best Java code snippets using com.moz.fiji.schema.util.ResourceUtils (Showing top 20 results out of 315)

origin: com.moz.fiji.hive/fiji-hive-lib

/** {@inheritDoc} */
@Override
public void close() throws IOException {
 ResourceUtils.closeOrLog(mCurrentPagedFijiRowDataWritable);
 ResourceUtils.closeOrLog(mScanner);
 ResourceUtils.closeOrLog(mFijiTableReader);
 ResourceUtils.releaseOrLog(mFijiTable);
 ResourceUtils.releaseOrLog(mFiji);
}
origin: com.moz.fiji.examples.phonebook/fiji-phonebook

 /**
  * Close all underlying resources.
  */
 @Override
 public void close() {
  ResourceUtils.closeOrLog(mConsoleReader);
 }
}
origin: com.moz.fiji.schema/fiji-schema

/** {@inheritDoc} */
@Override
protected void cleanup() throws IOException {
 ResourceUtils.releaseOrLog(mTable);
 ResourceUtils.releaseOrLog(mFiji);
 mTableURI = null;
 mTable = null;
 mFiji = null;
}
origin: com.moz.fiji.hive/fiji-hive-lib

/** {@inheritDoc} */
@Override
public void close() throws IOException {
 if (mIsOpen.compareAndSet(true, false)) {
  for (FijiPager pager : mFijiQualifierPagers.values()) {
   ResourceUtils.closeOrLog(pager);
  }
  for (FijiPager pager : mFijiCellPagers.values()) {
   ResourceUtils.closeOrLog(pager);
  }
 }
}
origin: com.moz.fiji.hive/fiji-hive-lib

 /** {@inheritDoc} */
 @Override
 public void close() throws IOException {
  ResourceUtils.releaseOrLog(mFijiTable);
  ResourceUtils.releaseOrLog(mFiji);
 }
}
origin: com.moz.fiji.hive/fiji-hive-lib

@Override
public void close(boolean abort) throws IOException {
 ResourceUtils.closeOrLog(mFijiTableWriter);
 ResourceUtils.releaseOrLog(mFijiTable);
 ResourceUtils.releaseOrLog(mFiji);
}
origin: com.moz.fiji.schema/fiji-schema

@Override
/** {@inheritDoc} */
public void close() throws IOException {
 Preconditions.checkState(
   mState.compareAndSet(State.STARTED, State.CLOSED),
   "TableLayoutMonitor is not started.");
 ResourceUtils.closeOrLog(mUserRegistration);
 ResourceUtils.closeOrLog(mTableLayoutTracker);
 mLayout.set(null);
 mConsumers.clear();
}
origin: com.moz.fiji.schema/fiji-schema

/** {@inheritDoc} */
@Override
protected void cleanup() {
 ResourceUtils.releaseOrLog(mTable);
 ResourceUtils.releaseOrLog(mFiji);
}
origin: com.moz.fiji.mapreduce/fiji-mapreduce-cassandra

 /** {@inheritDoc} */
 @Override
 public void close() throws IOException {
  ResourceUtils.closeOrLog(mScanner);
  ResourceUtils.closeOrLog(mReader);
  ResourceUtils.releaseOrLog(mTable);
  ResourceUtils.releaseOrLog(mFiji);
  mIterator = null;
  mScanner = null;
  mReader = null;
  mTable = null;
  mFiji = null;
  mSplit = null;
  mCurrentRow = null;
 }
}
origin: com.moz.fiji.rest/fiji-rest-lib

/** {@inheritDoc} */
@Override
public synchronized void stop() throws Exception {
 Preconditions.checkState(mState.compareAndSet(State.STARTED, State.STOPPED),
   "Can not stop in state %s.", mState.get());
 LOG.info("Stopping ManagedFijiClient.");
 ResourceUtils.closeOrLog(mZKInstances);
 ResourceUtils.closeOrLog(mZKFramework);
 mInstanceCaches.invalidateAll();
 mInstanceCaches.cleanUp();
}
origin: com.moz.fiji.schema/fiji-schema

/**
 * Releases the underlying connection to the Fiji table.
 */
public void releaseUnderlyingFijiTable() {
 ResourceUtils.releaseOrLog(mTable);
}
origin: com.moz.fiji.schema/fiji-schema

 /** {@inheritDoc} */
 @Override
 public void close() throws IOException {
  ResourceUtils.closeOrLog(mScanner);
  ResourceUtils.closeOrLog(mReader);
  ResourceUtils.releaseOrLog(mTable);
  ResourceUtils.releaseOrLog(mFiji);
  mIterator = null;
  mScanner = null;
  mReader = null;
  mTable = null;
  mFiji = null;
  mSplit = null;
  mCurrentRow = null;
 }
}
origin: com.moz.fiji.schema/fiji-schema

/** {@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);
}
origin: com.moz.fiji.schema/fiji-schema

 /** {@inheritDoc} */
 @Override
 public synchronized void close() throws IOException {
  while (!mConnections.isEmpty()) {
   ResourceUtils.releaseOrLog(mConnections.remove().mTable);
  }
 }
}
origin: com.moz.fiji.mapreduce/fiji-mapreduce

 /** {@inheritDoc} */
 @Override
 public void close() throws IOException {
  ResourceUtils.closeOrLog(mScanner);
  ResourceUtils.closeOrLog(mReader);
  ResourceUtils.releaseOrLog(mTable);
  ResourceUtils.releaseOrLog(mFiji);
  mIterator = null;
  mScanner = null;
  mReader = null;
  mTable = null;
  mFiji = null;
  mSplit = null;
  mCurrentRow = null;
 }
}
origin: com.moz.fiji.schema/fiji-schema-cassandra

/**
 * Releases all the resources used by this Fiji instance.
 *
 * @throws java.io.IOException on I/O error.
 */
private void close() throws IOException {
 final State oldState = mState.getAndSet(State.CLOSED);
 Preconditions.checkState(oldState == State.OPEN || oldState == State.UNINITIALIZED,
   "Cannot close Fiji instance %s in state %s.", this, oldState);
 LOG.debug("Closing {}.", this);
 ResourceUtils.closeOrLog(mInstanceMonitor);
 ResourceUtils.closeOrLog(mMetaTable);
 ResourceUtils.closeOrLog(mSystemTable);
 ResourceUtils.closeOrLog(mSchemaTable);
 ResourceUtils.closeOrLog(mAdmin);
 synchronized (this) {
  ResourceUtils.closeOrLog(mSecurityManager);
 }
 ResourceUtils.closeOrLog(mZKClient);
 if (oldState != State.UNINITIALIZED) {
  ResourceTracker.get().unregisterResource(this);
 }
 LOG.debug("{} closed.", this);
}
origin: com.moz.fiji.mapreduce/fiji-mapreduce

/** {@inheritDoc} */
@Override
protected void cleanup() throws IOException {
 ResourceUtils.releaseOrLog(mTable);
 ResourceUtils.releaseOrLog(mFiji);
 super.cleanup();
}
origin: com.moz.fiji.examples.phonebook/fiji-phonebook

 /** {@inheritDoc} */
 @Override
 protected void cleanup(Context hadoopContext) throws IOException, InterruptedException {
  ResourceUtils.closeOrLog(mTableWriter);
  ResourceUtils.releaseOrLog(mTable);
  ResourceUtils.releaseOrLog(mFiji);
  super.cleanup(hadoopContext);
 }
}
origin: com.moz.fiji.schema/fiji-schema

/**
 * Loads fiji schema properties.
 *
 * @return the Fiji schema properties.
 * @throws IOException on I/O error.
 */
private static Properties loadFijiSchemaProperties() throws IOException {
 final InputStream istream =
   VersionInfo.class.getClassLoader().getResourceAsStream(FIJI_SCHEMA_PROPERTIES_RESOURCE);
 try {
  final Properties properties = new Properties();
  properties.load(istream);
  return properties;
 } finally {
  ResourceUtils.closeOrLog(istream);
 }
}
origin: com.moz.fiji.mapreduce/fiji-mapreduce

/** {@inheritDoc} */
@Override
protected void cleanup() throws IOException {
 ResourceUtils.releaseOrLog(mTable);
 ResourceUtils.releaseOrLog(mFiji);
 super.cleanup();
}
com.moz.fiji.schema.utilResourceUtils

Javadoc

Utilities to work with ReferenceCountable resources.

Most used methods

  • closeOrLog
    Closes the specified resource, logging and swallowing I/O errors if needed.
  • releaseOrLog
    Releases the specified resource, logging and swallowing I/O errors if needed.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Join (org.hibernate.mapping)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now