Java Code Examples for org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationSystem

The following examples show how to use org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationSystem. 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: ResourceManager.java    License: Apache License 2.0 6 votes vote down vote up
protected ReservationSystem createReservationSystem() {
  String reservationClassName =
      conf.get(YarnConfiguration.RM_RESERVATION_SYSTEM_CLASS,
          AbstractReservationSystem.getDefaultReservationSystem(scheduler));
  if (reservationClassName == null) {
    return null;
  }
  LOG.info("Using ReservationSystem: " + reservationClassName);
  try {
    Class<?> reservationClazz = Class.forName(reservationClassName);
    if (ReservationSystem.class.isAssignableFrom(reservationClazz)) {
      return (ReservationSystem) ReflectionUtils.newInstance(
          reservationClazz, this.conf);
    } else {
      throw new YarnRuntimeException("Class: " + reservationClassName
          + " not instance of " + ReservationSystem.class.getCanonicalName());
    }
  } catch (ClassNotFoundException e) {
    throw new YarnRuntimeException(
        "Could not instantiate ReservationSystem: " + reservationClassName, e);
  }
}
 
Example 2
Source Project: hadoop   Source File: AdminService.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException, StandbyException {
  String argName = "refreshQueues";
  final String msg = "refresh queues.";
  UserGroupInformation user = checkAcls(argName);

  checkRMStatus(user.getShortUserName(), argName, msg);

  RefreshQueuesResponse response =
      recordFactory.newRecordInstance(RefreshQueuesResponse.class);
  try {
    rmContext.getScheduler().reinitialize(getConfig(), this.rmContext);
    // refresh the reservation system
    ReservationSystem rSystem = rmContext.getReservationSystem();
    if (rSystem != null) {
      rSystem.reinitialize(getConfig(), rmContext);
    }
    RMAuditLogger.logSuccess(user.getShortUserName(), argName,
        "AdminService");
    return response;
  } catch (IOException ioe) {
    throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
  }
}
 
Example 3
Source Project: big-c   Source File: ResourceManager.java    License: Apache License 2.0 6 votes vote down vote up
protected ReservationSystem createReservationSystem() {
  String reservationClassName =
      conf.get(YarnConfiguration.RM_RESERVATION_SYSTEM_CLASS,
          AbstractReservationSystem.getDefaultReservationSystem(scheduler));
  if (reservationClassName == null) {
    return null;
  }
  LOG.info("Using ReservationSystem: " + reservationClassName);
  try {
    Class<?> reservationClazz = Class.forName(reservationClassName);
    if (ReservationSystem.class.isAssignableFrom(reservationClazz)) {
      return (ReservationSystem) ReflectionUtils.newInstance(
          reservationClazz, this.conf);
    } else {
      throw new YarnRuntimeException("Class: " + reservationClassName
          + " not instance of " + ReservationSystem.class.getCanonicalName());
    }
  } catch (ClassNotFoundException e) {
    throw new YarnRuntimeException(
        "Could not instantiate ReservationSystem: " + reservationClassName, e);
  }
}
 
Example 4
Source Project: big-c   Source File: AdminService.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException, StandbyException {
  String argName = "refreshQueues";
  final String msg = "refresh queues.";
  UserGroupInformation user = checkAcls(argName);

  checkRMStatus(user.getShortUserName(), argName, msg);

  RefreshQueuesResponse response =
      recordFactory.newRecordInstance(RefreshQueuesResponse.class);
  try {
    rmContext.getScheduler().reinitialize(getConfig(), this.rmContext);
    // refresh the reservation system
    ReservationSystem rSystem = rmContext.getReservationSystem();
    if (rSystem != null) {
      rSystem.reinitialize(getConfig(), rmContext);
    }
    RMAuditLogger.logSuccess(user.getShortUserName(), argName,
        "AdminService");
    return response;
  } catch (IOException ioe) {
    throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
  }
}
 
Example 5
Source Project: hadoop   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public ReservationSystem getReservationSystem() {
  return this.reservationSystem;
}
 
Example 6
Source Project: hadoop   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
void setReservationSystem(ReservationSystem reservationSystem) {
  this.reservationSystem = reservationSystem;
}
 
Example 7
Source Project: hadoop   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ReservationSystem getReservationSystem() {
  return activeServiceContext.getReservationSystem();
}
 
Example 8
Source Project: hadoop   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
void setReservationSystem(ReservationSystem reservationSystem) {
  activeServiceContext.setReservationSystem(reservationSystem);
}
 
Example 9
Source Project: big-c   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public ReservationSystem getReservationSystem() {
  return this.reservationSystem;
}
 
Example 10
Source Project: big-c   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
void setReservationSystem(ReservationSystem reservationSystem) {
  this.reservationSystem = reservationSystem;
}
 
Example 11
Source Project: big-c   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ReservationSystem getReservationSystem() {
  return activeServiceContext.getReservationSystem();
}
 
Example 12
Source Project: big-c   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
void setReservationSystem(ReservationSystem reservationSystem) {
  activeServiceContext.setReservationSystem(reservationSystem);
}
 
Example 13
Source Project: incubator-myriad   Source File: MockRMContext.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ReservationSystem getReservationSystem() {
  return null;
}
 
Example 14
Source Project: hadoop   Source File: RMContext.java    License: Apache License 2.0 votes vote down vote up
ReservationSystem getReservationSystem(); 
Example 15
Source Project: big-c   Source File: RMContext.java    License: Apache License 2.0 votes vote down vote up
ReservationSystem getReservationSystem();