Java Code Examples for org.apache.hadoop.yarn.server.api.AuxiliaryService

The following examples show how to use org.apache.hadoop.yarn.server.api.AuxiliaryService. These examples are extracted from open source projects. 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 Project: hadoop   Source File: AuxServices.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void serviceStart() throws Exception {
  // TODO fork(?) services running as configured user
  //      monitor for health, shutdown/restart(?) if any should die
  for (Map.Entry<String, AuxiliaryService> entry : serviceMap.entrySet()) {
    AuxiliaryService service = entry.getValue();
    String name = entry.getKey();
    service.start();
    service.registerServiceListener(this);
    ByteBuffer meta = service.getMetaData();
    if(meta != null) {
      serviceMetaData.put(name, meta);
    }
  }
  super.serviceStart();
}
 
Example 2
Source Project: big-c   Source File: AuxServices.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void serviceStart() throws Exception {
  // TODO fork(?) services running as configured user
  //      monitor for health, shutdown/restart(?) if any should die
  for (Map.Entry<String, AuxiliaryService> entry : serviceMap.entrySet()) {
    AuxiliaryService service = entry.getValue();
    String name = entry.getKey();
    service.start();
    service.registerServiceListener(this);
    ByteBuffer meta = service.getMetaData();
    if(meta != null) {
      serviceMetaData.put(name, meta);
    }
  }
  super.serviceStart();
}
 
Example 3
Source Project: hadoop   Source File: AuxServices.java    License: Apache License 2.0 5 votes vote down vote up
public AuxServices() {
  super(AuxServices.class.getName());
  serviceMap =
    Collections.synchronizedMap(new HashMap<String,AuxiliaryService>());
  serviceMetaData =
    Collections.synchronizedMap(new HashMap<String,ByteBuffer>());
  // Obtain services from configuration in init()
}
 
Example 4
Source Project: big-c   Source File: AuxServices.java    License: Apache License 2.0 5 votes vote down vote up
public AuxServices() {
  super(AuxServices.class.getName());
  serviceMap =
    Collections.synchronizedMap(new HashMap<String,AuxiliaryService>());
  serviceMetaData =
    Collections.synchronizedMap(new HashMap<String,ByteBuffer>());
  // Obtain services from configuration in init()
}
 
Example 5
Source Project: hadoop   Source File: AuxServices.java    License: Apache License 2.0 4 votes vote down vote up
protected final synchronized void addService(String name,
    AuxiliaryService service) {
  LOG.info("Adding auxiliary service " +
      service.getName() + ", \"" + name + "\"");
  serviceMap.put(name, service);
}
 
Example 6
Source Project: hadoop   Source File: AuxServices.java    License: Apache License 2.0 4 votes vote down vote up
Collection<AuxiliaryService> getServices() {
  return Collections.unmodifiableCollection(serviceMap.values());
}
 
Example 7
Source Project: hadoop   Source File: AuxServices.java    License: Apache License 2.0 4 votes vote down vote up
private void logWarningWhenAuxServiceThrowExceptions(AuxiliaryService service,
    AuxServicesEventType eventType, Throwable th) {
  LOG.warn((null == service ? "The auxService is null"
      : "The auxService name is " + service.getName())
      + " and it got an error at event: " + eventType, th);
}
 
Example 8
Source Project: big-c   Source File: AuxServices.java    License: Apache License 2.0 4 votes vote down vote up
protected final synchronized void addService(String name,
    AuxiliaryService service) {
  LOG.info("Adding auxiliary service " +
      service.getName() + ", \"" + name + "\"");
  serviceMap.put(name, service);
}
 
Example 9
Source Project: big-c   Source File: AuxServices.java    License: Apache License 2.0 4 votes vote down vote up
Collection<AuxiliaryService> getServices() {
  return Collections.unmodifiableCollection(serviceMap.values());
}
 
Example 10
Source Project: big-c   Source File: AuxServices.java    License: Apache License 2.0 4 votes vote down vote up
private void logWarningWhenAuxServiceThrowExceptions(AuxiliaryService service,
    AuxServicesEventType eventType, Throwable th) {
  LOG.warn((null == service ? "The auxService is null"
      : "The auxService name is " + service.getName())
      + " and it got an error at event: " + eventType, th);
}