hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/BlockManagerImpl.java
private void preAllocateContainers(int count, ReplicationType type,
      ReplicationFactor factor, String owner)
      throws IOException {
    lock.lock();
    try {
      for (int i = 0; i < count; i++) {
        String containerName = UUID.randomUUID().toString();
        ContainerInfo containerInfo = null;
        try {
          // TODO: Fix this later when Ratis is made the Default.
          containerInfo = containerManager.allocateContainer(type, factor,
              containerName, owner);

          if (containerInfo == null) {
            LOG.warn("Unable to allocate container.");
            continue;
          }
        } catch (IOException ex) {
          LOG.warn("Unable to allocate container: {}", ex);
          continue;
        }
      }
    } finally {
      lock.unlock();
    }
  }
/**
   * Pre allocate specified count of containers for block creation.
   *
   * @param count - Number of containers to allocate.
   * @param type - Type of containers
   * @param factor - how many copies needed for this container.
   * @throws IOException
   */
Pre allocate specified count of containers for block creation.
@param count - Number of containers to allocate.
@param type - Type of containers
@param factor - how many copies needed for this container.
Pre allocate specified count of containers for block creation . @param count - Number of containers to allocate . @param type - Type of containers @param factor - how many copies needed for this container .
private void preAllocateContainers(int count, ReplicationType type,
      ReplicationFactor factor, String owner)
      throws IOException {
    lock.lock();
    try {
      for (int i = 0; i < count; i++) {
        String containerName = UUID.randomUUID().toString();
        ContainerInfo containerInfo = null;
        try {
          containerInfo = containerManager.allocateContainer(type, factor,
              containerName, owner);
          if (containerInfo == null) {
            LOG.warn("Unable to allocate container.");
            continue;
          }
        } catch (IOException ex) {
          LOG.warn("Unable to allocate container: {}", ex);
          continue;
        }
      }
    } finally {
      lock.unlock();
    }
  }
private void preAllocateContainers ( int count , ReplicationType type , ReplicationFactor factor , String owner ) throws IOException { lock . lock ( ) ; try { for ( int i = 0 ; i < count ; i ++ ) { String containerName = UUID . randomUUID ( ) . toString ( ) ; ContainerInfo containerInfo = null ; try { containerInfo = containerManager . allocateContainer ( type , factor , containerName , owner ) ; if ( containerInfo == null ) { LOG . warn ( "Unable to allocate container." ) ; continue ; } } catch ( IOException ex ) { LOG . warn ( "Unable to allocate container: {}" , ex ) ; continue ; } } } finally { lock . unlock ( ) ; } }
Pre allocate specified count of containers for block creation.
Pre allocate specified count of containers for block creation .
// TODO: Fix this later when Ratis is made the Default.