Examples of RiakConnectionPool


Examples of com.basho.riak.pbc.RiakConnectionPool

    public RawClient newClient(Configuration config) throws IOException {
        PBClientConfig conf = (PBClientConfig) config;

        InetAddress hostAddress = InetAddress.getByName(conf.getHost());

        final RiakConnectionPool pool = new RiakConnectionPool(conf.getInitialPoolSize(), conf.getPoolSize(),
                                                               hostAddress, conf.getPort(),
                                                               conf.getConnectionWaitTimeoutMillis(),
                                                               conf.getSocketBufferSizeKb(),
                                                               conf.getIdleConnectionTTLMillis());
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

            // Independent pools
            clusterSemaphore = RiakConnectionPool.getSemaphore(totalMaxConnections);
        }

        for (PBClientConfig node : clusterConfig.getClients()) {
            final RiakConnectionPool hostPool = makePool(clusterSemaphore, node);
            clients.add(new PBClientAdapter(new RiakClient(hostPool)));
        }
        return clients.toArray(new RawClient[clients.size()]);
    }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

     * @return a {@link RiakConnectionPool} configured for the
     *         {@link PBClientConfig}
     * @throws IOException
     */
    private RiakConnectionPool makePool(Semaphore clusterSemaphore, PBClientConfig node) throws IOException {
        RiakConnectionPool pool = null;
        if (clusterSemaphore == null) {
            pool = new RiakConnectionPool(node.getInitialPoolSize(), node.getPoolSize(),
                                          InetAddress.getByName(node.getHost()), node.getPort(),
                                          node.getConnectionWaitTimeoutMillis(), node.getSocketBufferSizeKb(),
                                          node.getIdleConnectionTTLMillis());
        } else {
            pool = new RiakConnectionPool(node.getInitialPoolSize(), new PoolSemaphore(clusterSemaphore,
                                                                                       node.getPoolSize()),
                                          InetAddress.getByName(node.getHost()), node.getPort(),
                                          node.getConnectionWaitTimeoutMillis(), node.getSocketBufferSizeKb(),
                                          node.getIdleConnectionTTLMillis());
        }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

    public RawClient newClient(Configuration config) throws IOException {
        PBClientConfig conf = (PBClientConfig) config;

        InetAddress hostAddress = InetAddress.getByName(conf.getHost());

        final RiakConnectionPool pool = new RiakConnectionPool(conf.getInitialPoolSize(), conf.getPoolSize(),
                                                               hostAddress, conf.getPort(),
                                                               conf.getConnectionWaitTimeoutMillis(),
                                                               conf.getSocketBufferSizeKb(),
                                                               conf.getIdleConnectionTTLMillis());

        pool.start();
        return new PBClientAdapter(new RiakClient(pool));
    }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

            // Independent pools
            clusterSemaphore = RiakConnectionPool.getSemaphore(totalMaxConnections);
        }

        for (PBClientConfig node : clusterConfig.getClients()) {
            final RiakConnectionPool hostPool = makePool(clusterSemaphore, node);
            hostPool.start();
            clients.add(new PBClientAdapter(new RiakClient(hostPool)));
        }
        return clients.toArray(new RawClient[clients.size()]);
    }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

     * @return a {@link RiakConnectionPool} configured for the
     *         {@link PBClientConfig}
     * @throws IOException
     */
    private RiakConnectionPool makePool(Semaphore clusterSemaphore, PBClientConfig node) throws IOException {
        RiakConnectionPool pool = null;
        if (clusterSemaphore == null) {
            pool = new RiakConnectionPool(node.getInitialPoolSize(), node.getPoolSize(),
                                          InetAddress.getByName(node.getHost()), node.getPort(),
                                          node.getConnectionWaitTimeoutMillis(), node.getSocketBufferSizeKb(),
                                          node.getIdleConnectionTTLMillis());
        } else {
            pool = new RiakConnectionPool(node.getInitialPoolSize(), new PoolSemaphore(clusterSemaphore,
                                                                                       node.getPoolSize()),
                                          InetAddress.getByName(node.getHost()), node.getPort(),
                                          node.getConnectionWaitTimeoutMillis(), node.getSocketBufferSizeKb(),
                                          node.getIdleConnectionTTLMillis());
        }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

    public RawClient newClient(Configuration config) throws IOException {
        PBClientConfig conf = (PBClientConfig) config;

        InetAddress hostAddress = InetAddress.getByName(conf.getHost());

        final RiakConnectionPool pool = new RiakConnectionPool(conf.getInitialPoolSize(), conf.getPoolSize(),
                                                               hostAddress, conf.getPort(),
                                                               conf.getConnectionWaitTimeoutMillis(),
                                                               conf.getSocketBufferSizeKb(),
                                                               conf.getIdleConnectionTTLMillis(),
                                                               conf.getRequestTimeoutMillis());

        pool.start();
        return new PBClientAdapter(new RiakClient(pool));
    }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

            // Independent pools
            clusterSemaphore = RiakConnectionPool.getSemaphore(totalMaxConnections);
        }

        for (PBClientConfig node : clusterConfig.getClients()) {
            final RiakConnectionPool hostPool = makePool(clusterSemaphore, node);
            hostPool.start();
            clients.add(new PBClientAdapter(new RiakClient(hostPool)));
        }
        return clients.toArray(new RawClient[clients.size()]);
    }
View Full Code Here

Examples of com.basho.riak.pbc.RiakConnectionPool

     * @return a {@link RiakConnectionPool} configured for the
     *         {@link PBClientConfig}
     * @throws IOException
     */
    private RiakConnectionPool makePool(Semaphore clusterSemaphore, PBClientConfig node) throws IOException {
        RiakConnectionPool pool = null;
        if (clusterSemaphore == null) {
            pool = new RiakConnectionPool(node.getInitialPoolSize(), node.getPoolSize(),
                                          InetAddress.getByName(node.getHost()), node.getPort(),
                                          node.getConnectionWaitTimeoutMillis(), node.getSocketBufferSizeKb(),
                                          node.getIdleConnectionTTLMillis(),
                                          node.getRequestTimeoutMillis());
        } else {
            pool = new RiakConnectionPool(node.getInitialPoolSize(), new PoolSemaphore(clusterSemaphore,
                                                                                       node.getPoolSize()),
                                          InetAddress.getByName(node.getHost()), node.getPort(),
                                          node.getConnectionWaitTimeoutMillis(), node.getSocketBufferSizeKb(),
                                          node.getIdleConnectionTTLMillis(),
                                          node.getRequestTimeoutMillis());
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.