Package org.apache.accumulo.core.conf

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


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


   *           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

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.