Search in sources :

Example 1 with SummaryReader

use of org.apache.accumulo.core.summary.SummaryReader in project accumulo by apache.

the class RFileSummariesRetriever method read.

@Override
public Collection<Summary> read() throws IOException {
    SummarizerFactory factory = new SummarizerFactory();
    AccumuloConfiguration acuconf = DefaultConfiguration.getInstance();
    Configuration conf = in.getFileSystem().getConf();
    RFileSource[] sources = in.getSources();
    try {
        SummaryCollection all = new SummaryCollection();
        for (RFileSource source : sources) {
            SummaryReader fileSummary = SummaryReader.load(conf, acuconf, source.getInputStream(), source.getLength(), summarySelector, factory);
            SummaryCollection sc = fileSummary.getSummaries(Collections.singletonList(new Gatherer.RowRange(startRow, endRow)));
            all.merge(sc, factory);
        }
        return all.getSummaries();
    } finally {
        for (RFileSource source : sources) {
            source.getInputStream().close();
        }
    }
}
Also used : SummarizerConfiguration(org.apache.accumulo.core.client.summary.SummarizerConfiguration) DefaultConfiguration(org.apache.accumulo.core.conf.DefaultConfiguration) AccumuloConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration) Configuration(org.apache.hadoop.conf.Configuration) SummaryReader(org.apache.accumulo.core.summary.SummaryReader) SummarizerFactory(org.apache.accumulo.core.summary.SummarizerFactory) SummaryCollection(org.apache.accumulo.core.summary.SummaryCollection) AccumuloConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration)

Aggregations

SummarizerConfiguration (org.apache.accumulo.core.client.summary.SummarizerConfiguration)1 AccumuloConfiguration (org.apache.accumulo.core.conf.AccumuloConfiguration)1 DefaultConfiguration (org.apache.accumulo.core.conf.DefaultConfiguration)1 SummarizerFactory (org.apache.accumulo.core.summary.SummarizerFactory)1 SummaryCollection (org.apache.accumulo.core.summary.SummaryCollection)1 SummaryReader (org.apache.accumulo.core.summary.SummaryReader)1 Configuration (org.apache.hadoop.conf.Configuration)1