Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,9 @@ public MLong(long i) {
}

public static Map<KeyExtent,Long> estimateSizes(AccumuloConfiguration acuConf, Path mapFile,
FileStatus status, Collection<KeyExtent> extents, FileSystem ns,
long fileSize, FileStatus status, Collection<KeyExtent> extents, FileSystem ns,
Comment thread
dlmarion marked this conversation as resolved.
Resolved
Cache<String,Long> fileLenCache, CryptoService cs) throws IOException {

final long fileSize = status.getLen();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the potential NPE when a status was removed from a map on failure.


if (extents.size() == 1) {
return Collections.singletonMap(extents.iterator().next(), fileSize);
}
Expand Down Expand Up @@ -584,7 +582,7 @@ public SortedMap<KeyExtent,Bulk.Files> computeFileToTabletMappings(FileSystem fs
// make sure file isn't going to too many tablets
checkTabletCount(maxTablets, extents.size(), filePath.toString());
Map<KeyExtent,Long> estSizes = estimateSizes(context.getConfiguration(), filePath,
fileStatus, extents, fs, fileLensCache, cs);
fileStatus.getLen(), fileStatus, extents, fs, fileLensCache, cs);
Map<KeyExtent,Bulk.FileInfo> pathLocations = new HashMap<>();
for (KeyExtent ke : extents) {
pathLocations.put(ke, new Bulk.FileInfo(filePath, estSizes.getOrDefault(ke, 0L)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ private Map<Path,List<AssignmentInfo>> 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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++) {
Expand Down
Loading