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

The following examples show how to use org.apache.hadoop.yarn.server.api.AuxiliaryService. 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: AuxServices.java    From hadoop with 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 File: AuxServices.java    From big-c with 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 File: AuxServices.java    From hadoop with 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 File: AuxServices.java    From big-c with 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 File: AuxServices.java    From hadoop with 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 File: AuxServices.java    From hadoop with Apache License 2.0 4 votes vote down vote up
Collection<AuxiliaryService> getServices() {
  return Collections.unmodifiableCollection(serviceMap.values());
}
 
Example #7
Source File: AuxServices.java    From hadoop with 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 File: AuxServices.java    From big-c with 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 File: AuxServices.java    From big-c with Apache License 2.0 4 votes vote down vote up
Collection<AuxiliaryService> getServices() {
  return Collections.unmodifiableCollection(serviceMap.values());
}
 
Example #10
Source File: AuxServices.java    From big-c with 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);
}