Java Code Examples for org.apache.hadoop.metrics.MetricsContext#registerUpdater()

The following examples show how to use org.apache.hadoop.metrics.MetricsContext#registerUpdater() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HighTideNodeMetrics.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public HighTideNodeMetrics(Configuration conf, HighTideNode hightideNode) {
  String sessionId = conf.get("session.id");
  // Initiate Java VM metrics
  JvmMetrics.init("HighTideNode", sessionId);


  // Now the Mbean for the name node - this also registers the MBean
  hightidenodeActivityMBean = new HighTideNodeActivityMBean(registry);

  // Create a record for HighTideNode metrics
  MetricsContext metricsContext = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(metricsContext, "hightidenode");
  metricsRecord.setTag("sessionId", sessionId);
  metricsContext.registerUpdater(this);
  LOG.info("Initializing HighTideNodeMetrics using context object:" +
            metricsContext.getClass().getName());
}
 
Example 2
Source File: ShuffleClientMetrics.java    From incubator-tez with Apache License 2.0 6 votes vote down vote up
ShuffleClientMetrics(String dagName, String vertexName, int taskIndex, Configuration conf, 
    String user) {
  this.numCopiers = 
      conf.getInt(
          TezJobConfig.TEZ_RUNTIME_SHUFFLE_PARALLEL_COPIES, 
          TezJobConfig.TEZ_RUNTIME_SHUFFLE_PARALLEL_COPIES_DEFAULT);

  MetricsContext metricsContext = MetricsUtil.getContext(Constants.TEZ);
  this.shuffleMetrics = 
    MetricsUtil.createRecord(metricsContext, "shuffleInput");
  this.shuffleMetrics.setTag("user", user);
  this.shuffleMetrics.setTag("dagName", dagName);
  this.shuffleMetrics.setTag("taskId", TezRuntimeUtils.getTaskIdentifier(vertexName, taskIndex));
  this.shuffleMetrics.setTag("sessionId", 
      conf.get(
          TezRuntimeFrameworkConfigs.TEZ_RUNTIME_METRICS_SESSION_ID,
          TezRuntimeFrameworkConfigs.TEZ_RUNTIME_METRICS_SESSION_ID_DEFAULT));
  metricsContext.registerUpdater(this);
}
 
Example 3
Source File: TaskErrorCollector.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public TaskErrorCollector(Configuration conf) {
  errorCountsQueue = new LinkedList<Map<TaskError, Integer>>();
  startTimeQueue = new LinkedList<Long>();
  errorCountsMetrics = new HashMap<TaskError, MetricsTimeVaryingLong>();
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "taskerror");
  registry = new MetricsRegistry();
  windowLength = conf.getInt(WINDOW_LENGTH_KEY, WINDOW_LENGTH);
  numWindows = conf.getInt(NUM_WINDOWS_KEY, NUM_WINDOWS);

  context.registerUpdater(this);

  String configFilePath = conf.get(CONFIG_FILE_KEY);
  if (configFilePath == null) {
    // Search the class path if it is not configured
    URL u = TaskErrorCollector.class.getClassLoader().getResource(ERROR_XML);
    if (u != null) {
      configFilePath = u.getPath();
    }
  }
  if (configFilePath == null) {
    LOG.warn("No " + CONFIG_FILE_KEY + " given in conf. " +
         TaskErrorCollector.class.getSimpleName() +
         " will see every error as UNKNOWN_ERROR.");
    knownErrors = Collections.emptyMap();
  } else {
    knownErrors = parseConfigFile(configFilePath);
  }
  createMetrics();
  sinceStartErrorCounts = createErrorCountsMap();
}
 
