MetricsException.<init>
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.hadoop.metrics.MetricsException.<init>(Showing top 9 results out of 315)

  • Common ways to obtain MetricsException
private void myMethod () {
MetricsException m =
  • String str;new MetricsException(str)
  • AI code suggestions by Codota
}
origin: com.facebook.hadoop/hadoop-core

/**
 * If a period is set in the attribute passed in, override
 * the default with it.
 */
protected void parseAndSetPeriod(String attributeName) {
 String periodStr = getAttribute(attributeName);
 if (periodStr != null) {
  int period = 0;
  try {
   period = Integer.parseInt(periodStr);
  } catch (NumberFormatException nfe) {
  }
  if (period <= 0) {
   throw new MetricsException("Invalid period: " + periodStr);
  }
  setPeriod(period);
 }
}
 
origin: com.facebook.hadoop/hadoop-core

@Override
public void init(String contextName, ContextFactory factory) {
 super.init(contextName, factory);
 initAllowedRecords();
 
 String periodStr = getAttribute(PERIOD_PROPERTY);
 if (periodStr != null) {
  int period = 0;
  try {
   period = Integer.parseInt(periodStr);
  } catch (NumberFormatException nfe) {
  }
  if (period <= 0) {
   throw new MetricsException("Invalid period: " + periodStr);
  }
  setPeriod(period);
 }
}
origin: apache/chukwa

/**
 * Adds two numbers, coercing the second to the type of the first.
 *
 */
private Number sum(Number a, Number b) {
 if (a instanceof Integer) {
  return Integer.valueOf(a.intValue() + b.intValue());
 }
 else if (a instanceof Float) {
  return new Float(a.floatValue() + b.floatValue());
 }
 else if (a instanceof Short) {
  return Short.valueOf((short)(a.shortValue() + b.shortValue()));
 }
 else if (a instanceof Byte) {
  return Byte.valueOf((byte)(a.byteValue() + b.byteValue()));
 }
 else if (a instanceof Long) {
  return Long.valueOf((a.longValue() + b.longValue()));
 }
 else {
  // should never happen
  throw new MetricsException("Invalid number type");
 }
     
}
  
origin: apache/chukwa

public void init(String contextName, ContextFactory factory) {
 super.init(contextName, factory);
  String periodStr = getAttribute(PERIOD_PROPERTY);
 if (periodStr != null) {
  int period = 0;
  try {
   period = Integer.parseInt(periodStr);
  } catch (NumberFormatException nfe) {
   log.debug(ExceptionUtil.getStackTrace(nfe));
  }
  if (period <= 0) {
   throw new MetricsException("Invalid period: " + periodStr);
  }
  setPeriod(period);
  this.period = period;
  log.info("Log4JMetricsContext." + contextName + ".period=" + period);
 }
 String host = getAttribute(HOST_PROPERTY);
 if (host != null) {
  this.host = host;
 }
 String port = getAttribute(PORT_PROPERTY);
 if (port != null) {
  this.port = Integer.parseInt(port);
 }
}
origin: io.hops/hadoop-common

 /**
  * If a period is set in the attribute passed in, override
  * the default with it.
  */
 protected void parseAndSetPeriod(String attributeName) {
  String periodStr = getAttribute(attributeName);
  if (periodStr != null) {
   int period = 0;
   try {
    period = Integer.parseInt(periodStr);
   } catch (NumberFormatException nfe) {
   }
   if (period <= 0) {
    throw new MetricsException("Invalid period: " + periodStr);
   }
   setPeriod(period);
  }
 }
}
origin: com.facebook.presto.hadoop/hadoop-cdh4

 /**
  * If a period is set in the attribute passed in, override
  * the default with it.
  */
 protected void parseAndSetPeriod(String attributeName) {
  String periodStr = getAttribute(attributeName);
  if (periodStr != null) {
   int period = 0;
   try {
    period = Integer.parseInt(periodStr);
   } catch (NumberFormatException nfe) {
   }
   if (period <= 0) {
    throw new MetricsException("Invalid period: " + periodStr);
   }
   setPeriod(period);
  }
 }
}
origin: io.hops/hadoop-common

/**
 * Adds two numbers, coercing the second to the type of the first.
 *
 */
private Number sum(Number a, Number b) {
 if (a instanceof Integer) {
  return Integer.valueOf(a.intValue() + b.intValue());
 }
 else if (a instanceof Float) {
  return new Float(a.floatValue() + b.floatValue());
 }
 else if (a instanceof Short) {
  return Short.valueOf((short)(a.shortValue() + b.shortValue()));
 }
 else if (a instanceof Byte) {
  return Byte.valueOf((byte)(a.byteValue() + b.byteValue()));
 }
 else if (a instanceof Long) {
  return Long.valueOf((a.longValue() + b.longValue()));
 }
 else {
  // should never happen
  throw new MetricsException("Invalid number type");
 }
     
}
 
origin: com.facebook.presto.hadoop/hadoop-cdh4

/**
 * Adds two numbers, coercing the second to the type of the first.
 *
 */
private Number sum(Number a, Number b) {
 if (a instanceof Integer) {
  return Integer.valueOf(a.intValue() + b.intValue());
 }
 else if (a instanceof Float) {
  return new Float(a.floatValue() + b.floatValue());
 }
 else if (a instanceof Short) {
  return Short.valueOf((short)(a.shortValue() + b.shortValue()));
 }
 else if (a instanceof Byte) {
  return Byte.valueOf((byte)(a.byteValue() + b.byteValue()));
 }
 else if (a instanceof Long) {
  return Long.valueOf((a.longValue() + b.longValue()));
 }
 else {
  // should never happen
  throw new MetricsException("Invalid number type");
 }
     
}
  
origin: com.facebook.hadoop/hadoop-core

/**
 * Adds two numbers, coercing the second to the type of the first.
 *
 */
private Number sum(Number a, Number b) {
 if (a instanceof Integer) {
  return Integer.valueOf(a.intValue() + b.intValue());
 }
 else if (a instanceof Float) {
  return new Float(a.floatValue() + b.floatValue());
 }
 else if (a instanceof Short) {
  return Short.valueOf((short)(a.shortValue() + b.shortValue()));
 }
 else if (a instanceof Byte) {
  return Byte.valueOf((byte)(a.byteValue() + b.byteValue()));
 }
 else if (a instanceof Long) {
  return Long.valueOf((a.longValue() + b.longValue()));
 }
 else {
  // should never happen
  throw new MetricsException("Invalid number type");
 }
     
}
  
org.apache.hadoop.metricsMetricsException<init>

Javadoc

Creates a new instance of MetricsException

Popular methods of MetricsException

    Popular classes and methods

    • scheduleAtFixedRate (Timer)
      Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • putExtra (Intent)
    • HttpURLConnection (java.net)
      An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
    • NoSuchElementException (java.util)
      Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
    • SortedMap (java.util)
      A Map that further provides a total ordering on its keys. The map is ordered according to the Compar
    • SortedSet (java.util)
      A Set that further provides a total ordering on its elements. The elements are ordered using their C
    • Stream (java.util.stream)
      A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
    • DataSource (javax.sql)
      An interface for the creation of Connection objects which represent a connection to a database. This
    • Reflections (org.reflections)
      Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t

    For IntelliJ IDEA and
    Android Studio

    • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
    • EnterpriseFAQAboutContact Us
    • Terms of usePrivacy policyCodeboxFind Usages
    Add Codota to your IDE (free)