Java Code Examples for org.apache.accumulo.core.client.IteratorSetting#Column

The following examples show how to use org.apache.accumulo.core.client.IteratorSetting#Column . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableToFile.java    From accumulo-examples with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
  Opts opts = new Opts();
  opts.parseArgs(TableToFile.class.getName(), args);

  List<IteratorSetting.Column> columnsToFetch = new ArrayList<>();
  for (String col : opts.columns.split(",")) {
    int idx = col.indexOf(":");
    String cf = idx < 0 ? col : col.substring(0, idx);
    String cq = idx < 0 ? null : col.substring(idx + 1);
    if (!cf.isEmpty())
      columnsToFetch.add(new IteratorSetting.Column(cf, cq));
  }

  Job job = Job.getInstance(opts.getHadoopConfig());
  job.setJobName(TableToFile.class.getSimpleName() + "_" + System.currentTimeMillis());
  job.setJarByClass(TableToFile.class);
  job.setInputFormatClass(AccumuloInputFormat.class);
  InputFormatBuilder.InputFormatOptions<Job> inputOpts = AccumuloInputFormat.configure()
      .clientProperties(opts.getClientProperties()).table(opts.tableName);
  if (!columnsToFetch.isEmpty()) {
    inputOpts.fetchColumns(columnsToFetch);
  }
  inputOpts.store(job);
  job.setMapperClass(TTFMapper.class);
  job.setMapOutputKeyClass(NullWritable.class);
  job.setMapOutputValueClass(Text.class);
  job.setNumReduceTasks(0);
  job.setOutputFormatClass(TextOutputFormat.class);
  TextOutputFormat.setOutputPath(job, new Path(opts.output));

  System.exit(job.waitForCompletion(true) ? 0 : 1);
}
 
Example 2
Source File: MetricFeatureConfig.java    From accumulo-recipes with Apache License 2.0 5 votes vote down vote up
@Override
public List<IteratorSetting> buildIterators(int priority) {
    List<IteratorSetting.Column> columns = new ArrayList<IteratorSetting.Column>();
    for (TimeUnit timeUnit : TimeUnit.values())
        columns.add(new IteratorSetting.Column(combine(timeUnit.toString(), featureName())));

    IteratorSetting setting = new IteratorSetting(priority, "stats", StatsCombiner.class);
    StatsCombiner.setColumns(setting, columns);

    return Collections.singletonList(setting);
}
 
Example 3
Source File: CombinerConfiguration.java    From datawave with Apache License 2.0 4 votes vote down vote up
public CombinerConfiguration(Set<IteratorSetting.Column> columns, IteratorSetting setting) {
    this.columns = columns;
    this.setting = setting;
}
 
Example 4
Source File: CombinerConfiguration.java    From datawave with Apache License 2.0 4 votes vote down vote up
public Collection<IteratorSetting.Column> getColumns() {
    return columns;
}
 
Example 5
Source File: RebuildingScannerTestHelper.java    From datawave with Apache License 2.0 4 votes vote down vote up
@Override
public void fetchColumn(IteratorSetting.Column column) {
    delegate.fetchColumn(column);
}
 
Example 6
Source File: CombinerConfiguration.java    From datawave with Apache License 2.0 2 votes vote down vote up
public CombinerConfiguration(IteratorSetting.Column column, IteratorSetting setting) {
    
    this(Sets.newHashSet(column), setting);
}