Java Code Examples for org.apache.hadoop.yarn.api.records.ReservationId

The following examples show how to use org.apache.hadoop.yarn.api.records.ReservationId. 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: InMemoryPlan.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public boolean deleteReservation(ReservationId reservationID) {
  writeLock.lock();
  try {
    ReservationAllocation reservation = getReservationById(reservationID);
    if (reservation == null) {
      String errMsg =
          "The specified Reservation with ID " + reservationID
              + " does not exist in the plan";
      LOG.error(errMsg);
      throw new IllegalArgumentException(errMsg);
    }
    return removeReservation(reservation);
  } finally {
    writeLock.unlock();
  }
}
 
Example 2
Source Project: big-c   Source File: TestInMemoryReservationAllocation.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testSkyline() {
  ReservationId reservationID =
      ReservationId.newInstance(rand.nextLong(), rand.nextLong());
  int[] alloc = { 0, 5, 10, 10, 5, 0 };
  int start = 100;
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length + 1,
          alloc.length);
  Map<ReservationInterval, ReservationRequest> allocations =
      generateAllocation(start, alloc, true, false);
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length + 1, allocations, resCalc, minAlloc);
  doAssertions(rAllocation, reservationID, rDef, allocations, start, alloc);
  Assert.assertFalse(rAllocation.containsGangs());
  for (int i = 0; i < alloc.length; i++) {
    Assert.assertEquals(
        Resource.newInstance(1024 * (alloc[i] + i), (alloc[i] + i)),
        rAllocation.getResourcesAtTime(start + i));
  }
}
 
Example 3
Source Project: hadoop   Source File: InMemoryReservationAllocation.java    License: Apache License 2.0 6 votes vote down vote up
InMemoryReservationAllocation(ReservationId reservationID,
    ReservationDefinition contract, String user, String planName,
    long startTime, long endTime,
    Map<ReservationInterval, ReservationRequest> allocationRequests,
    ResourceCalculator calculator, Resource minAlloc) {
  this.contract = contract;
  this.startTime = startTime;
  this.endTime = endTime;
  this.reservationID = reservationID;
  this.user = user;
  this.allocationRequests = allocationRequests;
  this.planName = planName;
  resourcesOverTime = new RLESparseResourceAllocation(calculator, minAlloc);
  for (Map.Entry<ReservationInterval, ReservationRequest> r : allocationRequests
      .entrySet()) {
    resourcesOverTime.addInterval(r.getKey(), r.getValue());
    if (r.getValue().getConcurrency() > 1) {
      hasGang = true;
    }
  }
}
 
Example 4
Source Project: hadoop   Source File: TestInMemoryReservationAllocation.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testSteps() {
  ReservationId reservationID =
      ReservationId.newInstance(rand.nextLong(), rand.nextLong());
  int[] alloc = { 10, 10, 10, 10, 10, 10 };
  int start = 100;
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length + 1,
          alloc.length);
  Map<ReservationInterval, ReservationRequest> allocations =
      generateAllocation(start, alloc, true, false);
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length + 1, allocations, resCalc, minAlloc);
  doAssertions(rAllocation, reservationID, rDef, allocations, start, alloc);
  Assert.assertFalse(rAllocation.containsGangs());
  for (int i = 0; i < alloc.length; i++) {
    Assert.assertEquals(
        Resource.newInstance(1024 * (alloc[i] + i), (alloc[i] + i), (alloc[i] + i)),
        rAllocation.getResourcesAtTime(start + i));
  }
}
 
Example 5
Source Project: hadoop   Source File: TestInMemoryReservationAllocation.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testZeroAlloaction() {
  ReservationId reservationID =
      ReservationId.newInstance(rand.nextLong(), rand.nextLong());
  int[] alloc = {};
  long start = 0;
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length + 1,
          alloc.length);
  Map<ReservationInterval, ReservationRequest> allocations =
      new HashMap<ReservationInterval, ReservationRequest>();
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length + 1, allocations, resCalc, minAlloc);
  doAssertions(rAllocation, reservationID, rDef, allocations, (int) start,
      alloc);
  Assert.assertFalse(rAllocation.containsGangs());
}
 
