private void closeSrcFs() throws IOException { if (srcFs != null) { srcFs.close(); srcFs = null; } }
@Override public void close() throws IOException { super.close(); closer.close(); }
@Override public void run() { LOG.info("Cancelling deployment from Deployment Failure Hook"); failSessionDuringDeployment(yarnClient, yarnApplication); LOG.info("Deleting files in {}.", yarnFilesDir); try { FileSystem fs = FileSystem.get(yarnConfiguration); if (!fs.delete(yarnFilesDir, true)) { throw new IOException("Deleting files in " + yarnFilesDir + " was unsuccessful"); } fs.close(); } catch (IOException e) { LOG.error("Failed to delete Flink Jar and configuration files in HDFS", e); } } }
@Override public void close() throws IOException { // super.close should be called first before releasing the resources in this instance, as the // super class may invoke other methods in this class. For example, // org.apache.hadoop.fs.FileSystem.close may check the existence of certain temp files before // closing super.close(); if (mFsContext != null) { mFsContext.close(); } }
@Override public void tearDown() { try { fs.close(); } catch (Exception e) { // Nothing } }
@Override public Object call() throws Exception { fs.close(); return null; } }, IOException.class, msg);
/** * Close this filesystem object */ @Override public void close() throws IOException { super.close(); if (this.noChecksumFs != fs) { this.noChecksumFs.close(); } }
@Override public Object call() throws Exception { fs.close(); return null; } }, IOException.class, msg);
void closeCdnFS() { try { if (cdnTargetFS != null) { cdnTargetFS.close(); } } catch (Exception e) { warn("Failed to close CDN filesystem!"); } } }
@Override public void close() throws IOException { this.getFileSystem().close(); } }
@Override public void interrupt() { for (Path path : pathNeedProcess) { try { path.getFileSystem(ctx.getConf()).close(); } catch (IOException ignore) { LOG.debug("Failed to close filesystem", ignore); } } if (executor != null) { executor.shutdownNow(); } } });
public void preload(Configuration configuration) { try { FileSystem.get(configuration).close(); UserGroupInformation.setConfiguration(configuration); } catch (IOException ioe) { // Suppress exception as future uses of this configuration will fail } }
@AfterClass public void tearDown() throws IOException { fs.delete(new Path(TEST_DIR), true); fs.close(); } }
@After public void teardownClass() throws IOException { fs.delete(locksDir, true); fs.close(); }
@After public void teardown() throws IOException { fs.delete(filesDir, true); fs.delete(locksDir, true); fs.close(); }
@After public void teardown() throws IOException { fs.delete(dir, true); fs.close(); }
@Override public void run() { try { LOG.info("Hook closing fs=" + this.fs); this.fs.close(); } catch (NullPointerException npe) { LOG.debug("Need to fix these: " + npe.toString()); } catch (IOException e) { LOG.warn("Running hook", e); } } }
/** * @throws Exception if closing the filesystem or shutting down the mini cluster fails */ @AfterClass public static void tearDownAfterClass() throws Exception { if (fs != null) { fs.close(); } TEST_UTIL.shutdownMiniCluster(); }
/** @throws Exception If failed. */ @Test public void testCloseIfNotInitialized() throws Exception { final FileSystem fs = new IgniteHadoopFileSystem(); // Check close makes nothing harmful. fs.close(); }