hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerHandler.java
@Override
  public void handle(SCMCommand command, OzoneContainer container,
      StateContext context, SCMConnectionManager connectionManager) {
    LOG.debug("Processing Close Container command.");
    invocationCount++;
    long startTime = Time.monotonicNow();
    String containerName = "UNKNOWN";
    try {

      SCMCloseContainerCmdResponseProto
          closeContainerProto =
          SCMCloseContainerCmdResponseProto
              .parseFrom(command.getProtoBufMessage());
      containerName = closeContainerProto.getContainerName();

      container.getContainerManager().closeContainer(containerName);

    } catch (Exception e) {
      LOG.error("Can't close container " + containerName, e);
    } finally {
      long endTime = Time.monotonicNow();
      totalTime += endTime - startTime;
    }
  }
/**
   * Handles a given SCM command.
   *
   * @param command           - SCM Command
   * @param container         - Ozone Container.
   * @param context           - Current Context.
   * @param connectionManager - The SCMs that we are talking to.
   */
Handles a given SCM command.
@param command           - SCM Command
@param container         - Ozone Container.
@param context           - Current Context.
@param connectionManager - The SCMs that we are talking to.
Handles a given SCM command . @param command - SCM Command @param container - Ozone Container . @param context - Current Context . @param connectionManager - The SCMs that we are talking to .
@Override
  public void handle(SCMCommand command, OzoneContainer container,
      StateContext context, SCMConnectionManager connectionManager) {
    LOG.debug("Processing Close Container command.");
    invocationCount++;
    long startTime = Time.monotonicNow();
    String containerName = "UNKNOWN";
    try {
      SCMCloseContainerCmdResponseProto
          closeContainerProto =
          SCMCloseContainerCmdResponseProto
              .parseFrom(command.getProtoBufMessage());
      containerName = closeContainerProto.getContainerName();
      container.getContainerManager().closeContainer(containerName);
    } catch (Exception e) {
      LOG.error("Can't close container " + containerName, e);
    } finally {
      long endTime = Time.monotonicNow();
      totalTime += endTime - startTime;
    }
  }
@ Override public void handle ( SCMCommand command , OzoneContainer container , StateContext context , SCMConnectionManager connectionManager ) { LOG . debug ( "Processing Close Container command." ) ; invocationCount ++ ; long startTime = Time . monotonicNow ( ) ; String containerName = "UNKNOWN" ; try { SCMCloseContainerCmdResponseProto closeContainerProto = SCMCloseContainerCmdResponseProto . parseFrom ( command . getProtoBufMessage ( ) ) ; containerName = closeContainerProto . getContainerName ( ) ; container . getContainerManager ( ) . closeContainer ( containerName ) ; } catch ( Exception e ) { LOG . error ( "Can't close container " + containerName , e ) ; } finally { long endTime = Time . monotonicNow ( ) ; totalTime += endTime - startTime ; } }
Handles a given SCM command.
Handles a given SCM command .