Package org.apache.hadoop.log

Examples of org.apache.hadoop.log.LogSample


      long errorOffset, LOGTYPES type, FileSystem fs,
      Throwable ex, Context context, long recoveryTime) {
    try {
      incrLogMetricCounter(context, fs, type, result,
          codec == null? null: codec.id);
      LogSample sample = new LogSample();
      sample.addNormalValue(LOGKEYS.Result.name(), result.name());
      sample.addIntValue(LOGKEYS.ConstructedBytes.name(), bytes);
      if (null != codec) {
        sample.addNormalValue(LOGKEYS.Code.name(), codec.id);
      } else {
        sample.addNormalValue(LOGKEYS.Code.name(), "unknown");
      }
      if (delay >= 0) sample.addIntValue(LOGKEYS.Delay.name(), delay);
      if (decodingTime >= 0) sample.addIntValue(LOGKEYS.DecodingTime.name(),
          decodingTime);
      if (numMissingBlocks >= 0)
        sample.addNormalValue(LOGKEYS.MissingBlocks.name(),
            Integer.toString(numMissingBlocks));
      if (numReadBytes >= 0) sample.addIntValue(LOGKEYS.ReadBytes.name(),
          numReadBytes);
      if (numReadRemoteRackBytes >= 0)
        sample.addIntValue(LOGKEYS.RemoteRackReadBytes.name(),
            numReadRemoteRackBytes);
      if (recoveryTime > 0) {
        sample.addIntValue(LOGKEYS.RecoveryTime.name(), recoveryTime);
      }
      sample.addNormalValue(LOGKEYS.Path.name(), srcFile.toString());
      sample.addIntValue(LOGKEYS.Offset.name(), errorOffset);
      sample.addNormalValue(LOGKEYS.Type.name(), type.name());
      sample.addNormalValue(LOGKEYS.Cluster.name(), fs.getUri().getAuthority());
      if (ex != null) {
        sample.addNormalValue(LOGKEYS.Error.name(),
            StringUtils.stringifyException(ex));
      }
      DECODER_METRICS_LOG.info(sample.toJSON());

    } catch(Exception e) {
      LOG.warn("Exception when logging the Raid metrics: " + e.getMessage(),
               e);
    }
View Full Code Here


      long metaBlocks, long metaBytes,
      long savingBytes, Path srcPath, LOGTYPES type,
      FileSystem fs, Throwable ex, Progressable context) {
    try {
      incrLogMetricCounter(context, fs, type, result, codec.id);
      LogSample sample = new LogSample();
      sample.addNormalValue(LOGKEYS.Result.name(), result.name());
      sample.addNormalValue(LOGKEYS.Code.name(), codec.id);
      if (delay >= 0) sample.addIntValue(LOGKEYS.Delay.name(), delay);
      if (numReadBytes >= 0) sample.addIntValue(LOGKEYS.ReadBytes.name(),
          numReadBytes);
      if (numReadBlocks >= 0) sample.addIntValue(LOGKEYS.ReadBlocks.name(),
          numReadBlocks);
      if (metaBlocks >= 0) sample.addIntValue(LOGKEYS.MetaBlocks.name(),
          metaBlocks);
      if (metaBytes >=0) sample.addIntValue(LOGKEYS.MetaBytes.name(), metaBytes);
      if (savingBytes >=0) sample.addIntValue(LOGKEYS.SavingBytes.name(),
          savingBytes);
      sample.addNormalValue(LOGKEYS.Path.name(), srcPath.toString());
      sample.addNormalValue(LOGKEYS.Type.name(), type.name());
      sample.addNormalValue(LOGKEYS.Cluster.name(), fs.getUri().getAuthority());
      if (ex != null) {
        sample.addNormalValue(LOGKEYS.Error.name(),
            StringUtils.stringifyException(ex));
      }
      ENCODER_METRICS_LOG.info(sample.toJSON());
    } catch(Exception e) {
      LOG.warn("Exception when logging the Raid metrics: " + e.getMessage(),
               e);
    }
  }
View Full Code Here

      long offset, long limit,
      Throwable ex, Progressable context) {
    LOGTYPES type = LOGTYPES.TOOL_FILECHECK;
    try {
      incrLogMetricCounter(context, fs, type, result, codec.id);
      LogSample sample = new LogSample();
      sample.addNormalValue(LOGKEYS.Result.name(), result.name());
      sample.addNormalValue(LOGKEYS.Code.name(), codec.id);
      sample.addNormalValue(LOGKEYS.Path.name(), srcPath.toString());
      sample.addNormalValue(LOGKEYS.Type.name(), type.name());
      sample.addNormalValue(LOGKEYS.Cluster.name(), fs.getUri().getAuthority());
      sample.addIntValue(LOGKEYS.Offset.name(), offset);
      sample.addIntValue(LOGKEYS.Limit.name(), limit);
      if (ex != null) {
        sample.addNormalValue(LOGKEYS.Error.name(),
            StringUtils.stringifyException(ex));
      }
      new Throwable().printStackTrace();
      FILECHECK_METRICS_LOG.info(sample.toJSON());
    } catch(Exception e) {
      LOG.warn("Exception when logging the Raid metrics: " + e.getMessage(),
          e);
    }
  }
View Full Code Here

    }
  }
 
  static public void logWaitTimeMetrics (long waitTime, long maxPendingJobsLimit,
      long filesPerTaskLimit, LOGTYPES type, FileSystem fs, Context context) {
    LogSample sample = new LogSample();
    sample.addIntValue(LOGKEYS.FileFixWaitTime.name(), waitTime);
    sample.addIntValue(LOGKEYS.MaxPendingJobs.name(), maxPendingJobsLimit);
    sample.addIntValue(LOGKEYS.MaxFilesPerTask.name(), filesPerTaskLimit);
    logEvent(fs, null, type, LOGRESULTS.NONE, null, context, sample, null);
  }
View Full Code Here

      if (context == null) {
        incrRaidNodeMetricCounter(fs, type, result, tag);
      } else {
        incrLogMetricCounter(context, fs, type, result, tag);
      }
      if (sample == null) sample = new LogSample();
      if (path != null) sample.addNormalValue(LOGKEYS.Path.name(), path.toString());
      if (codec != null) sample.addNormalValue(LOGKEYS.Code.name(), codec.id);
      sample.addNormalValue(LOGKEYS.Type.name(), type.name());
      sample.addNormalValue(LOGKEYS.Cluster.name(), fs.getUri().getAuthority());
      EVENTS_LOG.info(sample.toJSON());
View Full Code Here

TOP

Related Classes of org.apache.hadoop.log.LogSample

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.