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

The following examples show how to use org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationSystem. 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: ResourceManager.java    From hadoop with 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 File: AdminService.java    From hadoop with 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 File: ResourceManager.java    From big-c with 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 File: AdminService.java    From big-c with 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 File: RMActiveServiceContext.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public ReservationSystem getReservationSystem() {
  return this.reservationSystem;
}
 
Example #6
Source File: RMActiveServiceContext.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
void setReservationSystem(ReservationSystem reservationSystem) {
  this.reservationSystem = reservationSystem;
}
 
Example #7
Source File: RMContextImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public ReservationSystem getReservationSystem() {
  return activeServiceContext.getReservationSystem();
}
 
Example #8
Source File: RMContextImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
void setReservationSystem(ReservationSystem reservationSystem) {
  activeServiceContext.setReservationSystem(reservationSystem);
}
 
Example #9
Source File: RMActiveServiceContext.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public ReservationSystem getReservationSystem() {
  return this.reservationSystem;
}
 
Example #10
Source File: RMActiveServiceContext.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
void setReservationSystem(ReservationSystem reservationSystem) {
  this.reservationSystem = reservationSystem;
}
 
Example #11
Source File: RMContextImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public ReservationSystem getReservationSystem() {
  return activeServiceContext.getReservationSystem();
}
 
Example #12
Source File: RMContextImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
void setReservationSystem(ReservationSystem reservationSystem) {
  activeServiceContext.setReservationSystem(reservationSystem);
}
 
Example #13
Source File: MockRMContext.java    From incubator-myriad with Apache License 2.0 4 votes vote down vote up
@Override
public ReservationSystem getReservationSystem() {
  return null;
}
 
Example #14
Source File: RMContext.java    From hadoop with Apache License 2.0 votes vote down vote up
ReservationSystem getReservationSystem(); 
Example #15
Source File: RMContext.java    From big-c with Apache License 2.0 votes vote down vote up
ReservationSystem getReservationSystem();