Tabnine Logo
StringUtils.formatTimeDiff
Code IndexAdd Tabnine to your IDE (free)

How to use
formatTimeDiff
method
in
org.apache.hadoop.util.StringUtils

Best Java code snippets using org.apache.hadoop.util.StringUtils.formatTimeDiff (Showing top 20 results out of 315)

origin: org.apache.hadoop/hadoop-common

/**
 * Formats time in ms and appends difference (finishTime - startTime)
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0
 * then difference is not appended to return value.
 * @param formattedFinishTime formattedFinishTime to use
 * @param finishTime finish time
 * @param startTime start time
 * @return formatted value.
 */
public static String getFormattedTimeWithDiff(String formattedFinishTime,
  long finishTime, long startTime){
 StringBuilder buf = new StringBuilder();
 if (0 != finishTime) {
  buf.append(formattedFinishTime);
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: apache/hbase

 .append(StringUtils.TraditionalBinaryPrefix.long2String(storeSize.get(), "", 1))
 .append(". This selection was in queue for ")
 .append(StringUtils.formatTimeDiff(compactionStartTime, cr.getSelectionTime()))
 .append(", and took ").append(StringUtils.formatTimeDiff(now, compactionStartTime))
 .append(" to execute.");
LOG.info(message.toString());
origin: apache/hbase

LOG.info("size=" + totalBytesWritten +
  " (" + StringUtils.humanReadableInt(totalBytesWritten) + ")" +
  " time=" + StringUtils.formatTimeDiff(etime, stime) +
  String.format(" %.3fM/sec", (totalBytesWritten / ((etime - stime)/1000.0))/1048576.0));
context.getCounter(Counter.FILES_COPIED).increment(1);
origin: apache/hbase

org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.formatTimeDiff(now, task.getStateTime())), jamonWriter);
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.formatTimeDiff(now, task.getStatusTime())), jamonWriter);
origin: apache/hbase

long now = EnvironmentEdgeManager.currentTime();
LOG.info(((completed) ? "Completed" : "Aborted") + " compaction " +
   this + "; duration=" + StringUtils.formatTimeDiff(now, start));
