Package org.apache.accumulo.core.conf

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


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


public class LocalityGroupUtilTest {
 
  @Test
  public void testColumnFamilySet() {
   
    ConfigurationCopy conf = new ConfigurationCopy();
    conf.set("table.group.lg1", "cf1,cf2");
    conf.set("table.groups.enabled", "lg1");
    try {
      Map<String,Set<ByteSequence>> groups = LocalityGroupUtil.getLocalityGroups(conf);
      Assert.assertEquals(1, groups.size());
      Assert.assertNotNull(groups.get("lg1"));
      Assert.assertEquals(2, groups.get("lg1").size());
      Assert.assertTrue(groups.get("lg1").contains(new ArrayByteSequence("cf1")));
    } catch (LocalityGroupConfigurationError err) {
      Assert.fail();
    }
    try {
      conf.set("table.group.lg2", "cf1");
      conf.set("table.groups.enabled", "lg1,lg2");
      LocalityGroupUtil.getLocalityGroups(conf);
      Assert.fail();
    } catch (LocalityGroupConfigurationError err) {}
  }
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(table)) {
        System.err.println("table " + table + " does not exist");
        return;
      }
      if (goalSize < 1) {
        AccumuloConfiguration tableConfig = new ConfigurationCopy(conn.tableOperations().getProperties(table));
        goalSize = tableConfig.getMemoryInBytes(Property.TABLE_SPLIT_THRESHOLD);
      }
     
      message("Merging tablets in table %s to %d bytes", table, goalSize);
      mergomatic(conn, table, begin, end, goalSize, force);
    } catch (Exception ex) {
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

public class LocalityGroupUtilTest {
 
  @Test
  public void testColumnFamilySet() {
   
    ConfigurationCopy conf = new ConfigurationCopy();
    conf.set("table.group.lg1", "cf1,cf2");
    conf.set("table.groups.enabled", "lg1");
    try {
      Map<String,Set<ByteSequence>> groups = LocalityGroupUtil.getLocalityGroups(conf);
      assertEquals(1, groups.size());
      assertNotNull(groups.get("lg1"));
      assertEquals(2, groups.get("lg1").size());
      assertTrue(groups.get("lg1").contains(new ArrayByteSequence("cf1")));
    } catch (LocalityGroupConfigurationError err) {
      fail();
    }
    try {
      conf.set("table.group.lg2", "cf1");
      conf.set("table.groups.enabled", "lg1,lg2");
      LocalityGroupUtil.getLocalityGroups(conf);
      fail();
    } catch (LocalityGroupConfigurationError err) {}
  }
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

   * @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(), 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.