Package com.datasift.dropwizard.zookeeper.config

Examples of com.datasift.dropwizard.zookeeper.config.ZooKeeperConfiguration


            return consumer;
        }
    }

    static ConsumerConfig toConsumerConfig(final KafkaConsumerConfiguration configuration) {
        final ZooKeeperConfiguration zookeeper = configuration.getZookeeper();
        final Properties props = new Properties();

        props.setProperty("zk.connect",
                zookeeper.getQuorumSpec());
        props.setProperty("zk.connectiontimeout.ms",
                String.valueOf(zookeeper.getConnectionTimeout().toMilliseconds()));
        props.setProperty("zk.sessiontimeout.ms",
                String.valueOf(zookeeper.getSessionTimeout().toMilliseconds()));
        props.setProperty("groupid",
                configuration.getGroup());
        props.setProperty("socket.timeout.ms",
                String.valueOf(configuration.getSocketTimeout().toMilliseconds()));
        props.setProperty("socket.buffersize",
View Full Code Here


            return consumer;
        }
    }

    static ConsumerConfig toConsumerConfig(final KafkaConsumerConfiguration configuration) {
        final ZooKeeperConfiguration zookeeper = configuration.getZookeeper();
        final Properties props = new Properties();

        props.setProperty("zk.connect",
                zookeeper.getQuorumSpec());
        props.setProperty("zk.connectiontimeout.ms",
                String.valueOf(zookeeper.getConnectionTimeout().toMilliseconds()));
        props.setProperty("zk.sessiontimeout.ms",
                String.valueOf(zookeeper.getSessionTimeout().toMilliseconds()));
        props.setProperty("groupid",
                configuration.getGroup());
        props.setProperty("socket.timeout.ms",
                String.valueOf(configuration.getSocketTimeout().toMilliseconds()));
        props.setProperty("socket.buffersize",
View Full Code Here

     *
     * @return an {@link HBaseClient}, managed and configured according to the {@code
     *         configuration}.
     */
    public HBaseClient build(final HBaseClientConfiguration configuration, final String name) {
        final ZooKeeperConfiguration zkConfiguration = configuration.getZookeeper();

        final HBaseClient proxy = new HBaseClientProxy(
                new org.hbase.async.HBaseClient(
                        zkConfiguration.getQuorumSpec(),
                        zkConfiguration.getNamespace().toString()));

        // optionally instrument and bound requests for the client
        final HBaseClient client = instrument(configuration, boundRequests(configuration, proxy), name);

        // configure client
View Full Code Here

            return consumer;
        }
    }

    static ConsumerConfig toConsumerConfig(final KafkaConsumerConfiguration configuration) {
        final ZooKeeperConfiguration zookeeper = configuration.getZookeeper();
        final Properties props = new Properties();

        props.setProperty("zk.connect",
                zookeeper.getQuorumSpec());
        props.setProperty("zk.connectiontimeout.ms",
                String.valueOf(zookeeper.getConnectionTimeout().toMilliseconds()));
        props.setProperty("zk.sessiontimeout.ms",
                String.valueOf(zookeeper.getSessionTimeout().toMilliseconds()));
        props.setProperty("groupid",
                configuration.getGroup());
        props.setProperty("socket.timeout.ms",
                String.valueOf(configuration.getSocketTimeout().toMilliseconds()));
        props.setProperty("socket.buffersize",
View Full Code Here

     *
     * @return a {@link CuratorFramework} instance, managed and configured according to the {@code
     *         configuration}.
     */
    public CuratorFramework build(final CuratorConfiguration configuration, final String name) {
        final ZooKeeperConfiguration zkConfiguration = configuration.getEnsembleConfiguration();
        final ZooKeeperFactory factory = new ZooKeeperFactory(environment);
        final CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
                .zookeeperFactory(new DropwizardConfiguredZooKeeperFactory(factory, name))
                .ensembleProvider(new DropwizardConfiguredEnsembleProvider(zkConfiguration))
                .connectionTimeoutMs((int) zkConfiguration.getConnectionTimeout().toMilliseconds())
                .threadFactory(new ThreadFactoryBuilder().setNameFormat(name + "-%d").build())
                .sessionTimeoutMs((int) zkConfiguration.getSessionTimeout().toMilliseconds())
                .namespace(zkConfiguration.getNamespace())
                .compressionProvider(configuration.getCompressionProvider())
                .retryPolicy(configuration.getRetryPolicy())
                .canBeReadOnly(zkConfiguration.canBeReadOnly());

        // add optional auth details
        final ZooKeeperConfiguration.Auth auth = zkConfiguration.getAuth();
        if (auth != null) {
            builder.authorization(auth.getScheme(), auth.getId());
        }

        final CuratorFramework framework = builder.build();
View Full Code Here

TOP

Related Classes of com.datasift.dropwizard.zookeeper.config.ZooKeeperConfiguration

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.