Example 6
Source Project: hadoop   Source File: TestInMemoryReservationAllocation.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testGangAlloaction() {
  ReservationId reservationID =
      ReservationId.newInstance(rand.nextLong(), rand.nextLong());
  int[] alloc = { 10, 10, 10, 10, 10, 10 };
  int start = 100;
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length + 1,
          alloc.length);
  Map<ReservationInterval, ReservationRequest> allocations =
      generateAllocation(start, alloc, false, true);
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length + 1, allocations, resCalc, minAlloc);
  doAssertions(rAllocation, reservationID, rDef, allocations, start, alloc);
  Assert.assertTrue(rAllocation.containsGangs());
  for (int i = 0; i < alloc.length; i++) {
    Assert.assertEquals(Resource.newInstance(1024 * (alloc[i]), (alloc[i]), (alloc[i])),
        rAllocation.getResourcesAtTime(start + i));
  }
}
 
Example 7
Source Project: big-c   Source File: TestReservationInputValidator.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
 
Example 8
Source Project: big-c   Source File: TestInMemoryReservationAllocation.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testSteps() {
  ReservationId reservationID =
      ReservationId.newInstance(rand.nextLong(), rand.nextLong());
  int[] alloc = { 10, 10, 10, 10, 10, 10 };
  int start = 100;
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length + 1,
          alloc.length);
  Map<ReservationInterval, ReservationRequest> allocations =
      generateAllocation(start, alloc, true, false);
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length + 1, allocations, resCalc, minAlloc);
  doAssertions(rAllocation, reservationID, rDef, allocations, start, alloc);
  Assert.assertFalse(rAllocation.containsGangs());
  for (int i = 0; i < alloc.length; i++) {
    Assert.assertEquals(
        Resource.newInstance(1024 * (alloc[i] + i), (alloc[i] + i)),
        rAllocation.getResourcesAtTime(start + i));
  }
}
 
Example 9
Source Project: big-c   Source File: TestReservationInputValidator.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testUpdateReservationDoesnotExist() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(1, 1, 1, 5, 4);
  ReservationId rId = request.getReservationId();
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
 
Example 10
Source Project: big-c   Source File: TestInMemoryPlan.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testAddEmptyReservation() {
  Plan plan =
      new InMemoryPlan(queueMetrics, policy, agent, totalCapacity, 1L,
          resCalc, minAlloc, maxAlloc, planName, replanner, true);
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  int[] alloc = {};
  int start = 100;
  Map<ReservationInterval, ReservationRequest> allocations =
      new HashMap<ReservationInterval, ReservationRequest>();
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length,
          alloc.length, allocations.values());
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length, allocations, resCalc, minAlloc);
  Assert.assertNull(plan.getReservationById(reservationID));
  try {
    plan.addReservation(rAllocation);
  } catch (PlanningException e) {
    Assert.fail(e.getMessage());
  }
}
 
Example 11
Source Project: hadoop   Source File: TestInMemoryPlan.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testAddEmptyReservation() {
  Plan plan =
      new InMemoryPlan(queueMetrics, policy, agent, totalCapacity, 1L,
          resCalc, minAlloc, maxAlloc, planName, replanner, true);
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  int[] alloc = {};
  int start = 100;
  Map<ReservationInterval, ReservationRequest> allocations =
      new HashMap<ReservationInterval, ReservationRequest>();
  ReservationDefinition rDef =
      createSimpleReservationDefinition(start, start + alloc.length,
          alloc.length, allocations.values());
  ReservationAllocation rAllocation =
      new InMemoryReservationAllocation(reservationID, rDef, user, planName,
          start, start + alloc.length, allocations, resCalc, minAlloc);
  Assert.assertNull(plan.getReservationById(reservationID));
  try {
    plan.addReservation(rAllocation);
  } catch (PlanningException e) {
    Assert.fail(e.getMessage());
  }
}
 
