ivandika3 commented on code in PR #9696:
URL: https://github.com/apache/ozone/pull/9696#discussion_r3055084059
##########
hadoop-ozone/freon/src/main/java/org/apache/hadoop/ozone/freon/OmMetadataGenerator.java:
##########
@@ -134,15 +143,28 @@ public class OmMetadataGenerator extends
BaseFreonGenerator
)
private String omServiceID;
+ @Option(
+ names = "--clients",
+ description = "The number of Ozone clients used. If zero or less, " +
+ "will fallback to 1",
Review Comment:
Thanks, updated.
##########
hadoop-ozone/freon/src/main/java/org/apache/hadoop/ozone/freon/OmMetadataGenerator.java:
##########
@@ -464,4 +527,47 @@ enum Operation {
INFO_VOLUME,
MIXED,
}
+
+ private List<String> getOMFollowerNodeIds(OzoneClient ozoneClient) throws
IOException {
+ List<OMRoleInfo> omRoleInfos = ozoneClient.getProxy().getOmRoleInfos();
+ String leaderOMNodeId = null;
+ List<String> followerOMNodeIds = new ArrayList<>();
+ for (OMRoleInfo omRoleInfo : omRoleInfos) {
+ if (omRoleInfo.getServerRole().equals("LEADER")) {
+ if (leaderOMNodeId != null) {
+ // This situation should be rare
+ throw new IllegalStateException("There are more than one leader
detected, please retry again");
+ }
+ leaderOMNodeId = omRoleInfo.getNodeId();
+ } else if (omRoleInfo.getServerRole().equals("FOLLOWER")) {
+ followerOMNodeIds.add(omRoleInfo.getNodeId());
+ }
+ }
+ if (followerOMNodeIds.isEmpty()) {
+ throw new IllegalArgumentException("There is no follower in the OM
service, please retry again");
+ }
+ return followerOMNodeIds;
+ }
+
+ private void changeInitialProxyForFollowerRead(OzoneClient ozoneClient,
String omNodeId) {
+ OzoneManagerProtocolClientSideTranslatorPB ozoneManagerClient =
+ (OzoneManagerProtocolClientSideTranslatorPB)
+ ozoneClient.getProxy().getOzoneManagerClient();
+
+ OmTransport transport = ozoneManagerClient.getTransport();
+
+ if (transport instanceof Hadoop3OmTransport) {
+ Hadoop3OmTransport hadoop3OmTransport =
+ (Hadoop3OmTransport) ozoneManagerClient.getTransport();
Review Comment:
Thanks, updated.
--
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]