Package com.datastax.driver.core

Examples of com.datastax.driver.core.Metadata


        this.sendToDaemon = sendToDaemon;
    }

    public SmartThriftClient getSmartThriftClient()
    {
        Metadata metadata = getJavaDriverClient().getCluster().getMetadata();
        return new SmartThriftClient(this, schema.keyspace, metadata);
    }
View Full Code Here


        this.sendToDaemon = sendToDaemon;
    }

    public SmartThriftClient getSmartThriftClient()
    {
        Metadata metadata = getJavaDriverClient().getCluster().getMetadata();
        return new SmartThriftClient(this, schema.keyspace, metadata);
    }
View Full Code Here

        return tclient;
    }

    private SmartThriftClient getSmartThriftClient()
    {
        Metadata metadata = getJavaDriverClient().getCluster().getMetadata();
        return new SmartThriftClient(this, schema.keyspace, metadata);
    }
View Full Code Here

   * @param tableName of the Cassandra table to check for.
   * @return Whether the table exists.
   */
  public boolean tableExists(CassandraTableName tableName) {
    Preconditions.checkNotNull(getSession());
    Metadata metadata = getSession().getCluster().getMetadata();

    String keyspace = CassandraTableName.getKeyspace(mKijiURI);

    if (null == metadata.getKeyspace(keyspace)) {
      assert(!keyspaceExists(CassandraTableName.getKeyspace(mKijiURI)));
      return false;
    }

    return metadata.getKeyspace(keyspace).getTable(tableName.getTable()) != null;
  }
View Full Code Here

        return tclient;
    }

    private SmartThriftClient getSmartThriftClient()
    {
        Metadata metadata = getJavaDriverClient().getCluster().getMetadata();
        return new SmartThriftClient(this, schema.keyspace, metadata);
    }
View Full Code Here

        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Connected to Cassandra cluster {} with {} hosts", cluster.getClusterName(), cluster.getMetadata().getAllHosts().size());
        }

        try {
            Metadata meta = cluster.getMetadata();
            Field fClusterManager = Metadata.class.getDeclaredField("cluster");
            fClusterManager.setAccessible(true);
            Object clusterManager = fClusterManager.get(meta);
            Field fConnectionFactory = clusterManager.getClass().getDeclaredField("connectionFactory");
            fConnectionFactory.setAccessible(true);
View Full Code Here

    @Override public CqlTable getCqlTable() {
        return cqlTable;
    }

    @Override public CqlStatementList getAlterDDL(Cluster cluster) {
        Metadata meta = cluster.getMetadata();
        KeyspaceMetadata keyspaceMeta = meta.getKeyspace(cqlTable.getKeyspace());
        if (keyspaceMeta == null) {
            throw new ModelRuntimeException("Keyspace " + cqlTable.getKeyspace() + " does not exist");
        }
        return getAlterDDL(keyspaceMeta);
    }
View Full Code Here

    }
  }

  protected void createTables(boolean dropTables, boolean dropUnused) {

    Metadata md = session.getCluster().getMetadata();
    KeyspaceMetadata kmd = md.getKeyspace(keyspaceName);

    // TODO: fix this with KeyspaceIdentifier
    if (kmd == null) { // try lower-cased keyspace name
      kmd = md.getKeyspace(keyspaceName.toLowerCase());
    }

    if (kmd == null) {
      throw new IllegalStateException(String.format("keyspace [%s] does not exist", keyspaceName));
    }
View Full Code Here

    }

    @Override
    public void start() {
        Cluster cluster = Cluster.builder().addContactPoint(address).build();
        Metadata metadata = cluster.getMetadata();
        LOGGER.debug("Connected to cluster: {0}", metadata.getClusterName());
        for (Host host : metadata.getAllHosts()) {
            LOGGER.debug("Datacenter: {0}; Host: {1}; Rack: {2}", host.getDatacenter(), host.getAddress(), host.getRack());
        }

        session = cluster.connect();
        try {
View Full Code Here

    private void initDB() {
        cluster = Cluster.builder()
                .addContactPoint("localhost")
                // .withSSL() // Uncomment if using client to node encryption
                .build();
        Metadata metadata = cluster.getMetadata();
        System.out.printf("Connected to cluster: %s\n", metadata.getClusterName());
        for (Host host : metadata.getAllHosts()) {
            System.out.printf("Datacenter: %s; Host: %s; Rack: %s\n",
                    host.getDatacenter(), host.getAddress(), host.getRack());
        }
        session = cluster.connect();
        session.execute("CREATE KEYSPACE IF NOT EXISTS test WITH replication "
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.Metadata

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.