ivandika3 commented on code in PR #9796: URL: https://github.com/apache/ozone/pull/9796#discussion_r2844371816
########## hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/ReadConsistency.java: ########## @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.ozone.om.helpers; + +import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ReadConsistencyType; + +/** + * Supported read consistency. It consists of two elements + * <ol> + * <li> + * {@link ConsistencyType} which specifies different types of read consistency + * (e.g. LINEARIZABLE, LOCAL_LEASE) + * </li> + * <li> + * Whether to allow follower read. Some consistency types supports + * follower read (e.g. LINEARIZABLE) while other consistency types only + * supports leader read (e.g. NON_LINEARIZABLE). + * </li> + * </ol> + * + * handles different types of read consistency (e.g. LINEARIZABLE, LOCAL_LEASE) + */ +public enum ReadConsistency { + DEFAULT(ConsistencyType.NON_LINEARIZABLE, false), + STALE(ConsistencyType.STALE, true), + LINEARIZABLE_LEADER_READ(ConsistencyType.LINEARIZABLE, false), + LINEARIZABLE_FOLLOWER_READ(ConsistencyType.LINEARIZABLE, true), + LOCAL_LEASE_FOLLOWER_READ(ConsistencyType.LOCAL_LEASE, true); Review Comment: Thanks for the review and the suggestion on streamlining the ReadConsistency. I have changed accordingly and change some namings (e.g. removed "Consistency Type" naming). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
