Java Code Examples for org.apache.hadoop.metrics2.MetricsSystem#unregisterSource()

The following examples show how to use org.apache.hadoop.metrics2.MetricsSystem#unregisterSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestMetricsSystemImpl.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Test public void testUnregisterSource() {
  MetricsSystem ms = new MetricsSystemImpl();
  TestSource ts1 = new TestSource("ts1");
  TestSource ts2 = new TestSource("ts2");
  ms.register("ts1", "", ts1);
  ms.register("ts2", "", ts2);
  MetricsSource s1 = ms.getSource("ts1");
  assertNotNull(s1);
  // should work when metrics system is not started
  ms.unregisterSource("ts1");
  s1 = ms.getSource("ts1");
  assertNull(s1);
  MetricsSource s2 = ms.getSource("ts2");
  assertNotNull(s2);
  ms.shutdown();
}
 
Example 2
Source File: TestMetricsSystemImpl.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Test public void testUnregisterSource() {
  MetricsSystem ms = new MetricsSystemImpl();
  TestSource ts1 = new TestSource("ts1");
  TestSource ts2 = new TestSource("ts2");
  ms.register("ts1", "", ts1);
  ms.register("ts2", "", ts2);
  MetricsSource s1 = ms.getSource("ts1");
  assertNotNull(s1);
  // should work when metrics system is not started
  ms.unregisterSource("ts1");
  s1 = ms.getSource("ts1");
  assertNull(s1);
  MetricsSource s2 = ms.getSource("ts2");
  assertNotNull(s2);
  ms.shutdown();
}
 
Example 3
Source File: ContainerMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public static void remove() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(STORAGE_CONTAINER_METRICS);
}
 
Example 4
Source File: CSMMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 5
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 6
Source File: SCMPipelineMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
/**
 * Unregister the metrics instance.
 */
public static void unRegister() {
  instance = null;
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 7
Source File: SCMContainerMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE);
}
 
Example 8
Source File: SCMContainerManagerMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
/**
 * Unregister metrics.
 */
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 9
Source File: SCMMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 10
Source File: SCMContainerPlacementMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 11
Source File: SCMNodeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
/**
 * Unregister the metrics instance.
 */
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 12
Source File: XceiverClientMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 13
Source File: RDBMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public static void unRegister() {
  instance = null;
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 14
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 15
Source File: OMMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}
 
Example 16
Source File: OzoneManagerDoubleBufferMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public void unRegister() {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  ms.unregisterSource(SOURCE_NAME);
}