Package org.apache.accumulo.core.conf

Examples of org.apache.accumulo.core.conf.ConfigurationCopy


    }
  }
 
  @Test
  public void test1() throws IOException {
    ConfigurationCopy conf = new ConfigurationCopy();
   
    // create an iterator that adds 1 and then squares
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".addIter", "1," + AddingIter.class.getName());
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".sqIter", "2," + SquaringIter.class.getName());
   
    TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
   
    MultiIteratorTest.nkv(tm, 1, 0, false, "1");
    MultiIteratorTest.nkv(tm, 2, 0, false, "2");
View Full Code Here


 
  @Test
  public void test4() throws IOException {
   
    // try loading for a different scope
    AccumuloConfiguration conf = new ConfigurationCopy();
   
    TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
   
    MultiIteratorTest.nkv(tm, 1, 0, false, "1");
    MultiIteratorTest.nkv(tm, 2, 0, false, "2");
View Full Code Here

 
  @Test
  public void test3() throws IOException {
    // change the load order, so it squares and then adds
   
    ConfigurationCopy conf = new ConfigurationCopy();
   
    TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
   
    MultiIteratorTest.nkv(tm, 1, 0, false, "1");
    MultiIteratorTest.nkv(tm, 2, 0, false, "2");
   
    SortedMapIterator source = new SortedMapIterator(tm);
   
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".addIter", "2," + AddingIter.class.getName());
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".sqIter", "1," + SquaringIter.class.getName());
   
    SortedKeyValueIterator<Key,Value> iter = IteratorUtil.loadIterators(IteratorScope.minc, source, new KeyExtent(new Text("tab"), null, null), conf,
        new DefaultIteratorEnvironment(conf));
    iter.seek(new Range(), EMPTY_COL_FAMS, false);
   
View Full Code Here

  }
 
  @Test
  public void test2() throws IOException {
   
    ConfigurationCopy conf = new ConfigurationCopy();
   
    // create an iterator that adds 1 and then squares
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".addIter", "1," + AddingIter.class.getName());
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".addIter.opt.amount", "7");
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".sqIter", "2," + SquaringIter.class.getName());
   
    TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
   
    MultiIteratorTest.nkv(tm, 1, 0, false, "1");
    MultiIteratorTest.nkv(tm, 2, 0, false, "2");
View Full Code Here

   
  }
 
  @Test
  public void test5() throws IOException {
    ConfigurationCopy conf = new ConfigurationCopy();
   
    // create an iterator that ages off
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".filter", "1," + AgeOffFilter.class.getName());
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".filter.opt.ttl", "100");
    conf.set(Property.TABLE_ITERATOR_PREFIX + IteratorScope.minc.name() + ".filter.opt.currentTime", "1000");
   
    TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
   
    MultiIteratorTest.nkv(tm, 1, 850, false, "1");
    MultiIteratorTest.nkv(tm, 2, 950, false, "2");
View Full Code Here

    data.put(Property.TABLE_ITERATOR_SCAN_PREFIX + "foo", "50," + SummingCombiner.class.getName());
    data.put(Property.TABLE_ITERATOR_SCAN_PREFIX + "foo.opt." + SummingCombiner.ALL_OPTION, "true");
    data.put(Property.TABLE_ITERATOR_PREFIX + ".fakescope.bar", "50," + SummingCombiner.class.getName());
    data.put(Property.TABLE_ITERATOR_SCAN_PREFIX + "foo.opt.fakeopt", "fakevalue");

    AccumuloConfiguration conf = new ConfigurationCopy(data);

    List<IterInfo> iterators = new ArrayList<IterInfo>();
    Map<String,Map<String,String>> options = new HashMap<String,Map<String,String>>();

    IteratorUtil.parseIterConf(IteratorScope.scan, iterators, options, conf);
View Full Code Here

    if (tablesToFlush.isEmpty() && !shellState.getTableName().isEmpty()) {
      tablesToFlush.add(shellState.getTableName());
    }

    try {
      final AccumuloConfiguration acuConf = new ConfigurationCopy(shellState.getConnector().instanceOperations().getSystemConfiguration());
      TableDiskUsage.printDiskUsage(acuConf, tablesToFlush, FileSystem.get(new Configuration()), shellState.getConnector(), new Printer() {
        @Override
        public void print(String line) {
          try {
            shellState.getReader().printString(line + "\n");
View Full Code Here

    }
   
    ArrayList<Integer> vals = new ArrayList<Integer>(valsSet);
    Collections.sort(vals);
   
    ConfigurationCopy acuconf = new ConfigurationCopy(AccumuloConfiguration.getDefaultConfiguration());
    acuconf.set(Property.TABLE_BLOOM_ENABLED, "true");
    acuconf.set(Property.TABLE_BLOOM_KEY_FUNCTOR, "accumulo.core.file.keyfunctor.ColumnFamilyFunctor");
    acuconf.set(Property.TABLE_FILE_TYPE, RFile.EXTENSION);
    acuconf.set(Property.TABLE_BLOOM_LOAD_THRESHOLD, "1");
    acuconf.set(Property.TSERV_BLOOM_LOAD_MAXCONCURRENT, "1");
   
    Configuration conf = CachedConfiguration.getInstance();
    FileSystem fs = FileSystem.get(conf);
   
    String suffix = FileOperations.getNewFileExtension(acuconf);
View Full Code Here

      if (!conn.tableOperations().exists(opts.tableName)) {
        System.err.println("table " + opts.tableName + " does not exist");
        return;
      }
      if (opts.goalSize == null || opts.goalSize < 1) {
        AccumuloConfiguration tableConfig = new ConfigurationCopy(conn.tableOperations().getProperties(opts.tableName));
        opts.goalSize = tableConfig.getMemoryInBytes(Property.TABLE_SPLIT_THRESHOLD);
      }
     
      message("Merging tablets in table %s to %d bytes", opts.tableName, opts.goalSize);
      mergomatic(conn, opts.tableName, opts.begin, opts.end, opts.goalSize, opts.force);
    } catch (Exception ex) {
View Full Code Here

    this.authorizations = authorizations;
    this.readers = new ArrayList<SortedKeyValueIterator<Key,Value>>();
   
    try {
      conn = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials));
      config = new ConfigurationCopy(conn.instanceOperations().getSiteConfiguration());
      nextTablet();
     
      while (iter != null && !iter.hasTop())
        nextTablet();
     
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.conf.ConfigurationCopy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.