errose28 commented on code in PR #6297:
URL: https://github.com/apache/ozone/pull/6297#discussion_r1508010332


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/DNRPCLoadGenerator.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.freon;
+
+import com.codahale.metrics.Timer;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
+import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
+import org.apache.commons.lang3.RandomUtils;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
+import org.apache.hadoop.hdds.scm.XceiverClientFactory;
+import org.apache.hadoop.hdds.scm.XceiverClientManager;
+import org.apache.hadoop.hdds.scm.XceiverClientSpi;
+import org.apache.hadoop.hdds.scm.cli.ContainerOperationClient;
+import org.apache.hadoop.hdds.scm.client.ScmClient;
+import org.apache.hadoop.hdds.scm.container.ContainerInfo;
+import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
+import org.apache.hadoop.hdds.scm.storage.ContainerProtocolCalls;
+import org.apache.ratis.thirdparty.com.google.protobuf.UnsafeByteOperations;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Option;
+
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/**
+ * Utility to generate RPC request to DN.
+ */
+@Command(name = "dn-echo",
+        aliases = "dne",
+        description =
+                "Generate echo RPC request to DataNode",
+        versionProvider = HddsVersionProvider.class,
+        mixinStandardHelpOptions = true,
+        showDefaultValues = true)
+public class DNRPCLoadGenerator extends BaseFreonGenerator
+        implements Callable<Void> {
+
+  private static final int RPC_PAYLOAD_MULTIPLICATION_FACTOR = 1024;
+  private static final int MAX_SIZE_KB = 2097151;
+  private Timer timer;
+  private OzoneConfiguration configuration;
+  //private OzoneManagerProtocolClientSideTranslatorPB[] clients;
+  private ScmClient scmClient;
+  private ByteString payloadReqBytes;
+  private int payloadRespSize;
+  private Pipeline pipeline;
+  private ContainerInfo containerInfo;
+  private XceiverClientSpi client;
+  private XceiverClientFactory xceiverClientManager;
+  private ByteString payloadReq;
+  @Option(names = {"--payload-req"},
+          description =
+                  "Specifies the size of payload in KB in RPC request. " +
+                          "Max size is 2097151 KB",
+          defaultValue = "0")
+  private int payloadReqSizeKB = 0;
+
+  @Option(names = {"--clients"},
+      description =
+          "Number of clients, defaults 1.",
+      defaultValue = "1")
+  private int clientsCount = 1;
+
+  @Option(names = {"--payload-resp"},
+          description =
+                  "Specifies the size of payload in KB in RPC response. " +
+                          "Max size is 2097151 KB",
+          defaultValue = "0")
+  private int payloadRespSizeKB = 0;
+
+  @Option(names = {"--ratis"},
+      description = "Write to Ratis log, skip flag for read-only EchoRPC " +
+          "request")
+  private boolean writeToRatis = false;
+  @Option(names = {"--containerID"},

Review Comment:
   nit. Let's keep all flags kebab case for consistency.



-- 
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]

Reply via email to