ddanielr commented on code in PR #5341:
URL: https://github.com/apache/accumulo/pull/5341#discussion_r2010669714
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java:
##########
@@ -366,15 +369,35 @@ static long loadFiles(Loader loader, BulkInfo bulkInfo,
Path bulkDir,
ImportTimingStats importTimingStats = new ImportTimingStats();
Timer timer = Timer.startNew();
- try (TabletsMetadata tabletsMetadata =
factory.newTabletsMetadata(startRow)) {
+ KeyExtent prevLastExtent = null; // KeyExtent of last tablet from prior
loadMapEntry
+ TabletsMetadata tabletsMetadata = factory.newTabletsMetadata(startRow);
+ try {
Iterator<TabletMetadata> tabletIter = tabletsMetadata.iterator();
while (lmi.hasNext()) {
loadMapEntry = lmi.next();
+ // If the user set the TABLE_BULK_SKIP_THRESHOLD property, then only
look
+ // at the next skipDistance tablets before recreating the iterator
+ if (skipDistance > 0) {
+ final KeyExtent loadMapKey = loadMapEntry.getKey();
+ if (prevLastExtent != null &&
!loadMapKey.isPreviousExtent(prevLastExtent)) {
+ final KeyExtent search = prevLastExtent;
+ SearchResults results =
+ lmi.advanceTo(e -> e.getKey().isPreviousExtent(search),
skipDistance);
+ if (!results.isMatchFound()) {
+ tabletsMetadata.close();
+ tabletsMetadata =
factory.newTabletsMetadata(loadMapKey.prevEndRow());
+ tabletIter = tabletsMetadata.iterator();
+ }
+ }
+ }
List<TabletMetadata> tablets =
findOverlappingTablets(fmtTid, loadMapEntry.getKey(), tabletIter,
importTimingStats);
loader.load(tablets, loadMapEntry.getValue());
+ prevLastExtent = tablets.get(tablets.size() - 1).getExtent();
}
+ } finally {
Review Comment:
What is the expected behavior of the bulk import job if an exception is
thrown in this new try block?
--
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]