Skip to content

Commit 5e58306

Browse files
committed
Use READ_CONSISTENCY_UNSPECIFIED
1 parent 29e044c commit 5e58306

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/ReadConsistency.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ReadConsistencyProto toProto() {
6969
case LOCAL_LEASE:
7070
return ReadConsistencyProto.LOCAL_LEASE;
7171
default:
72-
return ReadConsistencyProto.UNSPECIFIED;
72+
return ReadConsistencyProto.READ_CONSISTENCY_UNSPECIFIED;
7373
}
7474
}
7575

hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,7 @@ message DeleteObjectTaggingResponse {
23602360
enum ReadConsistencyProto {
23612361
// Unspecified consistency, the read consistency behavior is decided
23622362
// by the OM
2363-
UNSPECIFIED = 0;
2363+
READ_CONSISTENCY_UNSPECIFIED = 0;
23642364
// Client sends all read requests to OM node that the client believes is the current leader.
23652365
// If the OM node is not a leader, the OM node throws an exception so the client failover to the OM leader.
23662366
// OM leader handles the request immediately without doing leadership check to verify

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ private RaftClientRequest createRaftRequestImpl(OMRequest omRequest, boolean isW
522522

523523
private static RaftClientRequest.Type getRaftReadRequestType(OMRequest omRequest) {
524524
if (!omRequest.hasReadConsistencyHint() || !omRequest.getReadConsistencyHint().hasReadConsistency() ||
525-
omRequest.getReadConsistencyHint().getReadConsistency() == ReadConsistencyProto.UNSPECIFIED) {
525+
omRequest.getReadConsistencyHint().getReadConsistency() == ReadConsistencyProto.READ_CONSISTENCY_UNSPECIFIED) {
526526
// If there is no consistency hint, we simply follow the Raft server read option
527527
return RaftClientRequest.readRequestType();
528528
}

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.apache.hadoop.ozone.om.ratis.OzoneManagerRatisServer.RaftServerStatus.LEADER_AND_READY;
2121
import static org.apache.hadoop.ozone.om.ratis.OzoneManagerRatisServer.RaftServerStatus.NOT_LEADER;
2222
import static org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerRatisUtils.createErrorResponse;
23-
import static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ReadConsistencyProto.UNSPECIFIED;
23+
import static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ReadConsistencyProto.READ_CONSISTENCY_UNSPECIFIED;
2424
import static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Type.PrepareStatus;
2525
import static org.apache.hadoop.ozone.util.MetricUtil.captureLatencyNs;
2626

@@ -230,7 +230,7 @@ private OMResponse submitReadRequestToOM(OMRequest request)
230230
}
231231

232232
if (!request.hasReadConsistencyHint() || !request.getReadConsistencyHint().hasReadConsistency() ||
233-
request.getReadConsistencyHint().getReadConsistency() == UNSPECIFIED) {
233+
request.getReadConsistencyHint().getReadConsistency() == READ_CONSISTENCY_UNSPECIFIED) {
234234
return submitReadRequestToOmWithoutHint(request);
235235
} else {
236236
// If read consistency hint is specified, we should try to respect it although

0 commit comments

Comments
 (0)