szetszwo commented on code in PR #6167:
URL: https://github.com/apache/ozone/pull/6167#discussion_r1480391973


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/ClientConfigBuilder.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * 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;
+
+import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
+import org.apache.hadoop.hdds.conf.StorageUnit;
+import org.apache.hadoop.hdds.scm.OzoneClientConfig;
+
+import java.util.OptionalInt;
+import java.util.OptionalLong;
+
+import static 
org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_CHUNK_SIZE_KEY;
+import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE;
+
+/**
+ * Helper for tests that want to set client stream properties.
+ */
+public final class ClientConfigBuilder {

Review Comment:
   Since this is for testing only, how about calling git 
`ClientConfigForTesting`?



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/ClientConfigBuilder.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * 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;
+
+import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
+import org.apache.hadoop.hdds.conf.StorageUnit;
+import org.apache.hadoop.hdds.scm.OzoneClientConfig;
+
+import java.util.OptionalInt;
+import java.util.OptionalLong;
+
+import static 
org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_CHUNK_SIZE_KEY;
+import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE;
+
+/**
+ * Helper for tests that want to set client stream properties.
+ */
+public final class ClientConfigBuilder {
+
+  private int chunkSize = 1024 * 1024;
+  private OptionalLong blockSize = OptionalLong.empty();
+  private OptionalInt streamBufferSize = OptionalInt.empty();
+  private OptionalLong streamBufferFlushSize = OptionalLong.empty();
+  private OptionalLong dataStreamBufferFlushSize = OptionalLong.empty();
+  private OptionalLong dataStreamWindowSize = OptionalLong.empty();
+  private OptionalLong streamBufferMaxSize = OptionalLong.empty();
+  private OptionalInt dataStreamMinPacketSize = OptionalInt.empty();

Review Comment:
   Let's also change the fields to not to use `Optional`.  In general, it is 
not a good practice to use `Optional` as a field.  See [this 
comment](https://stackoverflow.com/questions/26327957/should-java-8-getters-return-optional-type/26328555)
 by Brian Goetz (the main author of Java Concurrency in Practice).
   >  You should almost never use it as a field of something or a method 
parameter.
   



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