Example 4
Source File: DataNodeMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public DataNodeMetrics(Configuration conf, String storageId) {
  String sessionId = conf.get("session.id"); 
  // Initiate reporting of Java VM metrics
  JvmMetrics.init("DataNode", sessionId);
  

  // Now the MBean for the data node
  datanodeActivityMBean = new DataNodeActivityMBean(registry, storageId);
  
  // Create record for DataNode metrics
  MetricsContext context = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(context, "datanode");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
Example 5
Source File: LookasideMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public LookasideMetrics() {
  // Create a record for LookasideCache metrics
  MetricsContext metricsContext = MetricsUtil.getContext("lookasideCache");
  metricsRecord = MetricsUtil.createRecord(metricsContext,
                                           "LookasideFileSystem");
  metricsContext.registerUpdater(this);

}
 
Example 6
Source File: DFSClientMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public DFSClientMetrics() {
	// Create a record for FSNamesystem metrics
	MetricsContext metricsContext = MetricsUtil.getContext("hdfsclient");
	metricsRecord = MetricsUtil.createRecord(metricsContext, "DFSClient");
	metricsContext.registerUpdater(this);

}
 
Example 7
Source File: TaskTracker.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
ShuffleServerMetrics(JobConf conf) {
  MetricsContext context = MetricsUtil.getContext("mapred");
  shuffleMetricsRecord = 
                       MetricsUtil.createRecord(context, "shuffleOutput");
  this.shuffleMetricsRecord.setTag("sessionId", conf.getSessionId());
  context.registerUpdater(this);
}
 
Example 8
Source File: JobTrackerMetricsInst.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public JobTrackerMetricsInst(JobTracker tracker, JobConf conf) {
  super(tracker, conf);
  String sessionId = conf.getSessionId();
  // Initiate JVM Metrics
  JvmMetrics.init("JobTracker", sessionId);
  // Create a record for map-reduce metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
Example 9
Source File: TaskTracker.java    From RDFS with Apache License 2.0 5 votes vote down vote up
ShuffleServerMetrics(JobConf conf) {
  MetricsContext context = MetricsUtil.getContext("mapred");
  shuffleMetricsRecord =
                       MetricsUtil.createRecord(context, "shuffleOutput");
  this.shuffleMetricsRecord.setTag("sessionId", conf.getSessionId());
  context.registerUpdater(this);
}
 
Example 10
Source File: LocalJobRunnerMetrics.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public LocalJobRunnerMetrics(JobConf conf) {
  String sessionId = conf.getSessionId();
  // Initiate JVM Metrics
  JvmMetrics.init("JobTracker", sessionId);
  // Create a record for map-reduce metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  // record name is jobtracker for compatibility 
  metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
Example 11
Source File: RpcMetrics.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public RpcMetrics(String hostName, String port, Server server) {
  myServer = server;
  MetricsContext context = MetricsUtil.getContext("rpc");
  metricsRecord = MetricsUtil.createRecord(context, "metrics");

  metricsRecord.setTag("port", port);

  LOG.info("Initializing RPC Metrics with hostName=" 
      + hostName + ", port=" + port);

  context.registerUpdater(this);
  
  // Need to clean up the interface to RpcMgt - don't need both metrics and server params
  rpcMBean = new RpcActivityMBean(registry, hostName, port);
}
 
Example 12
Source File: JobTrackerMetricsInst.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public JobTrackerMetricsInst(JobTracker tracker, JobConf conf) {
  super(tracker, conf);
  String sessionId = conf.getSessionId();
  // Initiate JVM Metrics
  JvmMetrics.init("JobTracker", sessionId);
  // Create a record for map-reduce metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
Example 13
Source File: CompositeContext.java    From big-c with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example 14
Source File: TaskTrackerMetricsInst.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public TaskTrackerMetricsInst(TaskTracker t) {
  super(t);
  JobConf conf = tt.getJobConf();
  String sessionId = conf.getSessionId();
  // Initiate Java VM Metrics
  JvmMetrics.init("TaskTracker", sessionId);
  // Create a record for Task Tracker metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "tasktracker"); //guaranteed never null
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
Example 15
Source File: ShuffleClientMetrics.java    From big-c with Apache License 2.0 5 votes vote down vote up
ShuffleClientMetrics(TaskAttemptID reduceId, JobConf jobConf) {
  this.numCopiers = jobConf.getInt(MRJobConfig.SHUFFLE_PARALLEL_COPIES, 5);

  MetricsContext metricsContext = MetricsUtil.getContext("mapred");
  this.shuffleMetrics = 
    MetricsUtil.createRecord(metricsContext, "shuffleInput");
  this.shuffleMetrics.setTag("user", jobConf.getUser());
  this.shuffleMetrics.setTag("jobName", jobConf.getJobName());
  this.shuffleMetrics.setTag("jobId", reduceId.getJobID().toString());
  this.shuffleMetrics.setTag("taskId", reduceId.toString());
  this.shuffleMetrics.setTag("sessionId", jobConf.getSessionId());
  metricsContext.registerUpdater(this);
}
 
Example 16
Source File: LocalJobRunnerMetrics.java    From big-c with Apache License 2.0 5 votes vote down vote up
public LocalJobRunnerMetrics(JobConf conf) {
  String sessionId = conf.getSessionId();
  // Initiate JVM Metrics
  JvmMetrics.init("JobTracker", sessionId);
  // Create a record for map-reduce metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  // record name is jobtracker for compatibility 
  metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
Example 17
Source File: CompositeContext.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example 18
Source File: ShuffleClientMetrics.java    From hadoop with Apache License 2.0 5 votes vote down vote up
ShuffleClientMetrics(TaskAttemptID reduceId, JobConf jobConf) {
  this.numCopiers = jobConf.getInt(MRJobConfig.SHUFFLE_PARALLEL_COPIES, 5);

  MetricsContext metricsContext = MetricsUtil.getContext("mapred");
  this.shuffleMetrics = 
    MetricsUtil.createRecord(metricsContext, "shuffleInput");
  this.shuffleMetrics.setTag("user", jobConf.getUser());
  this.shuffleMetrics.setTag("jobName", jobConf.getJobName());
  this.shuffleMetrics.setTag("jobId", reduceId.getJobID().toString());
  this.shuffleMetrics.setTag("taskId", reduceId.toString());
  this.shuffleMetrics.setTag("sessionId", jobConf.getSessionId());
  metricsContext.registerUpdater(this);
}
 
Example 19
Source File: CompositeContext.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example 20
Source File: CompositeContext.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}