Search in sources :

Example 1 with PrepareRequest

use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PrepareRequest in project ozone by apache.

the class OzoneManagerProtocolClientSideTranslatorPB method prepareOzoneManager.

@Override
public long prepareOzoneManager(long txnApplyWaitTimeoutSeconds, long txnApplyCheckIntervalSeconds) throws IOException {
    Preconditions.checkArgument(txnApplyWaitTimeoutSeconds > 0, "txnApplyWaitTimeoutSeconds has to be > zero");
    Preconditions.checkArgument(txnApplyCheckIntervalSeconds > 0 && txnApplyCheckIntervalSeconds < txnApplyWaitTimeoutSeconds / 2, "txnApplyCheckIntervalSeconds has to be > zero and < half " + "of txnApplyWaitTimeoutSeconds to make sense.");
    PrepareRequest prepareRequest = PrepareRequest.newBuilder().setArgs(PrepareRequestArgs.newBuilder().setTxnApplyWaitTimeoutSeconds(txnApplyWaitTimeoutSeconds).setTxnApplyCheckIntervalSeconds(txnApplyCheckIntervalSeconds).build()).build();
    OMRequest omRequest = createOMRequest(Type.Prepare).setPrepareRequest(prepareRequest).build();
    PrepareResponse prepareResponse = handleError(submitRequest(omRequest)).getPrepareResponse();
    return prepareResponse.getTxnID();
}
Also used : OMRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest) CancelPrepareResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelPrepareResponse) PrepareResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PrepareResponse) CancelPrepareRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelPrepareRequest) PrepareRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PrepareRequest)

Aggregations

CancelPrepareRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelPrepareRequest)1 CancelPrepareResponse (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelPrepareResponse)1 OMRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest)1 PrepareRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PrepareRequest)1 PrepareResponse (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PrepareResponse)1