Java 类org.apache.hadoop.hdfs.server.namenode.top.metrics.TopMetrics 实例源码

项目:hadoop    文件:FSNamesystem.java   
private List<AuditLogger> initAuditLoggers(Configuration conf) {
  // Initialize the custom access loggers if configured.
  Collection<String> alClasses = conf.getStringCollection(DFS_NAMENODE_AUDIT_LOGGERS_KEY);
  List<AuditLogger> auditLoggers = Lists.newArrayList();
  if (alClasses != null && !alClasses.isEmpty()) {
    for (String className : alClasses) {
      try {
        AuditLogger logger;
        if (DFS_NAMENODE_DEFAULT_AUDIT_LOGGER_NAME.equals(className)) {
          logger = new DefaultAuditLogger();
        } else {
          logger = (AuditLogger) Class.forName(className).newInstance();
        }
        logger.initialize(conf);
        auditLoggers.add(logger);
      } catch (RuntimeException re) {
        throw re;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }

  // Make sure there is at least one logger installed.
  if (auditLoggers.isEmpty()) {
    auditLoggers.add(new DefaultAuditLogger());
  }

  // Add audit logger to calculate top users
  if (topConf.isEnabled) {
    topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs);
    auditLoggers.add(new TopAuditLogger(topMetrics));
  }

  return Collections.unmodifiableList(auditLoggers);
}
项目:aliyun-oss-hadoop-fs    文件:FSNamesystem.java   
private List<AuditLogger> initAuditLoggers(Configuration conf) {
  // Initialize the custom access loggers if configured.
  Collection<String> alClasses = conf.getStringCollection(DFS_NAMENODE_AUDIT_LOGGERS_KEY);
  List<AuditLogger> auditLoggers = Lists.newArrayList();
  if (alClasses != null && !alClasses.isEmpty()) {
    for (String className : alClasses) {
      try {
        AuditLogger logger;
        if (DFS_NAMENODE_DEFAULT_AUDIT_LOGGER_NAME.equals(className)) {
          logger = new DefaultAuditLogger();
        } else {
          logger = (AuditLogger) Class.forName(className).newInstance();
        }
        logger.initialize(conf);
        auditLoggers.add(logger);
      } catch (RuntimeException re) {
        throw re;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }

  // Make sure there is at least one logger installed.
  if (auditLoggers.isEmpty()) {
    auditLoggers.add(new DefaultAuditLogger());
  }

  // Add audit logger to calculate top users
  if (topConf.isEnabled) {
    topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs);
    auditLoggers.add(new TopAuditLogger(topMetrics));
  }

  return Collections.unmodifiableList(auditLoggers);
}
项目:big-c    文件:FSNamesystem.java   
private List<AuditLogger> initAuditLoggers(Configuration conf) {
  // Initialize the custom access loggers if configured.
  Collection<String> alClasses = conf.getStringCollection(DFS_NAMENODE_AUDIT_LOGGERS_KEY);
  List<AuditLogger> auditLoggers = Lists.newArrayList();
  if (alClasses != null && !alClasses.isEmpty()) {
    for (String className : alClasses) {
      try {
        AuditLogger logger;
        if (DFS_NAMENODE_DEFAULT_AUDIT_LOGGER_NAME.equals(className)) {
          logger = new DefaultAuditLogger();
        } else {
          logger = (AuditLogger) Class.forName(className).newInstance();
        }
        logger.initialize(conf);
        auditLoggers.add(logger);
      } catch (RuntimeException re) {
        throw re;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }

  // Make sure there is at least one logger installed.
  if (auditLoggers.isEmpty()) {
    auditLoggers.add(new DefaultAuditLogger());
  }

  // Add audit logger to calculate top users
  if (topConf.isEnabled) {
    topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs);
    auditLoggers.add(new TopAuditLogger(topMetrics));
  }

  return Collections.unmodifiableList(auditLoggers);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSNamesystem.java   
private List<AuditLogger> initAuditLoggers(Configuration conf) {
  // Initialize the custom access loggers if configured.
  Collection<String> alClasses = conf.getStringCollection(DFS_NAMENODE_AUDIT_LOGGERS_KEY);
  List<AuditLogger> auditLoggers = Lists.newArrayList();
  if (alClasses != null && !alClasses.isEmpty()) {
    for (String className : alClasses) {
      try {
        AuditLogger logger;
        if (DFS_NAMENODE_DEFAULT_AUDIT_LOGGER_NAME.equals(className)) {
          logger = new DefaultAuditLogger();
        } else {
          logger = (AuditLogger) Class.forName(className).newInstance();
        }
        logger.initialize(conf);
        auditLoggers.add(logger);
      } catch (RuntimeException re) {
        throw re;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }

  // Make sure there is at least one logger installed.
  if (auditLoggers.isEmpty()) {
    auditLoggers.add(new DefaultAuditLogger());
  }

  // Add audit logger to calculate top users
  if (topConf.isEnabled) {
    topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs);
    auditLoggers.add(new TopAuditLogger(topMetrics));
  }

  return Collections.unmodifiableList(auditLoggers);
}
项目:hadoop    文件:TopAuditLogger.java   
public TopAuditLogger(TopMetrics topMetrics) {
  Preconditions.checkNotNull(topMetrics, "Cannot init with a null " +
      "TopMetrics");
  this.topMetrics = topMetrics;
}
项目:aliyun-oss-hadoop-fs    文件:TopAuditLogger.java   
public TopAuditLogger(TopMetrics topMetrics) {
  Preconditions.checkNotNull(topMetrics, "Cannot init with a null " +
      "TopMetrics");
  this.topMetrics = topMetrics;
}
项目:big-c    文件:TopAuditLogger.java   
public TopAuditLogger(TopMetrics topMetrics) {
  Preconditions.checkNotNull(topMetrics, "Cannot init with a null " +
      "TopMetrics");
  this.topMetrics = topMetrics;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TopAuditLogger.java   
public TopAuditLogger(TopMetrics topMetrics) {
  Preconditions.checkNotNull(topMetrics, "Cannot init with a null " +
      "TopMetrics");
  this.topMetrics = topMetrics;
}