ctubbsii commented on a change in pull request #2569:
URL: https://github.com/apache/accumulo/pull/2569#discussion_r829606855
##########
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:
Do you mean spotbugs? We don't use findbugs anymore. I don't see it
failing in our current main branch. Your changes to configuration shouldn't
have affected whether null was possible to be returned here or not. I actually
don't think it's actually possible for it to return null in this case. It has a
default value that would be returned if it were null. Wrapping it with
requiresNonNull would probably suffice to explicitly throw NPE and not trigger
spotbugs, though.
--
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]