ndimiduk commented on code in PR #4645:
URL: https://github.com/apache/hbase/pull/4645#discussion_r944451901


##########
hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java:
##########
@@ -519,6 +519,7 @@ protected OffheapDecodedExtendedCell(ByteBuffer keyBuffer, 
short rowLength, int
     }
 
     @Override
+    @SuppressWarnings("ByteBufferBackingArray")

Review Comment:
   I agree with ErrorProne that this use of a `ByteBuffer` is problematic. 
We're leaving it to the caller to perform bounds checking but they don't have 
the underlying `keyBuffer`.
   
   Keep the warnings so that we don't lose track of this issue?



##########
hbase-common/src/main/java/org/apache/hadoop/hbase/types/CopyOnWriteArrayMap.java:
##########
@@ -38,6 +38,7 @@
  */
 @InterfaceAudience.Private
 @InterfaceStability.Stable
+@SuppressWarnings({ "unchecked", "rawtypes", "hiding", 
"TypeParameterShadowing" })

Review Comment:
   Yikes!



##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java:
##########
@@ -167,11 +170,10 @@ public long getOpenFileDescriptorCount() {
       // need to get the PID number of the process first
       RuntimeMXBean rtmbean = ManagementFactory.getRuntimeMXBean();
       String rtname = rtmbean.getName();
-      String[] pidhost = rtname.split("@");
-
+      Iterator<String> pidhost = Splitter.on('@').split(rtname).iterator();
       // using linux bash commands to retrieve info
       Process p = Runtime.getRuntime()
-        .exec(new String[] { "bash", "-c", "ls /proc/" + pidhost[0] + "/fdinfo 
| wc -l" });
+        .exec(new String[] { "bash", "-c", "ls /proc/" + pidhost.next() + 
"/fdinfo | wc -l" });

Review Comment:
   Should we be looking under `/proc/self` instead of parsing the pid?



##########
hbase-common/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockType.java:
##########
@@ -31,6 +31,7 @@
  * The values in the enum appear in the order they appear in a version 2 HFile.
  */
 @InterfaceAudience.Private
+@SuppressWarnings("ImmutableEnumChecker")

Review Comment:
   Does the warning specify the point of mutability? A quick scan here and I 
don't see any state mutations.



##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java:
##########
@@ -58,6 +58,7 @@
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
     value = "EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS",
     justification = "It has been like this forever")
+@SuppressWarnings("MixedMutabilityReturnType")

Review Comment:
   > This method returns both mutable and immutable collections or maps from 
different paths. This may be confusing for users of the method.
   
   Yeah, that's a fair description.



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

Reply via email to