hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/states/ContainerStateMap.java
public void addContainer(ContainerInfo info)
      throws SCMException {
    Preconditions.checkNotNull(info, "Container Info cannot be null");
    Preconditions.checkNotNull(info.getPipeline(), "Pipeline cannot be null");

    try (AutoCloseableLock lock = autoLock.acquire()) {
      ContainerID id = ContainerID.valueof(info.getContainerID());
      if (containerMap.putIfAbsent(id, info) != null) {
        LOG.debug("Duplicate container ID detected. {}", id);
        throw new
            SCMException("Duplicate container ID detected.",
            CONTAINER_EXISTS);
      }

      lifeCycleStateMap.insert(info.getState(), id);
      ownerMap.insert(info.getOwner(), id);
      factorMap.insert(info.getPipeline().getFactor(), id);
      typeMap.insert(info.getPipeline().getType(), id);
      LOG.trace("Created container with {} successfully.", id);
    }
  }
/**
   * Adds a ContainerInfo Entry in the ContainerStateMap.
   *
   * @param info - container info
   * @throws SCMException - throws if create failed.
   */
Adds a ContainerInfo Entry in the ContainerStateMap.
@param info - container info
@throws SCMException - throws if create failed.
Adds a ContainerInfo Entry in the ContainerStateMap . @param info - container info @throws SCMException - throws if create failed .
public void addContainer(ContainerInfo info)
      throws SCMException {
    Preconditions.checkNotNull(info, "Container Info cannot be null");
    Preconditions.checkNotNull(info.getPipeline(), "Pipeline cannot be null");
    try (AutoCloseableLock lock = autoLock.acquire()) {
      ContainerID id = ContainerID.valueof(info.getContainerID());
      if (containerMap.putIfAbsent(id, info) != null) {
        LOG.debug("Duplicate container ID detected. {}", id);
        throw new
            SCMException("Duplicate container ID detected.",
            CONTAINER_EXISTS);
      }
      lifeCycleStateMap.insert(info.getState(), id);
      ownerMap.insert(info.getOwner(), id);
      factorMap.insert(info.getPipeline().getFactor(), id);
      typeMap.insert(info.getPipeline().getType(), id);
      LOG.trace("Created container with {} successfully.", id);
    }
  }
public void addContainer ( ContainerInfo info ) throws SCMException { Preconditions . checkNotNull ( info , "Container Info cannot be null" ) ; Preconditions . checkNotNull ( info . getPipeline ( ) , "Pipeline cannot be null" ) ; try ( AutoCloseableLock lock = autoLock . acquire ( ) ) { ContainerID id = ContainerID . valueof ( info . getContainerID ( ) ) ; if ( containerMap . putIfAbsent ( id , info ) != null ) { LOG . debug ( "Duplicate container ID detected. {}" , id ) ; throw new SCMException ( "Duplicate container ID detected." , CONTAINER_EXISTS ) ; } lifeCycleStateMap . insert ( info . getState ( ) , id ) ; ownerMap . insert ( info . getOwner ( ) , id ) ; factorMap . insert ( info . getPipeline ( ) . getFactor ( ) , id ) ; typeMap . insert ( info . getPipeline ( ) . getType ( ) , id ) ; LOG . trace ( "Created container with {} successfully." , id ) ; } }
Adds a ContainerInfo Entry in the ContainerStateMap.
Adds a ContainerInfo Entry in the ContainerStateMap .