Example 12
Source Project: hadoop   Source File: TestReservationInputValidator.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
 
Example 13
Source Project: hadoop   Source File: TestReservationInputValidator.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testDeleteReservationInvalidPlan() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(reservationID);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not associated with any valid plan. Please try again with a valid reservation."));
    LOG.info(message);
  }
}
 
Example 14
Source Project: big-c   Source File: TestReservationInputValidator.java    License: Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() {
  clock = mock(Clock.class);
  plan = mock(Plan.class);
  rSystem = mock(ReservationSystem.class);
  plans.put(PLAN_NAME, plan);
  rrValidator = new ReservationInputValidator(clock);
  when(clock.getTime()).thenReturn(1L);
  ResourceCalculator rCalc = new DefaultResourceCalculator();
  Resource resource = Resource.newInstance(10240, 10);
  when(plan.getResourceCalculator()).thenReturn(rCalc);
  when(plan.getTotalCapacity()).thenReturn(resource);
  when(rSystem.getQueueForReservation(any(ReservationId.class))).thenReturn(
      PLAN_NAME);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(plan);
}
 
Example 15
Source Project: hadoop   Source File: ReservationUpdateRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ReservationId getReservationId() {
  ReservationUpdateRequestProtoOrBuilder p = viaProto ? proto : builder;
  if (reservationId != null) {
    return reservationId;
  }
  if (!p.hasReservationId()) {
    return null;
  }
  reservationId = convertFromProtoFormat(p.getReservationId());
  return reservationId;
}
 
Example 16
Source Project: big-c   Source File: ClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ReservationDeleteResponse deleteReservation(
    ReservationDeleteRequest request) throws YarnException, IOException {
  // Check if reservation system is enabled
  checkReservationSytem(AuditConstants.DELETE_RESERVATION_REQUEST);
  ReservationDeleteResponse response =
      recordFactory.newRecordInstance(ReservationDeleteResponse.class);
  // Validate the input
  Plan plan =
      rValidator.validateReservationDeleteRequest(reservationSystem, request);
  ReservationId reservationId = request.getReservationId();
  String queueName = reservationSystem.getQueueForReservation(reservationId);
  // Check ACLs
  String user =
      checkReservationACLs(queueName,
          AuditConstants.DELETE_RESERVATION_REQUEST);
  // Try to update the reservation using default agent
  try {
    boolean result =
        plan.getReservationAgent().deleteReservation(reservationId, user,
            plan);
    if (!result) {
      String errMsg = "Could not delete reservation: " + reservationId;
      RMAuditLogger.logFailure(user,
          AuditConstants.DELETE_RESERVATION_REQUEST, errMsg,
          "ClientRMService", errMsg);
      throw RPCUtil.getRemoteException(errMsg);
    }
  } catch (PlanningException e) {
    RMAuditLogger.logFailure(user, AuditConstants.DELETE_RESERVATION_REQUEST,
        e.getMessage(), "ClientRMService",
        "Unable to delete the reservation: " + reservationId);
    throw RPCUtil.getRemoteException(e);
  }
  RMAuditLogger.logSuccess(user, AuditConstants.DELETE_RESERVATION_REQUEST,
      "ClientRMService: " + reservationId);
  return response;
}
 
Example 17
Source Project: hadoop   Source File: ReservationDeleteRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setReservationId(ReservationId reservationId) {
  maybeInitBuilder();
  if (reservationId == null) {
    builder.clearReservationId();
    return;
  }
  this.reservationId = reservationId;
}
 
