congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StringUtils.formatTime
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.hadoop/hadoop-common

/**
 * 
 * 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. 
 * 
 * @param finishTime finish time
 * @param startTime start time
 */
public static String formatTimeDiff(long finishTime, long startTime){
 long timeDiff = finishTime - startTime; 
 return formatTime(timeDiff); 
}

origin: apache/hbase

public HealthCheckChore(int sleepTime, Stoppable stopper, Configuration conf) {
 super("HealthChecker", stopper, sleepTime);
 LOG.info("Health Check Chore runs every " + StringUtils.formatTime(sleepTime));
 this.config = conf;
 String healthCheckScript = this.config.get(HConstants.HEALTH_SCRIPT_LOC);
 long scriptTimeout = this.config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT,
  HConstants.DEFAULT_HEALTH_SCRIPT_TIMEOUT);
 healthChecker = new HealthChecker();
 healthChecker.init(healthCheckScript, scriptTimeout);
 this.threshold = config.getInt(HConstants.HEALTH_FAILURE_THRESHOLD,
  HConstants.DEFAULT_HEALTH_FAILURE_THRESHOLD);
 this.failureWindow = (long)this.threshold * (long)sleepTime;
}
origin: apache/hbase

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws RpcThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + StringUtils.formatTime(waitInterval);
 throw new RpcThrottlingException(type, waitInterval, msg);
}
origin: apache/kylin

protected int waitForCompletion(Job job) throws IOException, InterruptedException, ClassNotFoundException {
  int retVal = 0;
  long start = System.nanoTime();
  if (isAsync) {
    job.submit();
  } else {
    job.waitForCompletion(true);
    retVal = job.isSuccessful() ? 0 : 1;
    logger.debug("Job '" + job.getJobName() + "' finished "
        + (job.isSuccessful() ? "successfully in " : "with failures.  Time taken ")
        + formatTime((System.nanoTime() - start) / 1000000L));
  }
  return retVal;
}
origin: apache/hbase

@Override
protected void chore() {
 HealthReport report = healthChecker.checkHealth();
 boolean isHealthy = (report.getStatus() == HealthCheckerExitStatus.SUCCESS);
 if (!isHealthy) {
  boolean needToStop = decideToStop();
  if (needToStop) {
   this.getStopper().stop("The  node reported unhealthy " + threshold
     + " number of times consecutively.");
  }
  // Always log health report.
  LOG.info("Health status at " + StringUtils.formatTime(System.currentTimeMillis()) + " : "
    + report.getHealthReport());
 }
}
origin: apache/hbase

    LOG.debug("STATUS UPDATE: " + splitCount + " / " + origCount
      + ". Avg Time / Split = "
      + org.apache.hadoop.util.StringUtils.formatTime(tDiff));
long tDiff = System.currentTimeMillis() - startTime;
LOG.debug("TOTAL TIME = "
  + org.apache.hadoop.util.StringUtils.formatTime(tDiff));
LOG.debug("Splits = " + splitCount);
if (0 < splitCount) {
 LOG.debug("Avg Time / Split = "
   + org.apache.hadoop.util.StringUtils.formatTime(tDiff / splitCount));
origin: org.apache.hadoop/hadoop-hdfs

BlockKeyUpdater(final long sleepInterval) {
 this.sleepInterval = sleepInterval;
 LOG.info("Update block keys every " + StringUtils.formatTime(sleepInterval));
}
origin: KylinOLAP/Kylin

protected int waitForCompletion(Job job) throws IOException, InterruptedException, ClassNotFoundException {
  int retVal = 0;
  long start = System.nanoTime();
  if (isAsync) {
    job.submit();
  } else {
    job.waitForCompletion(true);
    retVal = job.isSuccessful() ? 0 : 1;
    logger.debug("Job '" + job.getJobName() + "' finished " + (job.isSuccessful() ? "successfully in " : "with failures.  Time taken ") + formatTime((System.nanoTime() - start) / 1000000L));
  }
  return retVal;
}
origin: org.apache.hbase/hbase-client

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws RpcThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + StringUtils.formatTime(waitInterval);
 throw new RpcThrottlingException(type, waitInterval, msg);
}
origin: org.apache.hadoop/hadoop-hdfs

 @Override
 public int run(String[] args) throws Exception {
  final long startTime = Time.monotonicNow();
  final Configuration conf = getConf();
  try {
   final Map<URI, List<Path>> map = getNameNodePathsToMove(conf, args);
   return Mover.run(map, conf);
  } catch (IOException e) {
   System.out.println(e + ".  Exiting ...");
   return ExitStatus.IO_EXCEPTION.getExitCode();
  } catch (InterruptedException e) {
   System.out.println(e + ".  Exiting ...");
   return ExitStatus.INTERRUPTED.getExitCode();
  } catch (ParseException e) {
   System.out.println(e + ".  Exiting ...");
   return ExitStatus.ILLEGAL_ARGUMENTS.getExitCode();
  } catch (IllegalArgumentException e) {
   System.out.println(e + ".  Exiting ...");
   return ExitStatus.ILLEGAL_ARGUMENTS.getExitCode();
  } finally {
   System.out.format("%-24s ", DateFormat.getDateTimeInstance().format(new Date()));
   System.out.println("Mover took " + StringUtils.formatTime(Time.monotonicNow()-startTime));
  }
 }
}
origin: org.apache.hadoop/hadoop-hdfs

