Package com.netflix.paas.cassandra.keys

Examples of com.netflix.paas.cassandra.keys.KeyspaceKey


        Preconditions.checkNotNull(clusterName,      "Must specify cluster name for table "       + table.getTableName());
        Preconditions.checkNotNull(keyspaceName,     "Must specify keyspace name for table "      + table.getTableName());
        Preconditions.checkNotNull(columnFamilyName, "Must specify column family name for table " + table.getTableName());
        Preconditions.checkNotNull(discoveryType,    "Must specify discovery type for table "     + table.getTableName());
       
        Keyspace keyspace = clientProvider.acquireKeyspace(new KeyspaceKey(new ClusterKey(clusterName, discoveryType), keyspaceName));
       
        return new AstyanaxThriftDataTableResource(keyspace, columnFamilyName);
    }
View Full Code Here


        props.setProperty("name", keyspace.getName());
        keyspace.setClusterName(clusterKey.getClusterName());

        try {
            cluster.createKeyspace(props);
            eventBus.post(new KeyspaceUpdateEvent(new KeyspaceKey(clusterKey, keyspace.getName())));
        } catch (ConnectionException e) {
            throw new PaasException(String.format("Error creating keyspace '%s' from cluster '%s'", keyspace.getName(), clusterKey.getClusterName()), e);
        }
    }
View Full Code Here

            props.putAll(keyspace.getOptions());
            props.setProperty("name", keyspace.getName());
            keyspace.setClusterName(clusterKey.getClusterName());
           
            cluster.updateKeyspace(props);
            eventBus.post(new KeyspaceUpdateEvent(new KeyspaceKey(clusterKey, keyspace.getName())));
        } catch (ConnectionException e) {
            throw new PaasException(String.format("Error creating keyspace '%s' from cluster '%s'", keyspace.getName(), clusterKey.getClusterName()), e);
        }
    }
View Full Code Here

        props.setProperty("name",     columnFamily.getName());
        props.setProperty("keyspace", columnFamily.getKeyspaceName());

        try {
            cluster.createColumnFamily(props);
            eventBus.post(new ColumnFamilyUpdateEvent(new ColumnFamilyKey(new KeyspaceKey(clusterKey, keyspaceName), columnFamily.getName())));
        } catch (ConnectionException e) {
            throw new PaasException(String.format("Error creating column family '%s.%s' on cluster '%s'",
                    keyspaceName, columnFamily.getName(), clusterKey.getClusterName()), e);
        }
    }
View Full Code Here

            }
            props.setProperty("name",     columnFamily.getName());
            props.setProperty("keyspace", columnFamily.getKeyspaceName());

            cluster.createColumnFamily(props);
            eventBus.post(new ColumnFamilyUpdateEvent(new ColumnFamilyKey(new KeyspaceKey(clusterKey, keyspaceName), columnFamily.getName())));
        } catch (ConnectionException e) {
            throw new PaasException(String.format("Error creating column family '%s.%s' on cluster '%s'",
                    keyspaceName, columnFamily.getName(), clusterKey.getClusterName()), e);
        }
    }
View Full Code Here

    @Test
    @Ignore
    public void testReadData() throws Exception {
       
        KeyspaceClientProvider clientProvider = injector.getInstance(KeyspaceClientProvider.class);
        Keyspace keyspace = clientProvider.acquireKeyspace(new KeyspaceKey(new ClusterKey(LOCAL_DISCOVERY_TYPE, CLUSTER_NAME), KEYSPACE_NAME));
//       
//        // Create the keyspace and column family
//        keyspace.createKeyspace(new Properties());
//        Properties props = new Properties();
//        props.setProperty("name",                   CF_NAME);
View Full Code Here

TOP

Related Classes of com.netflix.paas.cassandra.keys.KeyspaceKey

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.