You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/01/06 08:45:56 UTC

[GitHub] [hbase] virajjasani commented on a change in pull request #990: HBASE-23646 Resolved remaining Checkstyle violations in tests of hbase-rest

virajjasani commented on a change in pull request #990: HBASE-23646 Resolved remaining Checkstyle violations in tests of hbase-rest
URL: https://github.com/apache/hbase/pull/990#discussion_r363201177
 
 

 ##########
 File path: hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
 ##########
 @@ -708,33 +709,26 @@ private Path writeInputFile(final Configuration c) throws IOException {
     FileSystem fs = FileSystem.get(c);
     fs.mkdirs(inputDir);
     Path inputFile = new Path(inputDir, "input.txt");
-    PrintStream out = new PrintStream(fs.create(inputFile));
     // Make input random.
-    Map<Integer, String> m = new TreeMap<>();
-    Hash h = MurmurHash.getInstance();
-    int perClientRows = (this.R / this.N);
-    try {
+    try (PrintStream out = new PrintStream(fs.create(inputFile))) {
+      Map<Integer, String> m = new TreeMap<>();
+      Hash h = MurmurHash.getInstance();
+      int perClientRows = (this.R / this.N);
       for (int i = 0; i < 10; i++) {
         for (int j = 0; j < N; j++) {
-          String s = "tableName=" + this.tableName +
-              ", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
-              ", perClientRunRows=" + (perClientRows / 10) +
-              ", totalRows=" + this.R +
-              ", clients=" + this.N +
-              ", flushCommits=" + this.flushCommits +
-              ", writeToWAL=" + this.writeToWAL +
-              ", useTags=" + this.useTags +
-              ", noOfTags=" + this.noOfTags;
+          String s = "tableName=" + this.tableName + ", startRow=" + ((j * perClientRows) + (i * (
+            perClientRows / 10))) + ", perClientRunRows=" + (perClientRows / 10) + ", totalRows="
+            + this.R + ", clients=" + this.N + ", flushCommits=" + this.flushCommits
+            + ", writeToWAL=" + this.writeToWAL + ", useTags=" + this.useTags + ", noOfTags="
+            + this.noOfTags;
 
 Review comment:
   Good to use StringBuilder may be?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services