AllocateResponse ApplicationMasterProtocol::allocate(AllocateRequest &request) {
    try {
        AllocateRequestProto requestProto = request.getProto();
        AllocateResponseProto responseProto;
        invoke(RpcCall(true, "allocate", &requestProto, &responseProto));
        return AllocateResponse(responseProto);
    } catch (const YarnRpcServerException & e) {
        UnWrapper<ApplicationMasterNotRegisteredException, YarnIOException> unwrapper(e);
        unwrapper.unwrap(__FILE__, __LINE__);
    }
}
GetContainerStatusesResponse ContainerManagementProtocol::getContainerStatuses(GetContainerStatusesRequest &request){
	try {
		GetContainerStatusesRequestProto requestProto = request.getProto();
		GetContainerStatusesResponseProto responseProto;
		invoke(RpcCall(true, "getContainerStatuses", &requestProto, &responseProto));
		return GetContainerStatusesResponse(responseProto);
	} catch (const YarnRpcServerException & e) {
		UnWrapper<UnresolvedLinkException, YarnIOException> unwrapper(e);
		unwrapper.unwrap(__FILE__, __LINE__);
	} catch (...) {
		THROW(YarnIOException,
			  "Unexpected exception: when calling "
			  "ContainerManagementProtocol::getContainerStatuses in %s: %d",
			  __FILE__, __LINE__);
	}
}
void ApplicationClientProtocol::submitApplication(
		SubmitApplicationRequest &request) {
	try {
		SubmitApplicationResponseProto responseProto;
		SubmitApplicationRequestProto requestProto = request.getProto();
		invoke(RpcCall(true, "submitApplication", &requestProto, &responseProto));
	} catch (const YarnRpcServerException & e) {
		UnWrapper<UnresolvedLinkException, YarnIOException> unwrapper(e);
		unwrapper.unwrap(__FILE__, __LINE__);
	} catch (...) {
		THROW(YarnIOException,
			  "Unexpected exception: when calling "
			  "ApplicationClientProtocol::submitApplication in %s: %d",
			  __FILE__, __LINE__);
	}
}
/*
 rpc getQueueInfo (GetQueueInfoRequestProto) returns (GetQueueInfoResponseProto);

 message GetQueueInfoRequestProto {
 optional string queueName = 1;
 optional bool includeApplications = 2;
 optional bool includeChildQueues = 3;
 optional bool recursive = 4;
 }

 message GetQueueInfoResponseProto {
 optional QueueInfoProto queueInfo = 1;
 }

 message QueueInfoProto {
 optional string queueName = 1;
 optional float capacity = 2;
 optional float maximumCapacity = 3;
 optional float currentCapacity = 4;
 optional QueueStateProto state = 5;
 repeated QueueInfoProto childQueues = 6;
 repeated ApplicationReportProto applications = 7;
 }
 */
GetQueueInfoResponse ApplicationClientProtocol::getQueueInfo(
		GetQueueInfoRequest &request) {
	try {
		GetQueueInfoResponseProto responseProto;
		GetQueueInfoRequestProto requestProto = request.getProto();
		invoke(RpcCall(true, "getQueueInfo", &requestProto, &responseProto));
		return GetQueueInfoResponse(responseProto);
	} catch (const YarnRpcServerException & e) {
		UnWrapper<UnresolvedLinkException, YarnIOException> unwrapper(e);
		unwrapper.unwrap(__FILE__, __LINE__);
	} catch (...) {
		THROW(YarnIOException,
			  "Unexpected exception: when calling "
			  "ApplicationClientProtocol::getQueueInfo in %s: %d",
			  __FILE__, __LINE__);
	}
}
KillApplicationResponse ApplicationClientProtocol::forceKillApplication(
        KillApplicationRequest &request) {
    try {
        KillApplicationResponseProto responseProto;
        KillApplicationRequestProto requestProto = request.getProto();
        invoke(
                RpcCall(true, "forceKillApplication", &requestProto,
                        &responseProto));
        return KillApplicationResponse(responseProto);
    } catch (const YarnFailoverException & e) {
         throw;
    } catch (const YarnRpcServerException & e) {
        UnWrapper<UnresolvedLinkException, YarnIOException> unwrapper(e);
        unwrapper.unwrap(__FILE__, __LINE__);
    } catch (...) {
        THROW(YarnIOException,
              "Unexpected exception: when calling "
              "ApplicationClientProtocol::forceKillApplication in %s: %d",
              __FILE__, __LINE__);
    }
}