Package org.apache.hadoop.hbase.regionserver

Examples of org.apache.hadoop.hbase.regionserver.CompoundConfiguration


    baseConf.set("C", "3");
  }

  @Test
  public void testBasicFunctionality() throws ClassNotFoundException {
    CompoundConfiguration compoundConf = new CompoundConfiguration()
        .add(baseConf);
    assertEquals("1", compoundConf.get("A"));
    assertEquals(2, compoundConf.getInt("B", 0));
    assertEquals(3, compoundConf.getInt("C", 0));
    assertEquals(0, compoundConf.getInt("D", 0));

    assertEquals(CompoundConfiguration.class, compoundConf
        .getClassByName(CompoundConfiguration.class.getName()));
    try {
      compoundConf.getClassByName("bad_class_name");
      fail("Trying to load bad_class_name should throw an exception");
    } catch (ClassNotFoundException e) {
      // win!
    }
  }
View Full Code Here


    Configuration conf = new Configuration();
    conf.set("B", "2b");
    conf.set("C", "33");
    conf.set("D", "4");

    CompoundConfiguration compoundConf = new CompoundConfiguration()
        .add(baseConf)
        .add(conf);
    assertEquals("1", compoundConf.get("A"));
    assertEquals("2b", compoundConf.get("B"));
    assertEquals(33, compoundConf.getInt("C", 0));
    assertEquals("4", compoundConf.get("D"));
    assertEquals(4, compoundConf.getInt("D", 0));
    assertNull(compoundConf.get("E"));
    assertEquals(6, compoundConf.getInt("F", 6));
  }
View Full Code Here

    map.put(strToIbw("C"), strToIbw("33"));
    map.put(strToIbw("D"), strToIbw("4"));
    // unlike config, note that IBW Maps can accept null values
    map.put(strToIbw("G"), null);

    CompoundConfiguration compoundConf = new CompoundConfiguration()
      .add(baseConf)
      .add(map);
    assertEquals("1", compoundConf.get("A"));
    assertEquals("2b", compoundConf.get("B"));
    assertEquals(33, compoundConf.getInt("C", 0));
    assertEquals("4", compoundConf.get("D"));
    assertEquals(4, compoundConf.getInt("D", 0));
    assertNull(compoundConf.get("E"));
    assertEquals(6, compoundConf.getInt("F", 6));
    assertNull(compoundConf.get("G"));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.regionserver.CompoundConfiguration

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.