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

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

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

origin: com.moz.fiji.examples.phonebook/fiji-phonebook

 /**
  * Close all underlying resources.
  */
 @Override
 public void close() {
  ResourceUtils.closeOrLog(mConsoleReader);
 }
}
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.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.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.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

/** {@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

/**
 * 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.schema/fiji-schema

/** {@inheritDoc} */
@Override
protected void cleanup() throws IOException {
 ResourceUtils.closeOrLog(mHBaseAdmin);
 super.cleanup();
}
origin: com.moz.fiji.schema/fiji-schema

 /**
  * Print details of environment variables and so-on.
  * @throws IOException on I/O error.
  */
 private static void printVerboseHelp() throws IOException {
  final InputStream envHelp = Preconditions.checkNotNull(
    Resources.openSystemResource("com.moz.fiji/schema/tools/HelpTool.envHelp.txt"));
  try {
   IOUtils.copy(envHelp, System.out);
  } finally {
   ResourceUtils.closeOrLog(envHelp);
  }
 }
}
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.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.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.schema/fiji-schema

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

/** {@inheritDoc} */
@Override
public List<String> listTables() throws IOException {
 final Scan scan = new Scan()
   .addColumn(mFamilyBytes, QUALIFIER_LAYOUT_BYTES)
   .setMaxVersions(1);
 final ResultScanner resultScanner = mTable.getScanner(scan);
 final List<String> tableNames = Lists.newArrayList();
 for (Result result : resultScanner) {
  tableNames.add(Bytes.toString(result.getRow()));
 }
 ResourceUtils.closeOrLog(resultScanner);
 return tableNames;
}
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

/**
 * Loads a table layout from the specified JSON text.
 *
 * @param istream Input stream containing the JSON text.
 * @return the parsed table layout.
 * @throws IOException on I/O error.
 */
public static FijiTableLayout createFromEffectiveJson(InputStream istream) throws IOException {
 try {
  final TableLayoutDesc desc = readTableLayoutDescFromJSON(istream);
  final FijiTableLayout layout = new FijiTableLayout(desc, null);
  return layout;
 } finally {
  ResourceUtils.closeOrLog(istream);
 }
}
origin: com.moz.fiji.examples.phonebook/fiji-phonebook

 /** {@inheritDoc} */
 @Override
 protected void cleanup(Context hadoopContext) throws IOException, InterruptedException {
  // Safely free up resources by closing in reverse order.
  ResourceUtils.closeOrLog(mWriter);
  ResourceUtils.releaseOrLog(mTable);
  ResourceUtils.releaseOrLog(mFiji);
  super.cleanup(hadoopContext);
 }
}
origin: com.moz.fiji.mapreduce/fiji-mapreduce

 @Override
 public void close() throws IOException {
  ResourceUtils.closeOrLog(mReader);
  ResourceUtils.releaseOrLog(mTable);
  ResourceUtils.releaseOrLog(mFiji);
  super.close();
 }
}
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.examples.phonebook/fiji-phonebook

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

Javadoc

Closes the specified resource, logging and swallowing I/O errors if needed.

Popular methods of ResourceUtils

  • 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 plugins for Android Studio
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