Package org.apache.accumulo.core.conf

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


   * @throws TableNotFoundException
   *           if the table does not exist
   */
  @Override
  public Map<String,Set<Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException {
    AccumuloConfiguration conf = new ConfigurationCopy(this.getProperties(tableName));
    Map<String,Set<ByteSequence>> groups = LocalityGroupUtil.getLocalityGroups(conf);

    Map<String,Set<Text>> groups2 = new HashMap<String,Set<Text>>();
    for (Entry<String,Set<ByteSequence>> entry : groups.entrySet()) {

View Full Code Here


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

  private AccumuloConfiguration createTableConfiguration(TableConfiguration base, CompactionPlan plan) {
    if (plan == null || plan.writeParameters == null)
      return base;
    WriteParameters p = plan.writeParameters;
    ConfigurationCopy result = new ConfigurationCopy(base);
    if (p.getHdfsBlockSize() > 0)
      result.set(Property.TABLE_FILE_BLOCK_SIZE, "" + p.getHdfsBlockSize());
    if (p.getBlockSize() > 0)
      result.set(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE, "" + p.getBlockSize());
    if (p.getIndexBlockSize() > 0)
      result.set(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX, "" + p.getBlockSize());
    if (p.getCompressType() != null)
      result.set(Property.TABLE_FILE_COMPRESSION_TYPE, p.getCompressType());
    if (p.getReplication() != 0)
      result.set(Property.TABLE_FILE_REPLICATION, "" + p.getReplication());
    return result;
  }
View Full Code Here

   *           if a general error occurs
   * @throws TableNotFoundException
   *           if the table does not exist
   */
  public Map<String,Set<Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException {
    AccumuloConfiguration conf = new ConfigurationCopy(this.getProperties(tableName));
    Map<String,Set<ByteSequence>> groups = LocalityGroupUtil.getLocalityGroups(conf);
   
    Map<String,Set<Text>> groups2 = new HashMap<String,Set<Text>>();
    for (Entry<String,Set<ByteSequence>> entry : groups.entrySet()) {
     
View Full Code Here

      for (String table : shellState.getConnector().tableOperations().list())
        if (table.matches(cl.getOptionValue(optTablePattern.getOpt())))
          tablesToFlush.add(table);
    }
    try {
      AccumuloConfiguration acuConf = new ConfigurationCopy(shellState.getConnector().instanceOperations().getSystemConfiguration());
      TableDiskUsage.printDiskUsage(acuConf, tablesToFlush, FileSystem.get(new Configuration()), shellState.getConnector());
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }
    return 0;
View Full Code Here

    }
  }
 
  @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

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.