diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java index f9749ab4346..fc993bbe648 100644 --- a/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java +++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java @@ -266,11 +266,9 @@ public MLong(long i) { } public static Map estimateSizes(AccumuloConfiguration acuConf, Path mapFile, - FileStatus status, Collection extents, FileSystem ns, + long fileSize, FileStatus status, Collection extents, FileSystem ns, Cache fileLenCache, CryptoService cs) throws IOException { - final long fileSize = status.getLen(); - if (extents.size() == 1) { return Collections.singletonMap(extents.iterator().next(), fileSize); } @@ -584,7 +582,7 @@ public SortedMap computeFileToTabletMappings(FileSystem fs // make sure file isn't going to too many tablets checkTabletCount(maxTablets, extents.size(), filePath.toString()); Map estSizes = estimateSizes(context.getConfiguration(), filePath, - fileStatus, extents, fs, fileLensCache, cs); + fileStatus.getLen(), fileStatus, extents, fs, fileLensCache, cs); Map pathLocations = new HashMap<>(); for (KeyExtent ke : extents) { pathLocations.put(ke, new Bulk.FileInfo(filePath, estSizes.getOrDefault(ke, 0L))); diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java index d1c186b8562..f2feb7156ce 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java +++ b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java @@ -404,9 +404,9 @@ private Map> estimateSizes(final VolumeManager vm, Path mapFile = entry.getKey(); FileSystem ns = context.getVolumeManager().getFileSystemByPath(mapFile); - estimatedSizes = - BulkImport.estimateSizes(context.getConfiguration(), mapFile, statuses.get(mapFile), - extentsOf(entry.getValue()), ns, null, tableConf.getCryptoService()); + estimatedSizes = BulkImport.estimateSizes(context.getConfiguration(), mapFile, + mapFileSizes.get(mapFile), statuses.get(mapFile), extentsOf(entry.getValue()), ns, + null, tableConf.getCryptoService()); } catch (IOException e) { log.warn("Failed to estimate map file sizes {}", e.getMessage()); } diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java index ae67f35d486..91caa7b7b6c 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java @@ -19,6 +19,7 @@ package org.apache.accumulo.test.functional; import static org.apache.accumulo.harness.AccumuloITBase.SUNNY_DAY; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.io.IOException; import java.time.Duration; @@ -99,6 +100,8 @@ static void runTest(AccumuloClient c, FileSystem fs, Path basePath, String table TestIngest.ingest(c, fs, params); bulkLoad(c, tableName, bulkFailures, files, useOld); + assertFalse(fs.listFiles(bulkFailures, false).hasNext()); + VerifyParams verifyParams = new VerifyParams(c.properties(), tableName, N); verifyParams.random = 56; for (int i = 0; i < COUNT; i++) {