Package com.basho.riak.client.raw.http

Examples of com.basho.riak.client.raw.http.HTTPClusterConfig


        {
            urls.add( DEFAULT_URL );
        }
        bucketKey = config.bucket().get() == null ? DEFAULT_BUCKET_KEY : config.bucket().get();

        HTTPClusterConfig httpClusterConfig = new HTTPClusterConfig( maxConnections );
        for( String url : urls )
        {
            HTTPClientConfig clientConfig = new HTTPClientConfig.Builder().withTimeout( timeoutMillis ).withUrl( url ).build();
            httpClusterConfig.addClient( clientConfig );
        }
        riakClient = RiakFactory.newClient( httpClusterConfig );

        if( !riakClient.listBuckets().contains( bucketKey ) )
        {
View Full Code Here


    /**
     * @param riakLocatons
     * @return a cluster client of HTTP clients
     */
    private static IRiakClient httpClusterClient(RiakLocation[] riakLocatons) throws RiakException {
        HTTPClusterConfig conf = new HTTPClusterConfig(500); // TODO make this config

        for (RiakLocation loc : riakLocatons) {
            if(!RiakTransport.HTTP.equals(loc.getTransport())) {
                throw new IllegalArgumentException("Cluster clients must be homogenous");
            }

            RiakHTTPLocation httpLoc = (RiakHTTPLocation)loc;
            conf.addClient(new HTTPClientConfig.Builder()
                .withHost(httpLoc.getHost())
                .withPort(httpLoc.getPort())
                .withRiakPath(httpLoc.getRiakPath())
                .build());
        }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.raw.http.HTTPClusterConfig

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.