hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/StorageContainerManager.java
private void initContainerReportCache(OzoneConfiguration conf) {
    containerReportCache = CacheBuilder.newBuilder()
        .expireAfterAccess(Long.MAX_VALUE, TimeUnit.MILLISECONDS)
        .maximumSize(Integer.MAX_VALUE)
        .removalListener(new RemovalListener<String, ContainerStat>() {
          @Override
          public void onRemoval(
              RemovalNotification<String, ContainerStat> removalNotification) {
            synchronized (containerReportCache) {
              ContainerStat stat = removalNotification.getValue();
              // remove invalid container report
              metrics.decrContainerStat(stat);
              LOG.debug(
                  "Remove expired container stat entry for datanode: {}.",
                  removalNotification.getKey());
            }
          }
        }).build();
  }
/**
   * Initialize container reports cache that sent from datanodes.
   *
   * @param conf
   */
Initialize container reports cache that sent from datanodes.
@param conf
Initialize container reports cache that sent from datanodes . @param conf
private void initContainerReportCache(OzoneConfiguration conf) {
    containerReportCache = CacheBuilder.newBuilder()
        .expireAfterAccess(Long.MAX_VALUE, TimeUnit.MILLISECONDS)
        .maximumSize(Integer.MAX_VALUE)
        .removalListener(new RemovalListener<String, ContainerStat>() {
          @Override
          public void onRemoval(
              RemovalNotification<String, ContainerStat> removalNotification) {
            synchronized (containerReportCache) {
              ContainerStat stat = removalNotification.getValue();
              metrics.decrContainerStat(stat);
              LOG.debug(
                  "Remove expired container stat entry for datanode: {}.",
                  removalNotification.getKey());
            }
          }
        }).build();
  }
private void initContainerReportCache ( OzoneConfiguration conf ) { containerReportCache = CacheBuilder . newBuilder ( ) . expireAfterAccess ( Long . MAX_VALUE , TimeUnit . MILLISECONDS ) . maximumSize ( Integer . MAX_VALUE ) . removalListener ( new RemovalListener < String , ContainerStat > ( ) { @ Override public void onRemoval ( RemovalNotification < String , ContainerStat > removalNotification ) { synchronized ( containerReportCache ) { ContainerStat stat = removalNotification . getValue ( ) ; metrics . decrContainerStat ( stat ) ; LOG . debug ( "Remove expired container stat entry for datanode: {}." , removalNotification . getKey ( ) ) ; } } } ) . build ( ) ; }
Initialize container reports cache that sent from datanodes.
Initialize container reports cache that sent from datanodes .
// remove invalid container report