protected synchronized void cleanupOperationLog(final long operationLogCleanupDelayMs) {
    if (isOperationLogEnabled) {
      if (opHandle == null) {
        log.warn("Operation seems to be in invalid state, opHandle is null");
        return;
      }
      if (operationLog == null) {
        log.warn("Operation [ " + opHandle.getHandleIdentifier() + " ] " + "logging is enabled, "
            + "but its OperationLog object cannot be found. "
            + "Perhaps the operation has already terminated.");
      } else {
        if (operationLogCleanupDelayMs > 0) {
          ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
          scheduledExecutorService.schedule(new OperationLogCleaner(this, operationLog), operationLogCleanupDelayMs,
            TimeUnit.MILLISECONDS);
          scheduledExecutorService.shutdown();
        } else {
          log.info("Closing operation log {} without delay", operationLog);
          operationLog.close();
          OperationLogManager.closeOperation(this);
        }
      }
    }

  }
Implemented by subclass of Operation class to execute specific behaviors.
@throws HiveSQLException
service/src/java/org/apache/hive/service/cli/operation/Operation.java