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:
[email protected]


With regards,
Apache Git Services

Reply via email to