Example 18
Source Project: big-c   Source File: TestNoOverCommitPolicy.java    License: Apache License 2.0 5 votes vote down vote up
@Test(expected = MismatchedUserException.class)
public void testUserMismatch() throws IOException, PlanningException {
  // generate allocation from single tenant that exceed capacity
  int[] f = generateData(3600, (int) (0.5 * totCont));

  ReservationId rid = ReservationSystemTestUtil.getNewReservationId();
  plan.addReservation(new InMemoryReservationAllocation(rid, null, "u1",
      "dedicated", initTime, initTime + f.length, ReservationSystemTestUtil
          .generateAllocation(initTime, step, f), res, minAlloc));

  // trying to update a reservation with a mismatching user
  plan.updateReservation(new InMemoryReservationAllocation(rid, null, "u2",
      "dedicated", initTime, initTime + f.length, ReservationSystemTestUtil
          .generateAllocation(initTime, step, f), res, minAlloc));
}
 
Example 19
Source Project: hadoop   Source File: ApplicationSubmissionContextPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setReservationID(ReservationId reservationID) {
  maybeInitBuilder();
  if (reservationID == null) {
    builder.clearReservationId();
    return;
  }
  this.reservationId = reservationID;
}
 
Example 20
Source Project: hadoop   Source File: CapacitySchedulerPlanFollower.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Resource getReservationQueueResourceIfExists(Plan plan,
    ReservationId reservationId) {
  CSQueue resQueue = cs.getQueue(reservationId.toString());
  Resource reservationResource = null;
  if (resQueue != null) {
    reservationResource = Resources.multiply(cs.getClusterResource(),
        resQueue.getAbsoluteCapacity());
  }
  return reservationResource;
}
 
Example 21
Source Project: hadoop   Source File: ReservationInputValidator.java    License: Apache License 2.0 5 votes vote down vote up
private Plan validateReservation(ReservationSystem reservationSystem,
    ReservationId reservationId, String auditConstant) throws YarnException {
  String message = "";
  // check if the reservation id is valid
  if (reservationId == null) {
    message =
        "Missing reservation id."
            + " Please try again by specifying a reservation id.";
    RMAuditLogger.logFailure("UNKNOWN", auditConstant,
        "validate reservation input", "ClientRMService", message);
    throw RPCUtil.getRemoteException(message);
  }
  String queueName = reservationSystem.getQueueForReservation(reservationId);
  if (queueName == null) {
    message =
        "The specified reservation with ID: " + reservationId
            + " is unknown. Please try again with a valid reservation.";
    RMAuditLogger.logFailure("UNKNOWN", auditConstant,
        "validate reservation input", "ClientRMService", message);
    throw RPCUtil.getRemoteException(message);
  }
  // check if the associated plan is valid
  Plan plan = reservationSystem.getPlan(queueName);
  if (plan == null) {
    message =
        "The specified reservation: " + reservationId
            + " is not associated with any valid plan."
            + " Please try again with a valid reservation.";
    RMAuditLogger.logFailure("UNKNOWN", auditConstant,
        "validate reservation input", "ClientRMService", message);
    throw RPCUtil.getRemoteException(message);
  }
  return plan;
}
 
Example 22
Source Project: big-c   Source File: TestCapacitySchedulerPlanFollower.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void assertReservationQueueExists(ReservationId r2,
    double expectedCapacity, double expectedMaxCapacity) {
  CSQueue q = cs.getQueue(r2.toString());
  assertNotNull(q);
  Assert.assertEquals(expectedCapacity, q.getCapacity(), 0.01);
  Assert.assertEquals(expectedMaxCapacity, q.getMaximumCapacity(), 1.0);
}
 
Example 23
Source Project: hadoop   Source File: InMemoryPlan.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ReservationAllocation getReservationById(ReservationId reservationID) {
  if (reservationID == null) {
    return null;
  }
  readLock.lock();
  try {
    return reservationTable.get(reservationID);
  } finally {
    readLock.unlock();
  }
}
 
Example 24
Source Project: big-c   Source File: InMemoryPlan.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ReservationAllocation getReservationById(ReservationId reservationID) {
  if (reservationID == null) {
    return null;
  }
  readLock.lock();
  try {
    return reservationTable.get(reservationID);
  } finally {
    readLock.unlock();
  }
}
 