if (completed) {
origin: io.hops/hadoop-common

/**
 * Formats time in ms and appends difference (finishTime - startTime)
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0
 * then difference is not appended to return value.
 * @param formattedFinishTime formattedFinishTime to use
 * @param finishTime finish time
 * @param startTime start time
 * @return formatted value.
 */
public static String getFormattedTimeWithDiff(String formattedFinishTime,
  long finishTime, long startTime){
 StringBuilder buf = new StringBuilder();
 if (0 != finishTime) {
  buf.append(formattedFinishTime);
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: ch.cern.hadoop/hadoop-common

/**
 * Formats time in ms and appends difference (finishTime - startTime) 
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0 
 * then difference is not appended to return value. 
 * @param dateFormat date format to use
 * @param finishTime fnish time
 * @param startTime start time
 * @return formatted value. 
 */
public static String getFormattedTimeWithDiff(DateFormat dateFormat, 
                       long finishTime, long startTime){
 StringBuilder buf = new StringBuilder();
 if (0 != finishTime) {
  buf.append(dateFormat.format(new Date(finishTime)));
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: org.jvnet.hudson.hadoop/hadoop-core

/**
 * Formats time in ms and appends difference (finishTime - startTime) 
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0 
 * then difference is not appended to return value. 
 * @param dateFormat date format to use
 * @param finishTime fnish time
 * @param startTime start time
 * @return formatted value. 
 */
public static String getFormattedTimeWithDiff(DateFormat dateFormat, 
                       long finishTime, long startTime){
 StringBuffer buf = new StringBuffer();
 if (0 != finishTime) {
  buf.append(dateFormat.format(new Date(finishTime)));
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: com.github.jiayuhan-it/hadoop-common

/**
 * Formats time in ms and appends difference (finishTime - startTime) 
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0 
 * then difference is not appended to return value. 
 * @param dateFormat date format to use
 * @param finishTime fnish time
 * @param startTime start time
 * @return formatted value. 
 */
public static String getFormattedTimeWithDiff(DateFormat dateFormat, 
                       long finishTime, long startTime){
 StringBuilder buf = new StringBuilder();
 if (0 != finishTime) {
  buf.append(dateFormat.format(new Date(finishTime)));
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: com.facebook.hadoop/hadoop-core

/**
 * Formats time in ms and appends difference (finishTime - startTime) 
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0 
 * then difference is not appended to return value. 
 * @param dateFormat date format to use
 * @param finishTime fnish time
 * @param startTime start time
 * @return formatted value. 
 */
public static String getFormattedTimeWithDiff(DateFormat dateFormat, 
                       long finishTime, long startTime){
 StringBuffer buf = new StringBuffer();
 if (0 != finishTime) {
  buf.append(dateFormat.format(new Date(finishTime)));
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: io.prestosql.hadoop/hadoop-apache

/**
 * Formats time in ms and appends difference (finishTime - startTime) 
 * as returned by formatTimeDiff().
 * If finish time is 0, empty string is returned, if start time is 0 
 * then difference is not appended to return value. 
 * @param dateFormat date format to use
 * @param finishTime fnish time
 * @param startTime start time
 * @return formatted value. 
 */
public static String getFormattedTimeWithDiff(DateFormat dateFormat, 
                       long finishTime, long startTime){
 StringBuilder buf = new StringBuilder();
 if (0 != finishTime) {
  buf.append(dateFormat.format(new Date(finishTime)));
  if (0 != startTime){
   buf.append(" (" + formatTimeDiff(finishTime , startTime) + ")");
  }
 }
 return buf.toString();
}

origin: harbby/presto-connectors

private void throwProcedureYieldException(final String msg) throws ProcedureYieldException {
 String logMsg = msg + "; cycle=" + this.cycles + ", running for " +
   StringUtils.formatTimeDiff(System.currentTimeMillis(), getStartTime());
 // The procedure executor logs ProcedureYieldException at trace level. For now, log these
 // yields for server crash processing at DEBUG. Revisit when stable.
 if (LOG.isDebugEnabled()) LOG.debug(logMsg);
 throw new ProcedureYieldException(logMsg);
}
origin: com.github.jiayuhan-it/hadoop-mapreduce-client-core

details.append(min.getAttemptId().getTaskID().toString()).append(": ");
if ("map".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getStartTime()));
} else if ("shuffle".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getShuffleFinishTime(),
   min.getStartTime()));
} else {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getShuffleFinishTime()));
details.append(StringUtils.formatTimeDiff(avg, 0));
details.append("\nWorse performing ");
details.append(taskType).append(" tasks: ");
 details.append(tasks[i].getAttemptId().getTaskID()).append(" ");
 if ("map".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getFinishTime(),
    tasks[i].getStartTime()));
 } else if ("shuffle".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getShuffleFinishTime(),
    tasks[i].getStartTime()));
 } else {
  details.append(StringUtils.formatTimeDiff(
origin: io.prestosql.hadoop/hadoop-apache

details.append(min.getAttemptId().getTaskID().toString()).append(": ");
if ("map".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getStartTime()));
} else if ("shuffle".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getShuffleFinishTime(),
   min.getStartTime()));
} else {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getShuffleFinishTime()));
details.append(StringUtils.formatTimeDiff(avg, 0));
details.append("\nWorse performing ");
details.append(taskType).append(" tasks: ");
 details.append(tasks[i].getAttemptId().getTaskID()).append(" ");
 if ("map".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getFinishTime(),
    tasks[i].getStartTime()));
 } else if ("shuffle".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getShuffleFinishTime(),
    tasks[i].getStartTime()));
 } else {
  details.append(StringUtils.formatTimeDiff(
origin: ch.cern.hadoop/hadoop-mapreduce-client-core

details.append(min.getAttemptId().getTaskID().toString()).append(": ");
if ("map".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getStartTime()));
} else if ("shuffle".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getShuffleFinishTime(),
   min.getStartTime()));
} else {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getShuffleFinishTime()));
details.append(StringUtils.formatTimeDiff(avg, 0));
details.append("\nWorse performing ");
details.append(taskType).append(" tasks: ");
 details.append(tasks[i].getAttemptId().getTaskID()).append(" ");
 if ("map".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getFinishTime(),
    tasks[i].getStartTime()));
 } else if ("shuffle".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getShuffleFinishTime(),
    tasks[i].getStartTime()));
 } else {
  details.append(StringUtils.formatTimeDiff(
origin: org.apache.hadoop/hadoop-mapred

details.append(min.getAttemptId().getTaskID().toString()).append(": ");
if ("map".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getStartTime()));
} else if ("shuffle".equals(taskType)) {
 details.append(StringUtils.formatTimeDiff(
   min.getShuffleFinishTime(),
   min.getStartTime()));
} else {
 details.append(StringUtils.formatTimeDiff(
   min.getFinishTime(),
   min.getShuffleFinishTime()));
details.append(StringUtils.formatTimeDiff(avg, 0));
details.append("\nWorse performing ");
details.append(taskType).append(" tasks: ");
 details.append(tasks[i].getAttemptId().getTaskID()).append(" ");
 if ("map".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getFinishTime(),
    tasks[i].getStartTime()));
 } else if ("shuffle".equals(taskType)) {
  details.append(StringUtils.formatTimeDiff(
    tasks[i].getShuffleFinishTime(),
    tasks[i].getStartTime()));
 } else {
  details.append(StringUtils.formatTimeDiff(
origin: harbby/presto-connectors

 .append(StringUtils.TraditionalBinaryPrefix.long2String(storeSize, "", 1))
 .append(". This selection was in queue for ")
 .append(StringUtils.formatTimeDiff(compactionStartTime, cr.getSelectionTime()))
 .append(", and took ").append(StringUtils.formatTimeDiff(now, compactionStartTime))
 .append(" to execute.");
LOG.info(message.toString());
origin: com.aliyun.hbase/alihbase-mapreduce

LOG.info("size=" + totalBytesWritten +
  " (" + StringUtils.humanReadableInt(totalBytesWritten) + ")" +
  " time=" + StringUtils.formatTimeDiff(etime, stime) +
  String.format(" %.3fM/sec", (totalBytesWritten / ((etime - stime)/1000.0))/1048576.0));
context.getCounter(Counter.FILES_COPIED).increment(1);
origin: harbby/presto-connectors

LOG.info("size=" + totalBytesWritten +
  " (" + StringUtils.humanReadableInt(totalBytesWritten) + ")" +
  " time=" + StringUtils.formatTimeDiff(etime, stime) +
  String.format(" %.3fM/sec", (totalBytesWritten / ((etime - stime)/1000.0))/1048576.0));
context.getCounter(Counter.FILES_COPIED).increment(1);
origin: co.cask.hbase/hbase

long now = EnvironmentEdgeManager.currentTimeMillis();
LOG.info(((completed) ? "completed" : "aborted") + " compaction: " +
   this + "; duration=" + StringUtils.formatTimeDiff(now, start));
if (completed) {
 server.getMetrics().addCompaction(now - start, this.totalSize);
org.apache.hadoop.utilStringUtilsformatTimeDiff

Javadoc

Given a finish and start time in long milliseconds, returns a String in the format Xhrs, Ymins, Z sec, for the time difference between two times. If finish time comes before start time then negative valeus of X, Y and Z wil return.

Popular methods of StringUtils

  • stringifyException
    Make a string representation of the exception.
  • join
    Concatenates strings, using a separator.
  • split
  • arrayToString
  • toLowerCase
    Converts all of the characters in this String to lower case with Locale.ENGLISH.
  • escapeString
  • startupShutdownMessage
    Print a log message for starting up and shutting down
  • getStrings
    Returns an arraylist of strings.
  • toUpperCase
    Converts all of the characters in this String to upper case with Locale.ENGLISH.
  • byteToHexString
    Given an array of bytes it will convert the bytes to a hex string representation of the bytes
  • formatTime
    Given the time in long milliseconds, returns a String in the format Xhrs, Ymins, Z sec.
  • unEscapeString
  • formatTime,
  • unEscapeString,
  • getStringCollection,
  • byteDesc,
  • formatPercent,
  • getTrimmedStrings,
  • equalsIgnoreCase,
  • format,
  • getTrimmedStringCollection

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Permission (java.security)
    Legacy security code; do not use.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now