Package voldemort.utils.pool

Examples of voldemort.utils.pool.ResourcePoolConfig


        return Arrays.asList(new Object[][] { { true }, { false } });
    }

    @Test
    public void testPoolLimitNoTimeout() throws Exception {
        final ResourcePoolConfig config = new ResourcePoolConfig().setTimeout(1000,
                                                                              TimeUnit.MILLISECONDS)
                                                                  .setMaxPoolSize(20);

        ResourceFactory<String, String> factory = ResourcePoolTestUtils.getBasicPoolFactory();
        final AbstractSocketPoolTest<String, String> test = new AbstractSocketPoolTest<String, String>() {
View Full Code Here


        assertEquals("We should see Zero timeoutRequests", 0, testStats.timeoutRequests);
    }

    @Test
    public void testPoolLimitSomeTimeout() throws Exception {
        final ResourcePoolConfig config = new ResourcePoolConfig().setTimeout(50,
                                                                              TimeUnit.MILLISECONDS)
                                                                  .setMaxPoolSize(20);

        ResourceFactory<String, String> factory = ResourcePoolTestUtils.getBasicPoolFactory();
        final AbstractSocketPoolTest<String, String> test = new AbstractSocketPoolTest<String, String>() {
View Full Code Here

                                                                        50,
                                                                        1000);

        server.start();

        final ResourcePoolConfig config = new ResourcePoolConfig().setTimeout(50,
                                                                              TimeUnit.MILLISECONDS)
                                                                  .setMaxPoolSize(20);

        ResourceFactory<SocketDestination, SocketAndStreams> factory = ResourcePoolTestUtils.getSocketPoolFactory();
        final AbstractSocketPoolTest<SocketDestination, SocketAndStreams> test = new AbstractSocketPoolTest<SocketDestination, SocketAndStreams>() {
View Full Code Here

                                                                        50,
                                                                        1000);

        server.start();

        final ResourcePoolConfig config = new ResourcePoolConfig().setTimeout(50,
                                                                              TimeUnit.MILLISECONDS)
                                                                  .setMaxPoolSize(20);

        ClientRequestExecutorPool clientRequestExecutorPool = new ClientRequestExecutorPool(config.getMaxPoolSize(),
                                                                                            (int) config.getTimeout(TimeUnit.MILLISECONDS),
                                                                                            100,
                                                                                            1000);

        try {
            ResourceFactory<SocketDestination, ClientRequestExecutor> factory = clientRequestExecutorPool.getFactory();
View Full Code Here

        }
    }

    @Test
    public void testNoTimeout() throws Exception {
        final ResourcePoolConfig config = new ResourcePoolConfig().setTimeout(100,
                                                                              TimeUnit.MILLISECONDS)
                                                                  .setMaxPoolSize(20);

        ResourceFactory<String, String> factory = ResourcePoolTestUtils.getBasicPoolFactory();
        final AbstractSocketPoolTest<String, String> test = new AbstractSocketPoolTest<String, String>() {
View Full Code Here

    public SocketPool(int maxConnectionsPerNode,
                      int connectionTimeoutMs,
                      int soTimeoutMs,
                      int socketBufferSize,
                      boolean socketKeepAlive) {
        ResourcePoolConfig config = new ResourcePoolConfig().setIsFair(true)
                                                            .setMaxPoolSize(maxConnectionsPerNode)
                                                            .setMaxInvalidAttempts(maxConnectionsPerNode)
                                                            .setTimeout(connectionTimeoutMs,
                                                                        TimeUnit.MILLISECONDS);
        this.socketFactory = new SocketResourceFactory(soTimeoutMs,
View Full Code Here

                                     int soTimeoutMs,
                                     int socketBufferSize,
                                     boolean socketKeepAlive,
                                     boolean jmxEnabled,
                                     String identifierString) {
        ResourcePoolConfig config = new ResourcePoolConfig().setIsFair(true)
                                                            .setMaxPoolSize(maxConnectionsPerNode)
                                                            .setMaxInvalidAttempts(maxConnectionsPerNode)
                                                            .setTimeout(connectionTimeoutMs,
                                                                        TimeUnit.MILLISECONDS);
        this.jmxEnabled = jmxEnabled;
View Full Code Here

        for(int poolSize: new int[] { 1, 5, 10 }) {
            System.out.println("Perf test for voldemort pool with numThreads = " + numThreads
                               + ", poolSize = " + poolSize + ":");
            final KeyedResourcePool<Integer, String> pool = KeyedResourcePool.create(new StringResourceFactory(),
                                                                                     new ResourcePoolConfig().setMaxPoolSize(poolSize)
                                                                                                             .setIsFair(true));
            PerformanceTest test = new PerformanceTest() {

                @Override
                public void doOperation(int id) throws Exception {
View Full Code Here

TOP

Related Classes of voldemort.utils.pool.ResourcePoolConfig

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.