EdColeman commented on a change in pull request #2569:
URL: https://github.com/apache/accumulo/pull/2569#discussion_r829840339



##########
File path: 
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/PrepBulkImport.java
##########
@@ -183,8 +183,15 @@ private void checkForMerge(final long tid, final Manager 
manager) throws Excepti
     VolumeManager fs = manager.getVolumeManager();
     final Path bulkDir = new Path(bulkInfo.sourceDir);
 
-    int maxTablets = 
Integer.parseInt(manager.getContext().getTableConfiguration(bulkInfo.tableId)
-        .get(Property.TABLE_BULK_MAX_TABLETS));
+    String value = manager.getContext().getTableConfiguration(bulkInfo.tableId)
+        .get(Property.TABLE_BULK_MAX_TABLETS);
+    if (value == null) {
+      value = Property.TABLE_BULK_MAX_TABLETS.getDefaultValue();
+      log.info("Property not found " + Property.TABLE_BULK_MAX_TABLETS + " 
using default: " + value
+          + " for tableId: " + bulkInfo.tableId + " using default: " + value);
+    }
+
+    int maxTablets = Integer.parseInt(value);

Review comment:
       With the original code unchanged the maven build / verify fails with the 
following:
   
   ```
   [ERROR] Medium: Possible null pointer dereference in 
org.apache.accumulo.manager.tableOps.bulkVer2.PrepBulkImport.checkForMerge(long,
 Manager) due to return value of called method 
[org.apache.accumulo.manager.tableOps.bulkVer2.PrepBulkImport, 
org.apache.accumulo.manager.tableOps.bulkVer2.PrepBulkImport] Method invoked at 
PrepBulkImport.java:[line 186]Known null at PrepBulkImport.java:[line 187] 
NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
   ```
   
   Wrapping value in requireNonNull fails with the same message.
   
   ```
     requireNonNull(value,"The property: " + 
Property.TABLE_BULK_MAX_TABLETS.getKey()
             + " was not found for tableId: " + bulkInfo.tableId);
   ```
   




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