Examples of HostSupplierProvider


Examples of com.netflix.paas.cassandra.provider.HostSupplierProvider

        String clusterName = clusterKey.getClusterName().toLowerCase();
        Preconditions.checkNotNull(clusterName, "Invalid cluster name 'null'");
       
        ClusterContextHolder holder = contextMap.get(clusterName);
        if (holder == null) {
            HostSupplierProvider hostSupplierProvider = hostSupplierProviders.get(clusterKey.getDiscoveryType());
            Preconditions.checkNotNull(hostSupplierProvider, String.format("Unknown host supplier provider '%s' for cluster '%s'", clusterKey.getDiscoveryType(), clusterName));
           
            AstyanaxContext<Cluster> context = new AstyanaxContext.Builder()
                .forCluster(clusterName)
                .withAstyanaxConfiguration(configurationProvider.get(clusterName))
                .withConnectionPoolConfiguration(cpProvider.get(clusterName))
                .withConnectionPoolMonitor(monitorProvider.get(clusterName))
                .withHostSupplier(hostSupplierProvider.getSupplier(clusterName))
                .buildCluster(ThriftFamilyFactory.getInstance());
           
            holder = new ClusterContextHolder(context);
            holder.start();
        }
View Full Code Here

Examples of com.netflix.paas.cassandra.provider.HostSupplierProvider

            if (discoveryType==null || discoveryType.equals("")) discoveryType = configuration.getString(String.format(DISCOVERY_TYPE_FORMAT, "configuration"));
            Preconditions.checkNotNull(clusterName,   "Missing cluster name for schema " + schemaName + " " + String.format(CLUSTER_NAME_FORMAT,schemaName));
            Preconditions.checkNotNull(keyspaceName,  "Missing cluster name for schema " + schemaName + " " + String.format(KEYSPACE_NAME__FORMAT,schemaName));
            Preconditions.checkNotNull(discoveryType, "Missing cluster name for schema " + schemaName + " " + String.format(DISCOVERY_TYPE_FORMAT,schemaName));
           
            HostSupplierProvider hostSupplierProvider = hostSupplierProviders.get(discoveryType);
            Preconditions.checkNotNull(hostSupplierProvider,
                    String.format("Unknown host supplier provider '%s' for schema '%s'", discoveryType, schemaName));
           
            AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
                .forCluster(clusterName)
                .forKeyspace(keyspaceName)
                .withAstyanaxConfiguration(configurationProvider.get(schemaName))
                .withConnectionPoolConfiguration(cpProvider.get(schemaName))
                .withConnectionPoolMonitor(monitorProvider.get(schemaName))
                .withHostSupplier(hostSupplierProvider.getSupplier(clusterName))
                .buildKeyspace(ThriftFamilyFactory.getInstance());
            context.start();
            try {
                context.getClient().createKeyspace(defaultKsOptions);
            } catch (ConnectionException e) {
View Full Code Here

Examples of com.netflix.paas.cassandra.provider.HostSupplierProvider

        if (holder == null) {
            Preconditions.checkNotNull(key.getClusterName(),   "Missing cluster name for schema " + schemaName);
            Preconditions.checkNotNull(key.getKeyspaceName()"Missing cluster name for schema " + schemaName);
            Preconditions.checkNotNull(key.getDiscoveryType(), "Missing cluster name for schema " + schemaName);
           
            HostSupplierProvider hostSupplierProvider = hostSupplierProviders.get(key.getDiscoveryType());
            Preconditions.checkNotNull(hostSupplierProvider, "Unknown host supplier provider " + key.getDiscoveryType());
           
            AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
                .forCluster(key.getClusterName())
                .forKeyspace(key.getKeyspaceName())
                .withAstyanaxConfiguration(configurationProvider.get(schemaName))
                .withConnectionPoolConfiguration(cpProvider.get(schemaName))
                .withConnectionPoolMonitor(monitorProvider.get(schemaName))
                .withHostSupplier(hostSupplierProvider.getSupplier(key.getClusterName()))
                .buildKeyspace(ThriftFamilyFactory.getInstance());
           
            holder = new KeyspaceContextHolder(context);
            contextMap.put(schemaName, holder);
            holder.start();
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.