long tokenLifetime = keys.getTokenLifetime();
LOG.info("Block token params received from NN: update interval="
  + StringUtils.formatTime(updateInterval)
  + ", token lifetime=" + StringUtils.formatTime(tokenLifetime));
String encryptionAlgorithm = conf.get(
  DFSConfigKeys.DFS_DATA_ENCRYPTION_ALGORITHM_KEY);
origin: io.prestosql.hadoop/hadoop-apache

/**
 * 
 * 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. 
 * 
 * @param finishTime finish time
 * @param startTime start time
 */
public static String formatTimeDiff(long finishTime, long startTime){
 long timeDiff = finishTime - startTime; 
 return formatTime(timeDiff); 
}

origin: io.hops/hadoop-common

/**
 *
 * 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. 
 *
 * @param finishTime finish time
 * @param startTime start time
 */
public static String formatTimeDiff(long finishTime, long startTime) {
 long timeDiff = finishTime - startTime;
 return formatTime(timeDiff);
}

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

/**
 * 
 * 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. 
 * 
 * @param finishTime finish time
 * @param startTime start time
 */
public static String formatTimeDiff(long finishTime, long startTime){
 long timeDiff = finishTime - startTime; 
 return formatTime(timeDiff); 
}

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

/**
 * 
 * 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. 
 * 
 * @param finishTime finish time
 * @param startTime start time
 */
public static String formatTimeDiff(long finishTime, long startTime){
 long timeDiff = finishTime - startTime; 
 return formatTime(timeDiff); 
}

origin: co.cask.hbase/hbase

CompactionChecker(final HRegionServer h, final int sleepTime,
  final Stoppable stopper) {
 super("CompactionChecker", sleepTime, h);
 this.instance = h;
 LOG.info("Runs every " + StringUtils.formatTime(sleepTime));
 /* MajorCompactPriority is configurable.
  * If not set, the compaction will use default priority.
  */
 this.majorCompactPriority = this.instance.conf.
  getInt("hbase.regionserver.compactionChecker.majorCompactPriority",
  DEFAULT_PRIORITY);
}
origin: co.cask.hbase/hbase

public HealthCheckChore(int sleepTime, Stoppable stopper, Configuration conf) {
 super("HealthChecker", sleepTime, stopper);
 LOG.info("Health Check Chore runs every " + StringUtils.formatTime(sleepTime));
 this.config = conf;
 String healthCheckScript = this.config.get(HConstants.HEALTH_SCRIPT_LOC);
 long scriptTimeout = this.config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT,
  HConstants.DEFAULT_HEALTH_SCRIPT_TIMEOUT);
 healthChecker = new HealthChecker();
 healthChecker.init(healthCheckScript, scriptTimeout);
 this.threshold = config.getInt(HConstants.HEALTH_FAILURE_THRESHOLD,
  HConstants.DEFAULT_HEALTH_FAILURE_THRESHOLD);
 this.failureWindow = this.threshold * sleepTime;
}
origin: harbby/presto-connectors

CompactionChecker(final HRegionServer h, final int sleepTime,
  final Stoppable stopper) {
 super("CompactionChecker", stopper, sleepTime);
 this.instance = h;
 LOG.info(this.getName() + " runs every " + StringUtils.formatTime(sleepTime));
 /* MajorCompactPriority is configurable.
  * If not set, the compaction will use default priority.
  */
 this.majorCompactPriority = this.instance.conf.
  getInt("hbase.regionserver.compactionChecker.majorCompactPriority",
  DEFAULT_PRIORITY);
}
origin: com.aliyun.hbase/alihbase-client

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws RpcThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + StringUtils.formatTime(waitInterval);
 throw new RpcThrottlingException(type, waitInterval, msg);
}
origin: org.apache.kylin/kylin-job

protected int waitForCompletion(Job job) throws IOException, InterruptedException, ClassNotFoundException {
  int retVal = 0;
  long start = System.nanoTime();
  if (isAsync) {
    job.submit();
  } else {
    job.waitForCompletion(true);
    retVal = job.isSuccessful() ? 0 : 1;
    logger.debug("Job '" + job.getJobName() + "' finished " + (job.isSuccessful() ? "successfully in " : "with failures.  Time taken ") + formatTime((System.nanoTime() - start) / 1000000L));
  }
  return retVal;
}
org.apache.hadoop.utilStringUtilsformatTime

Javadoc

Given the time in long milliseconds, returns a String in the format Xhrs, Ymins, Z sec.

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
  • unEscapeString
  • getStringCollection
    Returns a collection of strings.
  • unEscapeString,
  • getStringCollection,
  • byteDesc,
  • formatPercent,
  • getTrimmedStrings,
  • equalsIgnoreCase,
  • format,
  • formatTimeDiff,
  • getTrimmedStringCollection

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook extensions
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