Package com.datastax.driver.core

Examples of com.datastax.driver.core.Cluster$Manager$ClusterShutdownFuture


    }
    @Provides
    @Named("pooledmetacluster")
    Cluster providePooledCluster(@Named("paas.cassclient") String clientType,@Named("paas.metacluster") String clustername) {
        if (clientType.equals("cql")) {
        Cluster cluster = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())).addContactPoint(clustername).build();
//        Cluster cluster = Cluster.builder().addContactPoint(clustername).build();
        return cluster;
        }else {
            return null;
        }
View Full Code Here


    }
    @Provides
    Cluster provideCluster(@Named("clustername") String clustername) {
        //String nodes = eureka.getNodes(clustername);
        //get nodes in the cluster, to pass as parameters to the underlying apis
        Cluster cluster = Cluster.builder().addContactPoint("localhost").build();
        return cluster;
    }
View Full Code Here

        } else {
            CassandraStorage cassStorage = new CassandraStorage(storageConf);
            if (clientType.equals(CLIENTTYPE.ASTYANAX.getType())) {
                return new AstyanaxCassandraConnection(cassStorage.getCluster(), db, hs);
            } else {
            Cluster cluster = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())).addContactPoint(cassStorage.getCluster()).build();
            return new CassandraConnection(cluster);
            }
        }
    }
View Full Code Here

    }
    @Provides
    @Named("metacluster")
    Cluster provideCluster(@Named("staash.cassclient") String clientType,@Named("staash.metacluster") String clustername) {
        if (clientType.equals("cql")) {
        Cluster cluster = Cluster.builder().addContactPoint(clustername).build();
        return cluster;
        } else return null;
    }
View Full Code Here

        return keyspace;
    }
    @Provides
    @Named("datacluster")
    Cluster provideDataCluster(@Named("staash.datacluster") String clustername) {       
        Cluster cluster = Cluster.builder().addContactPoint(clustername).build();
        return cluster;
    }   
View Full Code Here

    }
    @Provides
    @Named("pooledmetacluster")
    Cluster providePooledCluster(@Named("staash.cassclient") String clientType,@Named("staash.metacluster") String clustername) {
        if (clientType.equals("cql")) {
        Cluster cluster = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())).addContactPoint(clustername).build();
        return cluster;
        }else {
            return null;
        }
    }
View Full Code Here

                e.printStackTrace();
            }
        }
        String query = select().all().from(db, table).where(eq(keycol, key))
                .getQueryString();
        Cluster cluster = Cluster.builder().addContactPoints("localhost").build();
        Session session = cluster.connect(db);
        ResultSet rs = session.execute(query);
        return convertResultSet(rs);
    }
View Full Code Here

        // TODO Auto-generated method stub
        Long periodicity = 100L;
        Long rowKey = (Long.valueOf(evTime)/periodicity)*periodicity;
        String query = select().all().from(db, table).where(eq("key", String.valueOf(rowKey))).and(eq("column1",Long.valueOf(evTime)))
                .getQueryString();
        Cluster cluster = Cluster.builder().addContactPoints("localhost").build();
        Session session = cluster.connect(db);
        ResultSet rs = session.execute(query);
        return convertResultSet(rs);
    }
View Full Code Here

      clusterBuilder.withAuthProvider(
          new PlainTextAuthProvider(cassandraKijiURI.getUsername(), cassandraKijiURI.getPassword())
      );
    }

    final Cluster cluster = clusterBuilder.build();
    final Session cassandraSession = cluster.connect();
    return new DefaultCassandraAdmin(cassandraSession, kijiURI);
  }
View Full Code Here

      socketOptions.setReadTimeoutMillis(0);
      // This defaults to 5 s.  Increase to a minute.
      socketOptions.setConnectTimeoutMillis(60 * 1000);


      Cluster cluster = Cluster.builder()
          .addContactPoints(DatabaseDescriptor.getListenAddress())
          .withPort(DatabaseDescriptor.getNativeTransportPort())
          .withSocketOptions(socketOptions)
          // Let's at least log all of the retries so we can see what is happening.
          .withRetryPolicy(new LoggingRetryPolicy(Policies.defaultRetryPolicy()))
          // The default reconnection policy (exponential) looks fine.
          .build();
      mCassandraSession = cluster.connect();
    } catch (Exception exc) {
      throw new KijiIOException(
          "Started embedded C* service, but cannot connect to cluster. " + exc);
    }
  }
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.Cluster$Manager$ClusterShutdownFuture

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.