public FetchedSegments(Configuration conf,
Path segmentsDir) throws IOException {
this.conf = conf;
this.fs = FileSystem.get(this.conf);
final FileStatus[] fstats = fs.listStatus(segmentsDir,
HadoopFSUtil.getPassDirectoriesFilter(fs));
final Path[] segmentDirs = HadoopFSUtil.getPaths(fstats);
this.summarizer = new SummarizerFactory(this.conf).getSummarizer();
this.segmentsDir = segmentsDir;
this.segUpdater = new SegmentUpdater();
if (segmentDirs != null) {
for (final Path segmentDir : segmentDirs) {
segments.put(segmentDir.getName(),
new Segment(this.fs, segmentDir, this.conf));
}
}
this.segUpdater.start();
}
Construct given a directory containing fetcher output. |