use of org.apache.hadoop.hdds.protocol.proto.HddsProtos.UpgradeFinalizationStatus in project ozone by apache.
the class StorageContainerLocationProtocolClientSideTranslatorPB method finalizeScmUpgrade.
@Override
public StatusAndMessages finalizeScmUpgrade(String upgradeClientID) throws IOException {
FinalizeScmUpgradeRequestProto req = FinalizeScmUpgradeRequestProto.newBuilder().setUpgradeClientId(upgradeClientID).build();
FinalizeScmUpgradeResponseProto response = submitRequest(Type.FinalizeScmUpgrade, builder -> builder.setFinalizeScmUpgradeRequest(req)).getFinalizeScmUpgradeResponse();
UpgradeFinalizationStatus status = response.getStatus();
return new StatusAndMessages(UpgradeFinalizer.Status.valueOf(status.getStatus().name()), status.getMessagesList());
}
use of org.apache.hadoop.hdds.protocol.proto.HddsProtos.UpgradeFinalizationStatus in project ozone by apache.
the class StorageContainerLocationProtocolClientSideTranslatorPB method queryUpgradeFinalizationProgress.
@Override
public StatusAndMessages queryUpgradeFinalizationProgress(String upgradeClientID, boolean force, boolean readonly) throws IOException {
QueryUpgradeFinalizationProgressRequestProto req = QueryUpgradeFinalizationProgressRequestProto.newBuilder().setUpgradeClientId(upgradeClientID).setTakeover(force).setReadonly(readonly).build();
QueryUpgradeFinalizationProgressResponseProto response = submitRequest(Type.QueryUpgradeFinalizationProgress, builder -> builder.setQueryUpgradeFinalizationProgressRequest(req)).getQueryUpgradeFinalizationProgressResponse();
UpgradeFinalizationStatus status = response.getStatus();
return new StatusAndMessages(UpgradeFinalizer.Status.valueOf(status.getStatus().name()), status.getMessagesList());
}
use of org.apache.hadoop.hdds.protocol.proto.HddsProtos.UpgradeFinalizationStatus in project ozone by apache.
the class StorageContainerLocationProtocolServerSideTranslatorPB method getFinalizeScmUpgrade.
public FinalizeScmUpgradeResponseProto getFinalizeScmUpgrade(FinalizeScmUpgradeRequestProto request) throws IOException {
StatusAndMessages progress = impl.finalizeScmUpgrade(request.getUpgradeClientId());
UpgradeFinalizationStatus.Status protoStatus = UpgradeFinalizationStatus.Status.valueOf(progress.status().name());
UpgradeFinalizationStatus response = UpgradeFinalizationStatus.newBuilder().setStatus(protoStatus).addAllMessages(progress.msgs()).build();
return FinalizeScmUpgradeResponseProto.newBuilder().setStatus(response).build();
}
use of org.apache.hadoop.hdds.protocol.proto.HddsProtos.UpgradeFinalizationStatus in project ozone by apache.
the class OzoneManagerProtocolClientSideTranslatorPB method queryUpgradeFinalizationProgress.
@Override
public StatusAndMessages queryUpgradeFinalizationProgress(String upgradeClientID, boolean takeover, boolean readonly) throws IOException {
FinalizeUpgradeProgressRequest req = FinalizeUpgradeProgressRequest.newBuilder().setUpgradeClientId(upgradeClientID).setTakeover(takeover).setReadonly(readonly).build();
OMRequest omRequest = createOMRequest(Type.FinalizeUpgradeProgress).setFinalizeUpgradeProgressRequest(req).build();
FinalizeUpgradeProgressResponse response = handleError(submitRequest(omRequest)).getFinalizeUpgradeProgressResponse();
UpgradeFinalizationStatus status = response.getStatus();
return new StatusAndMessages(UpgradeFinalizer.Status.valueOf(status.getStatus().name()), status.getMessagesList());
}
use of org.apache.hadoop.hdds.protocol.proto.HddsProtos.UpgradeFinalizationStatus in project ozone by apache.
the class OzoneManagerRequestHandler method reportUpgradeProgress.
private FinalizeUpgradeProgressResponse reportUpgradeProgress(FinalizeUpgradeProgressRequest request) throws IOException {
String upgradeClientId = request.getUpgradeClientId();
boolean takeover = request.getTakeover();
boolean readonly = request.getReadonly();
StatusAndMessages progress = impl.queryUpgradeFinalizationProgress(upgradeClientId, takeover, readonly);
UpgradeFinalizationStatus.Status protoStatus = UpgradeFinalizationStatus.Status.valueOf(progress.status().name());
UpgradeFinalizationStatus response = UpgradeFinalizationStatus.newBuilder().setStatus(protoStatus).addAllMessages(progress.msgs()).build();
return FinalizeUpgradeProgressResponse.newBuilder().setStatus(response).build();
}
Aggregations