Search in sources :

Example 11 with ReservationAllocationStateProto

use of org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto in project hadoop by apache.

the class MemoryRMStateStore method removeReservationState.

@Override
protected synchronized void removeReservationState(String planName, String reservationIdName) throws Exception {
    LOG.info("Removing reservationallocation " + reservationIdName + " for plan " + planName);
    Map<ReservationId, ReservationAllocationStateProto> planState = state.getReservationState().get(planName);
    if (planState == null) {
        throw new YarnRuntimeException("State for plan " + planName + " does " + "not exist");
    }
    ReservationId reservationId = ReservationId.parseReservationId(reservationIdName);
    planState.remove(reservationId);
    if (planState.isEmpty()) {
        state.getReservationState().remove(planName);
    }
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) ReservationId(org.apache.hadoop.yarn.api.records.ReservationId) ReservationAllocationStateProto(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto)

Aggregations

ReservationAllocationStateProto (org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto)11 ReservationId (org.apache.hadoop.yarn.api.records.ReservationId)9 RMState (org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore.RMState)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Resource (org.apache.hadoop.yarn.api.records.Resource)3 ReservationSubmissionRequest (org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest)2 ReservationSubmissionResponse (org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionResponse)2 ReservationDefinition (org.apache.hadoop.yarn.api.records.ReservationDefinition)2 ResourceCalculator (org.apache.hadoop.yarn.util.resource.ResourceCalculator)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 ReservationUpdateRequest (org.apache.hadoop.yarn.api.protocolrecords.ReservationUpdateRequest)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1 ReservationDefinitionProto (org.apache.hadoop.yarn.proto.YarnProtos.ReservationDefinitionProto)1 ResourceAllocationRequestProto (org.apache.hadoop.yarn.proto.YarnProtos.ResourceAllocationRequestProto)1 ReservationListResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.ReservationListResponseProtoOrBuilder)1 RMContext (org.apache.hadoop.yarn.server.resourcemanager.RMContext)1 InMemoryReservationAllocation (org.apache.hadoop.yarn.server.resourcemanager.reservation.InMemoryReservationAllocation)1 ReservationAllocation (org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationAllocation)1