Skip to content
Closed
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 @@ -51,7 +51,7 @@ public class KafkaIOConfigTest
public KafkaIOConfigTest()
{
mapper = new DefaultObjectMapper();
mapper.registerModules((Iterable<Module>) new KafkaIndexTaskModule().getJacksonModules());
mapper.registerModules(new KafkaIndexTaskModule().getJacksonModules());
}

@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ public static List<DataSegment> getPublishedSegments(HadoopDruidIndexerConfig co

final Path descriptorInfoDir = config.makeDescriptorInfoDir();

try {
FileSystem fs = descriptorInfoDir.getFileSystem(conf);

try (FileSystem fs = descriptorInfoDir.getFileSystem(conf)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @Fokko, would you elaborate more on this change? Seems like Path.getFileSystem() returns a cached instance of a FileSystem and I guess it might be better to leave the cached one rather than removing it from the cache?

for (FileStatus status : fs.listStatus(descriptorInfoDir)) {
final DataSegment segment = jsonMapper.readValue((InputStream) fs.open(status.getPath()), DataSegment.class);
publishedSegmentsBuilder.add(segment);
log.info("Adding segment %s to the list of published segments", segment.getId());
try (InputStream input = fs.open(status.getPath())) {
final DataSegment segment = jsonMapper.readValue(input, DataSegment.class);
publishedSegmentsBuilder.add(segment);
log.info("Adding segment %s to the list of published segments", segment.getId());
}
}
}
catch (FileNotFoundException e) {
Expand All @@ -140,7 +140,7 @@ public static List<DataSegment> getPublishedSegments(HadoopDruidIndexerConfig co
}

private final HadoopDruidIndexerConfig config;
private IndexGeneratorStats jobStats;
private final IndexGeneratorStats jobStats;
private Job job;

public IndexGeneratorJob(
Expand Down