Example 25
Source Project: big-c   Source File: TestInMemoryPlan.java    License: Apache License 2.0 5 votes vote down vote up
private void doAssertions(Plan plan, ReservationAllocation rAllocation) {
  ReservationId reservationID = rAllocation.getReservationId();
  Assert.assertNotNull(plan.getReservationById(reservationID));
  Assert.assertEquals(rAllocation, plan.getReservationById(reservationID));
  Assert.assertTrue(((InMemoryPlan) plan).getAllReservations().size() == 1);
  Assert.assertEquals(rAllocation.getEndTime(), plan.getLastEndTime());
  Assert.assertEquals(totalCapacity, plan.getTotalCapacity());
  Assert.assertEquals(minAlloc, plan.getMinimumAllocation());
  Assert.assertEquals(maxAlloc, plan.getMaximumAllocation());
  Assert.assertEquals(resCalc, plan.getResourceCalculator());
  Assert.assertEquals(planName, plan.getQueueName());
  Assert.assertTrue(plan.getMoveOnExpiry());
}
 
Example 26
Source Project: big-c   Source File: ReservationSubmissionResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setReservationId(ReservationId reservationId) {
  maybeInitBuilder();
  if (reservationId == null) {
    builder.clearReservationId();
    return;
  }
  this.reservationId = reservationId;
}
 
Example 27
Source Project: big-c   Source File: ReservationDeleteRequest.java    License: Apache License 2.0 5 votes vote down vote up
@Public
@Unstable
public static ReservationDeleteRequest newInstance(ReservationId reservationId) {
  ReservationDeleteRequest request =
      Records.newRecord(ReservationDeleteRequest.class);
  request.setReservationId(reservationId);
  return request;
}
 
Example 28
Source Project: hadoop   Source File: AbstractReservationSystem.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String getQueueForReservation(ReservationId reservationId) {
  readLock.lock();
  try {
    return resQMap.get(reservationId);
  } finally {
    readLock.unlock();
  }
}
 
Example 29
Source Project: hadoop   Source File: AbstractReservationSystem.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ReservationId getNewReservationId() {
  writeLock.lock();
  try {
    ReservationId resId =
        ReservationId.newInstance(ResourceManager.getClusterTimeStamp(),
            resCounter.incrementAndGet());
    LOG.info("Allocated new reservationId: " + resId);
    return resId;
  } finally {
    writeLock.unlock();
  }
}
 
Example 30
Source Project: hadoop   Source File: ClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ReservationUpdateResponse updateReservation(
    ReservationUpdateRequest request) throws YarnException, IOException {
  // Check if reservation system is enabled
  checkReservationSytem(AuditConstants.UPDATE_RESERVATION_REQUEST);
  ReservationUpdateResponse response =
      recordFactory.newRecordInstance(ReservationUpdateResponse.class);
  // Validate the input
  Plan plan =
      rValidator.validateReservationUpdateRequest(reservationSystem, request);
  ReservationId reservationId = request.getReservationId();
  String queueName = reservationSystem.getQueueForReservation(reservationId);
  // Check ACLs
  String user =
      checkReservationACLs(queueName,
          AuditConstants.UPDATE_RESERVATION_REQUEST);
  // Try to update the reservation using default agent
  try {
    boolean result =
        plan.getReservationAgent().updateReservation(reservationId, user,
            plan, request.getReservationDefinition());
    if (!result) {
      String errMsg = "Unable to update reservation: " + reservationId;
      RMAuditLogger.logFailure(user,
          AuditConstants.UPDATE_RESERVATION_REQUEST, errMsg,
          "ClientRMService", errMsg);
      throw RPCUtil.getRemoteException(errMsg);
    }
  } catch (PlanningException e) {
    RMAuditLogger.logFailure(user, AuditConstants.UPDATE_RESERVATION_REQUEST,
        e.getMessage(), "ClientRMService",
        "Unable to update the reservation: " + reservationId);
    throw RPCUtil.getRemoteException(e);
  }
  RMAuditLogger.logSuccess(user, AuditConstants.UPDATE_RESERVATION_REQUEST,
      "ClientRMService: " + reservationId);
  return response;
}