Package org.apache.accumulo.core.conf

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


    UUID instanceId = null;
    if (instanceName == null) {
      instanceName = clientConfig.get(ClientProperty.INSTANCE_NAME);
    }
    if (instanceName == null || keepers == null) {
      AccumuloConfiguration conf = SiteConfiguration.getInstance(ServerConfigurationUtil.convertClientConfig(DefaultConfiguration.getInstance(), clientConfig));
      if (instanceName == null) {
        Path instanceDir = new Path(VolumeConfiguration.getVolumeUris(conf)[0], "instance_id");
        instanceId = UUID.fromString(ZooUtil.getInstanceIDFromHdfs(instanceDir, conf));
      }
      if (keepers == null) {
        keepers = conf.get(Property.INSTANCE_ZK_HOST);
      }
    }
    if (instanceId != null) {
      return new ZooKeeperInstance(clientConfig.withInstance(instanceId).withZkHosts(keepers));
    } else {
View Full Code Here


    EasyMock.expect(writeParams.getCompressType()).andReturn(compressType).times(2);
    EasyMock.expect(writeParams.getReplication()).andReturn(replication).times(2);

    EasyMock.replay(tableConf, plan, writeParams);

    AccumuloConfiguration aConf = tablet.createTableConfiguration(tableConf, plan);

    EasyMock.verify(tableConf, plan, writeParams);

    Assert.assertEquals(hdfsBlockSize, Long.valueOf(aConf.get(Property.TABLE_FILE_BLOCK_SIZE)).longValue());
    Assert.assertEquals(blockSize, Long.valueOf(aConf.get(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE)).longValue());
    Assert.assertEquals(indexBlockSize, Long.valueOf(aConf.get(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX)).longValue());
    Assert.assertEquals(compressType, aConf.get(Property.TABLE_FILE_COMPRESSION_TYPE));
    Assert.assertEquals(replication, Integer.valueOf(aConf.get(Property.TABLE_FILE_REPLICATION)).intValue());
  }
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

  @Test
  public void testGetConfiguration() {
    mockInstanceForConfig();
    ready();
    AccumuloConfiguration c = scf.getConfiguration();
    assertNotNull(c);
  }
View Full Code Here

    assertEquals(VALUE, a.get(PROP, PATH, null));
  }

  @Test
  public void testGet_Parent() {
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    expect(parent.get(PROP)).andReturn(VALUE);
    replay(parent);
    expect(zc.get(FULL_PATH)).andReturn(null);
    replay(zc);
    assertEquals(VALUE, a.get(PROP, PATH, parent));
  }
View Full Code Here

    assertEquals(VALUE, a.get(PROP, PATH, parent));
  }

  @Test
  public void testGet_Parent_Null() {
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    expect(parent.get(PROP)).andReturn(null);
    replay(parent);
    expect(zc.get(FULL_PATH)).andReturn(null);
    replay(zc);
    assertNull(a.get(PROP, PATH, parent));
  }
View Full Code Here

  @Test
  public void testGet_InvalidFormat() {
    Property badProp = Property.MASTER_CLIENTPORT;
    expect(zc.get(PATH + "/" + badProp.getKey())).andReturn(VALUE_BYTES);
    replay(zc);
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    expect(parent.get(badProp)).andReturn("12345");
    replay(parent);
    assertEquals("12345", a.get(badProp, PATH, parent));
  }
View Full Code Here

  }

  @Test
  public void testGetProperties() {
    Map<String,String> props = new java.util.HashMap<String,String>();
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    PropertyFilter filter = createMock(PropertyFilter.class);
    parent.getProperties(props, filter);
    replay(parent);
    String child1 = "child1";
    String child2 = "child2";
    List<String> children = new java.util.ArrayList<String>();
    children.add(child1);
View Full Code Here

  }

  @Test
  public void testGetProperties_NoChildren() {
    Map<String,String> props = new java.util.HashMap<String,String>();
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    PropertyFilter filter = createMock(PropertyFilter.class);
    parent.getProperties(props, filter);
    replay(parent);
    expect(zc.getChildren(PATH)).andReturn(null);
    replay(zc);

    a.getProperties(props, PATH, filter, parent, null);
View Full Code Here

  }

  @Test
  public void testGetProperties_Filter() {
    Map<String,String> props = new java.util.HashMap<String,String>();
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    PropertyFilter filter = createMock(PropertyFilter.class);
    parent.getProperties(props, filter);
    replay(parent);
    String child1 = "child1";
    List<String> children = new java.util.ArrayList<String>();
    children.add(child1);
    expect(zc.getChildren(PATH)).andReturn(children);
View Full Code Here

TOP

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

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.