Close the FileSystemManager.
@param fsManager the file system to be closed. It can be null.
174495
static public void close(FileSystemManager fsManager){
		if (fsManager != null){
			if (fsManager instanceof DefaultFileSystemManager){
				((DefaultFileSystemManager) fsManager).close();
			}else{
				throw new IllegalStateException("Only instance of DefaultFileSystemManager can be closed here.");
			}
		}
	}
462862
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            this.metricReporter.cancel(true);
            this.metrics.close();
            this.rolloverProcessor.close();
            this.writeProcessor.close();

            // Close active ledger.
            WriteLedger writeLedger;
            synchronized (this.lock) {
                writeLedger = this.writeLedger;
                this.writeLedger = null;
                this.logMetadata = null;
            }

            // Close the write queue and cancel the pending writes.
            this.writes.close().forEach(w -> w.fail(new CancellationException("BookKeeperLog has been closed."), true));

            if (writeLedger != null) {
                try {
                    Ledgers.close(writeLedger.ledger);
                } catch (DurableDataLogException bkEx) {
                    log.error("{}: Unable to close LedgerHandle for Ledger {}.", this.traceObjectId, writeLedger.ledger.getId(), bkEx);
                }
            }

            log.info("{}: Closed.", this.traceObjectId);
        }
    }
1288752
@SuppressWarnings("unchecked")
	public void close() throws IOException {
		if(itr instanceof CloseableIterator) {
			CloseableIterator<E> toBeClosed = (CloseableIterator<E>) itr;
			toBeClosed.close();
		}
	}
492455
@Override
  public void close()
  {
    if (!closed)
    {
      try
      {
        if (Files.isDirectory(bindDir))
        {
          String[] dir = bindDir.toFile().list();
          if (dir != null)
          {
            for (String fileName : dir)
            {
              Files.delete(bindDir.resolve(fileName));
            }
          }
          Files.delete(bindDir);
        }
      }
      catch (IOException ex)
      {
        logger.debug("Exception encountered while trying to clean local directory. ", ex);
      }
      finally
      {
        closed = true;
      }
    }
  }
794165
public void close() {
    fsRunning = false;
    try {
      if (pendingReplications != null) {
        pendingReplications.stop();
      }
      if (hbthread != null) {
        hbthread.interrupt();
      }      
      if (underreplthread != null) {
        underreplthread.interrupt();
      }
      if (overreplthread != null) {
        overreplthread.interrupt();
      }
      if (raidEncodingTaskThread != null) {
        raidEncodingTaskThread.interrupt();
      }
      if (dnthread != null) {
        dnthread.interrupt();
      }
      if (automaticEditsRollingThread != null) {
        automaticEditsRoller.stop();
        // We cannot interrupt roller thread. For manual failover, we want
        // the edits file operations to finish.
        automaticEditsRollingThread.join();
      }
      if (safeMode != null) {
        safeMode.shutdown();
      }
    } catch (Exception e) {
      LOG.warn("Exception shutting down FSNamesystem", e);
    } finally {
      // using finally to ensure we also wait for lease daemon
      try {
        LOG.info("Stopping LeaseManager");
        stopLeaseMonitor();
        if (InjectionHandler
            .trueCondition(InjectionEvent.FSNAMESYSTEM_CLOSE_DIRECTORY)) {
          if (dir != null) {
            LOG.info("Stopping directory (fsimage, fsedits)");
            dir.close();
          }
        }
      } catch (InterruptedException ie) {
      } catch (IOException ie) {
        LOG.error("Error closing FSDirectory", ie);
        IOUtils.cleanup(LOG, dir);
      }
    }
  }
243592
private void close(ClassLoader classLoader) {
        synchronized (configCache) {
            ConfigWrapper config = configCache.remove(classLoader);
            if (config != null) {
                Set<String> applicationNames = config.getApplications();
                for (String app : applicationNames) {
                    appClassLoaderMap.remove(app);
                }

                config.close();
            }
        }
    }
402110
@Override
  public void closeImpl() throws IOException
  {
    unlock();

    _fileChannel = null;

    RandomAccessFile file = _file;
    _file = null;

    if (file != null)
      file.close();
  }
1370189
public void close()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "Close");

        try {
            dataInputStream.close();
            sectorValidatedInputStream.close();

        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(cclass, "close", exception, "1:98:1.13");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this, cclass
                           , "close"
                           , exception
                                );
            throw new PermanentIOException(this
                                           , exception);
        } // catch (java.io.IOException exception).  

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "close"
                            );
    }
1323576
def _close(self):
        '''
        
        '''
        if hasattr(self, 'aiohttp'):
            if not self.aiohttp.closed:
                self.aiohttp.close()
        if hasattr(self, 'file_descriptors'):
            for fd in self.file_descriptors.values():
                if not fd.closed:
                    fd.close()
670416
public void close() throws IOException {
		try {
			if (this.tempSignFileOS!=null) {
				this.tempSignFileOS.close();
			}
		} finally {
			if (!this.tempSignFile.delete()) {
				LOG.warn("Could not delete temporary files used for signing");
			}
		}
	}
1050469
public void close() throws IOException {
        VFSUtils.safeClose(fileSystem);
        VFSUtils.safeClose(mountHandle);
        for (Closeable closeable : closeables) {
            VFSUtils.safeClose(closeable);
        }
    }
77735
@Override
  public void close() throws IOException {
    try {
      mLock.lock();
      if (mAvailableResources.size() != mResources.size()) {
        LOG.warn("{} resources are not released when closing the resource pool.",
            mResources.size() - mAvailableResources.size());
      }
      for (ResourceInternal<T> resourceInternal : mAvailableResources) {
        closeResource(resourceInternal.mResource);
      }
      mAvailableResources.clear();
    } finally {
      mLock.unlock();
    }
    mGcFuture.cancel(true);
  }
1017970
public function close()
    {
        if (!$this->isWriterOpened) {
            return;
        }

        $this->closeWriter();

        if (is_resource($this->filePointer)) {
            $this->globalFunctionsHelper->fclose($this->filePointer);
        }

        $this->isWriterOpened = false;
    }
674328
@Override
  public void close() throws HiveSQLException {
    try {
      acquire(true);
      cancelDelegationToken();
    } finally {
      try {
        super.close();
      } finally {
        try {
          FileSystem.closeAllForUGI(sessionUgi);
        } catch (IOException ioe) {
          throw new HiveSQLException("Could not clean up file-system handles for UGI: "
              + sessionUgi, ioe);
        }
      }
    }
  }
1227162
def close(self):
        
        if self.conn:
            self.conn.close()
            self.conn = None

        fname = os.path.basename(self._path)
        checksum_persister = _get_checksum_persister(self._path)
        hasher = _initialize_hasher(self._path)
        with contextlib.closing(checksum_persister):
            checksum_persister[fname] = hasher.hexdigest()
787124
protected void close()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "close"
                            );

        if (flushHelper != null)
            flushHelper.shutdown(); // Complete outstanding work.
        if (notifyHelper != null)
            notifyHelper.shutdown(); // No longer need a notify thread.

        logFile = null;

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "close"
                            );
    }
1252863
@Override
    public void close() {
        if (mIsClosed) {
            return;
        }
        mIsClosed = true;

        mRetrofit = null;
        mRetrofitService = null;
        mRequestSignatorInterceptor = null;
        mHttpLoggingInterceptor = null;

        mApplicationContext.clear();
        mApplicationContext = null;

        mClientKey = null;
    }