Examples of ClientConfiguration


Examples of org.apache.accumulo.core.client.ClientConfiguration

  }

  @Test
  public void testSetZooKeeperInstance() {
    Configuration conf = new Configuration();
    ConfiguratorBase.setZooKeeperInstance(this.getClass(), conf, new ClientConfiguration().withInstance("testInstanceName").withZkHosts("testZooKeepers")
        .withSsl(true).withZkTimeout(1234));
    ClientConfiguration clientConf = ClientConfiguration.deserialize(conf.get(ConfiguratorBase.enumToConfKey(this.getClass(),
        ConfiguratorBase.InstanceOpts.CLIENT_CONFIG)));
    assertEquals("testInstanceName", clientConf.get(ClientProperty.INSTANCE_NAME));
    assertEquals("testZooKeepers", clientConf.get(ClientProperty.INSTANCE_ZK_HOST));
    assertEquals("true", clientConf.get(ClientProperty.INSTANCE_RPC_SSL_ENABLED));
    assertEquals("1234", clientConf.get(ClientProperty.INSTANCE_ZK_TIMEOUT));
    assertEquals(ZooKeeperInstance.class.getSimpleName(), conf.get(ConfiguratorBase.enumToConfKey(this.getClass(), ConfiguratorBase.InstanceOpts.TYPE)));

    Instance instance = ConfiguratorBase.getInstance(this.getClass(), conf);
    assertEquals(ZooKeeperInstance.class.getName(), instance.getClass().getName());
    assertEquals("testInstanceName", ((ZooKeeperInstance) instance).getInstanceName());
View Full Code Here

Examples of org.apache.accumulo.core.client.ClientConfiguration

    if (!isCredentialProviderAvailable) {
      return;
    }

    String absPath = getKeyStoreUrl(keystore);
    ClientConfiguration clientConf = new ClientConfiguration();
    clientConf.addProperty(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey(), absPath);

    AccumuloConfiguration accClientConf = ServerConfigurationUtil.convertClientConfig(DefaultConfiguration.getInstance(), clientConf);
    Assert.assertEquals("mysecret", accClientConf.get(Property.INSTANCE_SECRET));
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ClientConfiguration

  public void defaultValueForSensitiveProperty() {
    if (!isCredentialProviderAvailable) {
      return;
    }

    ClientConfiguration clientConf = new ClientConfiguration();

    AccumuloConfiguration accClientConf = ServerConfigurationUtil.convertClientConfig(DefaultConfiguration.getInstance(), clientConf);
    Assert.assertEquals(Property.INSTANCE_SECRET.getDefaultValue(), accClientConf.get(Property.INSTANCE_SECRET));
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ClientConfiguration

    if (!isCredentialProviderAvailable) {
      return;
    }

    String absPath = getKeyStoreUrl(keystore);
    ClientConfiguration clientConf = new ClientConfiguration();
    clientConf.addProperty(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey(), absPath);

    AccumuloConfiguration accClientConf = ServerConfigurationUtil.convertClientConfig(DefaultConfiguration.getInstance(), clientConf);
    Map<String,String> props = new HashMap<String,String>();
    accClientConf.getProperties(props, new AllFilter());
View Full Code Here

Examples of org.apache.bookkeeper.conf.ClientConfiguration

       
        /*
         * Create new ledger for adding records
         */
        try{
            bk = new BookKeeper(new ClientConfiguration(), zk);
        } catch (Exception e) {
            LOG.error("Exception while initializing bookkeeper", e);
            throw new LoggerException.BKOpFailedException()
        }
       
View Full Code Here

Examples of org.apache.bookkeeper.conf.ClientConfiguration

        }
       
        LOG.info("Creating bookkeeper client");
       
        try{
            bk = new BookKeeper(new ClientConfiguration(), this.zk);   
        } catch (Exception e) {
            LOG.error("Error while creating bookkeeper object", e);
            return null;
        }
       
View Full Code Here

Examples of org.apache.bookkeeper.conf.ClientConfiguration

        baseClientConf.setBookieRecoveryPasswd("".getBytes());
        super.setUp();

        sync = new SyncObject();
        bookieRecoverCb = new BookieRecoverCallback();
        ClientConfiguration adminConf = new ClientConfiguration(baseClientConf);
        adminConf.setZkServers(HOSTPORT);
        bkAdmin = new BookKeeperAdmin(adminConf);
    }
View Full Code Here

Examples of org.apache.bookkeeper.conf.ClientConfiguration

            BookKeeper bk = null;
            try {
                barrier.await();
                while(true) {
                    try {
                        bk = new BookKeeper(new ClientConfiguration(baseClientConf), bkc.getZkHandle());
                       
                        lh = bk.openLedger(ledgerId,
                                           digestType, "".getBytes());
                        lastConfirmedEntry = lh.getLastAddConfirmed();
                        lh.close();
View Full Code Here

Examples of org.apache.bookkeeper.conf.ClientConfiguration

        this.digestType = digestType;
    }

    @Test
    public void testLedgerLayout() throws Exception {
        ClientConfiguration conf = new ClientConfiguration();
        conf.setLedgerManagerType(HierarchicalLedgerManager.NAME);
        String ledgerRootPath = "/testLedgerLayout";

        zkc.create(ledgerRootPath, new byte[0],
                   Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
View Full Code Here

Examples of org.apache.bookkeeper.conf.ClientConfiguration

        layout.store(zkc, ledgersRootPath);
    }

    @Test
    public void testBadVersionLedgerLayout() throws Exception {
        ClientConfiguration conf = new ClientConfiguration();
        // write bad version ledger layout
        writeLedgerLayout(conf.getZkLedgersRootPath(), FlatLedgerManager.NAME,
                FlatLedgerManager.CUR_VERSION, LedgerLayout.LAYOUT_FORMAT_VERSION + 1);
       
        try {
            LedgerLayout.readLayout(zkc, conf.getZkLedgersRootPath());
            fail("Shouldn't reach here!");
        } catch (IOException ie) {
            assertTrue("Invalid exception", ie.getMessage().contains("version not compatible"));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.