org.apache.hadoop.metrics.Updater Java Examples

The following examples show how to use org.apache.hadoop.metrics.Updater. 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: AbstractMetricsContext.java    From hadoop with Apache License 2.0 6 votes vote down vote up
/**
 * Timer callback.
 */
private void timerEvent() throws IOException {
  if (isMonitoring) {
    Collection<Updater> myUpdaters;
    synchronized (this) {
      myUpdaters = new ArrayList<Updater>(updaters);
    }     
    // Run all the registered updates without holding a lock
    // on this context
    for (Updater updater : myUpdaters) {
      try {
        updater.doUpdates(this);
      }
      catch (Throwable throwable) {
        throwable.printStackTrace();
      }
    }
    emitRecords();
  }
}
 
Example #2
Source File: AbstractMetricsContext.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
/**
 * Timer callback.
 */
private void timerEvent() throws IOException {
  if (isMonitoring) {
    Collection<Updater> myUpdaters;
    synchronized (this) {
      myUpdaters = new ArrayList<Updater>(updaters);
    }     
    // Run all the registered updates without holding a lock
    // on this context
    for (Updater updater : myUpdaters) {
      try {
        updater.doUpdates(this);
      }
      catch (Throwable throwable) {
        throwable.printStackTrace();
      }
    }
    emitRecords();
  }
}
 
Example #3
Source File: AbstractMetricsContext.java    From big-c with Apache License 2.0 6 votes vote down vote up
/**
 * Timer callback.
 */
private void timerEvent() throws IOException {
  if (isMonitoring) {
    Collection<Updater> myUpdaters;
    synchronized (this) {
      myUpdaters = new ArrayList<Updater>(updaters);
    }     
    // Run all the registered updates without holding a lock
    // on this context
    for (Updater updater : myUpdaters) {
      try {
        updater.doUpdates(this);
      }
      catch (Throwable throwable) {
        throwable.printStackTrace();
      }
    }
    emitRecords();
  }
}
 
Example #4
Source File: AbstractMetricsContext.java    From RDFS with Apache License 2.0 6 votes vote down vote up
/**
 * Timer callback.
 */
private void timerEvent() throws IOException {
  if (isMonitoring) {
    Collection<Updater> myUpdaters;
    synchronized (this) {
      myUpdaters = new ArrayList<Updater>(updaters.keySet());
    }
    // Run all the registered updates without holding a lock
    // on this context
    for (Updater updater : myUpdaters) {
      try {
        updater.doUpdates(this);
      }
      catch (Throwable throwable) {
        throwable.printStackTrace();
      }
    }
    emitRecords();
  }
}
 
Example #5
Source File: CompositeContext.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example #6
Source File: CompositeContext.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void unregisterUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.unregisterUpdater(updater);
  }
}
 
Example #7
Source File: CompositeContext.java    From big-c with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example #8
Source File: CompositeContext.java    From big-c with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void unregisterUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.unregisterUpdater(updater);
  }
}
 
Example #9
Source File: CompositeContext.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
@Override
public void unregisterUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.unregisterUpdater(updater);
  }
}
 
Example #10
Source File: CompositeContext.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example #11
Source File: CompositeContext.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public void registerUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.registerUpdater(updater);
  }
}
 
Example #12
Source File: CompositeContext.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public void unregisterUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.unregisterUpdater(updater);
  }
}
 
Example #13
Source File: AbstractMetricsContext.java    From RDFS with Apache License 2.0 2 votes vote down vote up
/**
 * Registers a callback to be called at time intervals determined by
 * the configuration.
 *
 * @param updater object to be run periodically; it should update
 * some metrics records
 */
public synchronized void registerUpdater(final Updater updater) {
  if (!updaters.containsKey(updater)) {
    updaters.put(updater, Boolean.TRUE);
  }
}
 
Example #14
Source File: AbstractMetricsContext.java    From hadoop-gpu with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a callback, if it exists.
 *
 * @param updater object to be removed from the callback list
 */
public synchronized void unregisterUpdater(Updater updater) {
  updaters.remove(updater);
}
 
Example #15
Source File: AbstractMetricsContext.java    From hadoop-gpu with Apache License 2.0 2 votes vote down vote up
/**
 * Registers a callback to be called at time intervals determined by
 * the configuration.
 *
 * @param updater object to be run periodically; it should update
 * some metrics records 
 */
public synchronized void registerUpdater(final Updater updater) {
  if (!updaters.contains(updater)) {
    updaters.add(updater);
  }
}
 
Example #16
Source File: AbstractMetricsContext.java    From RDFS with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a callback, if it exists.
 *
 * @param updater object to be removed from the callback list
 */
public synchronized void unregisterUpdater(Updater updater) {
  updaters.remove(updater);
}
 
Example #17
Source File: AbstractMetricsContext.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Registers a callback to be called at time intervals determined by
 * the configuration.
 *
 * @param updater object to be run periodically; it should update
 * some metrics records 
 */
public synchronized void registerUpdater(final Updater updater) {
  if (!updaters.contains(updater)) {
    updaters.add(updater);
  }
}
 
Example #18
Source File: AbstractMetricsContext.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a callback, if it exists.
 *
 * @param updater object to be removed from the callback list
 */
public synchronized void unregisterUpdater(Updater updater) {
  updaters.remove(updater);
}
 
Example #19
Source File: AbstractMetricsContext.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Registers a callback to be called at time intervals determined by
 * the configuration.
 *
 * @param updater object to be run periodically; it should update
 * some metrics records 
 */
public synchronized void registerUpdater(final Updater updater) {
  if (!updaters.contains(updater)) {
    updaters.add(updater);
  }
}
 
Example #20
Source File: AbstractMetricsContext.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a callback, if it exists.
 *
 * @param updater object to be removed from the callback list
 */
public synchronized void unregisterUpdater(Updater updater) {
  updaters.remove(updater);
}