Package com.netflix.suro

Examples of com.netflix.suro.ClientConfig


    }
   
    @Override
    public ILoadBalancer get() {
        // Load the singleton ClientConfig lazily
        ClientConfig config = this.config.get();
        if (config.getLoadBalancerType() != null) {
            if (!impls.containsKey(config.getLoadBalancerType())) {
                throw new RuntimeException(
                        String.format("Unknown load balancer type '%s'.  Expecting one of %s",
                            config.getLoadBalancerType(),
                            impls.keySet()));
            }
            return impls.get(config.getLoadBalancerType()).get();
        }
        else {
            return impls.get(DEFAULT_LOAD_BALANCER_TYPE).get();
        }
    }
View Full Code Here


        bb.get(bytes, 0, bytes.length);
        return bytes;
    }

    public static TMessageSet createMessageSet(String topic, int numMsgs) {
        MessageSetBuilder builder = new MessageSetBuilder(new ClientConfig()).withCompression(Compression.LZF);
        for (int i = 0; i < numMsgs; ++i) {
            builder.withMessage(topic, ("testMessage" + i).getBytes());
        }

        return builder.build();
View Full Code Here

    }
   
    @Override
    public ISuroClient get() {
        // Load the singleton ClientConfig lazily
        ClientConfig config = configProvider.get();
        if (config.getClientType() != null) {
            if (!clientImpls.containsKey(config.getClientType())) {
                throw new RuntimeException(
                        String.format("Unknown client type '%s'.  Expecting one of %s",
                            config.getClientType(),
                            clientImpls.keySet()));
            }
            return clientImpls.get(config.getClientType()).get();
        }
        else {
            return clientImpls.get(DEFAULT_CLIENT_TYPE).get();
        }
       
View Full Code Here

TOP

Related Classes of com.netflix.suro.ClientConfig

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.