Examples of CTConnectionPool


Examples of com.thinkaurelius.titan.diskstorage.cassandra.thrift.thriftpool.CTConnectionPool

        int maxTotalConnections = config.getInt(
                GraphDatabaseConfiguration.CONNECTION_POOL_SIZE_KEY,
                GraphDatabaseConfiguration.CONNECTION_POOL_SIZE_DEFAULT);

        CTConnectionFactory factory = new CTConnectionFactory(hostnames, port, username, password, thriftTimeoutMS, thriftFrameSize);
        CTConnectionPool p = new CTConnectionPool(factory);
        p.setTestOnBorrow(true);
        p.setTestOnReturn(true);
        p.setTestWhileIdle(false);
        p.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK);
        p.setMaxActive(-1); // "A negative value indicates no limit"
        p.setMaxTotal(maxTotalConnections); // maxTotal limits active + idle
        p.setMinIdle(0); // prevent evictor from eagerly creating unused connections
        p.setMinEvictableIdleTimeMillis(60 * 1000L);
        p.setTimeBetweenEvictionRunsMillis(30 * 1000L);

        this.pool = p;

        this.openStores = new HashMap<String, CassandraThriftKeyColumnValueStore>();
    }
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.