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

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

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

origin: apache/hbase

StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);
origin: com.facebook.hadoop/hadoop-core

/**
 * Return an abbreviated English-language desc of the byte length
 */
public static String byteDesc(long len) {
 double val = 0.0;
 String ending = "";
 if (len < 1024 * 1024) {
  val = (1.0 * len) / 1024;
  ending = " KB";
 } else if (len < 1024 * 1024 * 1024) {
  val = (1.0 * len) / (1024 * 1024);
  ending = " MB";
 } else if (len < 1024L * 1024 * 1024 * 1024) {
  val = (1.0 * len) / (1024 * 1024 * 1024);
  ending = " GB";
 } else if (len < 1024L * 1024 * 1024 * 1024 * 1024) {
  val = (1.0 * len) / (1024L * 1024 * 1024 * 1024);
  ending = " TB";
 } else {
  val = (1.0 * len) / (1024L * 1024 * 1024 * 1024 * 1024);
  ending = " PB";
 }
 return limitDecimalTo2(val) + ending;
}
origin: com.facebook.hadoop/hadoop-core

/**
 * @deprecated Consider using {@link org.apache.hadoop.util.StringUtils#limitDecimalTo2} instead.
 */
@Deprecated
public static synchronized String limitDecimalTo2(double d) {
 return StringUtils.limitDecimalTo2(d);
}
origin: com.facebook.hadoop/hadoop-core

/**
 * @deprecated Consider using {@link org.apache.hadoop.util.StringUtils#limitDecimalTo2} instead.
 */
@Deprecated
public static synchronized String limitDecimalTo2(double d) {
 return StringUtils.limitDecimalTo2(d);
}
origin: com.facebook.hadoop/hadoop-core

/** A formatted string for printing the status of the DataNode. */
public String dumpDatanode() {
 StringBuffer buffer = new StringBuffer();
 long c = getCapacity();
 long r = getRemaining();
 long u = getDfsUsed();
 buffer.append(name);
 if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
  buffer.append(" "+location);
 }
 if (isDecommissioned()) {
  buffer.append(" DD");
 } else if (isDecommissionInProgress()) {
  buffer.append(" DP");
 } else {
  buffer.append(" IN");
 }
 buffer.append(" " + c + "(" + StringUtils.byteDesc(c)+")");
 buffer.append(" " + u + "(" + StringUtils.byteDesc(u)+")");
 buffer.append(" " + StringUtils.limitDecimalTo2(((1.0*u)/c)*100)+"%");
 buffer.append(" " + r + "(" + StringUtils.byteDesc(r)+")");
 buffer.append(" " + new Date(lastUpdate));
 return buffer.toString();
}
origin: com.facebook.hadoop/hadoop-core

/** A formatted string for reporting the status of the DataNode. */
public String getDatanodeReport() {
 StringBuffer buffer = new StringBuffer();
 long c = getCapacity();
 long r = getRemaining();
 long u = getDfsUsed();
 long nonDFSUsed = getNonDfsUsed();
 float usedPercent = getDfsUsedPercent();
 float remainingPercent = getRemainingPercent();
 buffer.append("Name: "+name+"\n");
 if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
  buffer.append("Rack: "+location+"\n");
 }
 buffer.append("Decommission Status : ");
 if (isDecommissioned()) {
  buffer.append("Decommissioned\n");
 } else if (isDecommissionInProgress()) {
  buffer.append("Decommission in progress\n");
 } else {
  buffer.append("Normal\n");
 }
 buffer.append("Configured Capacity: "+c+" ("+StringUtils.byteDesc(c)+")"+"\n");
 buffer.append("DFS Used: "+u+" ("+StringUtils.byteDesc(u)+")"+"\n");
 buffer.append("Non DFS Used: "+nonDFSUsed+" ("+StringUtils.byteDesc(nonDFSUsed)+")"+"\n");
 buffer.append("DFS Remaining: " +r+ "("+StringUtils.byteDesc(r)+")"+"\n");
 buffer.append("DFS Used%: "+StringUtils.limitDecimalTo2(usedPercent)+"%\n");
 buffer.append("DFS Remaining%: "+StringUtils.limitDecimalTo2(remainingPercent)+"%\n");
 buffer.append("Last contact: "+new Date(lastUpdate)+"\n");
 return buffer.toString();
}
origin: co.cask.hbase/hbase

 private StringBuilder appendHistogram(StringBuilder sb, 
   MetricsHistogram histogram) {
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "Mean", 
    StringUtils.limitDecimalTo2(histogram.getMean()));
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "Count", 
    StringUtils.limitDecimalTo2(histogram.getCount()));
  final Snapshot s = histogram.getSnapshot();
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "Median", 
    StringUtils.limitDecimalTo2(s.getMedian()));
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "75th", 
    StringUtils.limitDecimalTo2(s.get75thPercentile()));
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "95th", 
    StringUtils.limitDecimalTo2(s.get95thPercentile()));
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "99th", 
    StringUtils.limitDecimalTo2(s.get99thPercentile()));
  sb = Strings.appendKeyValue(sb, 
    histogram.getName() + "999th", 
    StringUtils.limitDecimalTo2(s.get999thPercentile()));
  return sb;
 }
}
origin: com.facebook.hadoop/hadoop-core

          + " (" + StringUtils.byteDesc(used) + ")");
System.out.println("DFS Used%: "
          + StringUtils.limitDecimalTo2(((1.0 * used) / presentCapacity) * 100)
          + "%");
origin: co.cask.hbase/hbase

 Long.valueOf(memory.getMax()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName()+"MB",
  StringUtils.limitDecimalTo2((float)this.blockCacheSize.get()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName()+"MB",
  StringUtils.limitDecimalTo2((float)this.blockCacheFree.get()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(),
  Long.valueOf(this.blockCacheCount.get()));
origin: co.cask.hbase/hbase

org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);
origin: alibaba/wasp

org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.limitDecimalTo2(master.getFServerManager().getAverageLoad())), jamonWriter);
origin: harbby/presto-connectors

StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);
org.apache.hadoop.utilStringUtilslimitDecimalTo2

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,
  • formatTimeDiff,
  • getTrimmedStringCollection

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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