Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.ColumnPath


            css_.out.println("Invalid row, super column, or column specification.");
            return;
        }
       
        // Perform a get(), print out the results.
        ColumnPath path = createColumnPath(columnFamily, superColumnName, columnName);
        Column column = thriftClient_.get(tableName, key, path, ConsistencyLevel.ONE).column;
        css_.out.printf("=> (column=%s, value=%s, timestamp=%d)\n", formatColumnName(tableName, columnFamily, column),
                        new String(column.value, "UTF-8"), column.timestamp);
    }
View Full Code Here


    {
        Cassandra.Client client = getClient();
        client.set_keyspace(ks);

        ByteBuffer key_user_id = ByteBufferUtil.bytes(key);
        ColumnPath cp = new ColumnPath(cf);
        cp.column = ByteBufferUtil.bytes(colName);

        // read
        ColumnOrSuperColumn got = client.get(key_user_id, cp, ConsistencyLevel.ONE);
        return parseType(validator).getString(got.getColumn().value);
View Full Code Here

         if (!config.autoCreateKeyspace)
            config.poolProperties.setKeySpace(config.keySpace);
         dataSource = new DataSource(config.getPoolProperties());
         readConsistencyLevel = ConsistencyLevel.valueOf(config.readConsistencyLevel);
         writeConsistencyLevel = ConsistencyLevel.valueOf(config.writeConsistencyLevel);
         entryColumnPath = new ColumnPath(config.entryColumnFamily).setColumn(ENTRY_COLUMN_NAME
                  .getBytes(UTF8Charset));
         entryColumnParent = new ColumnParent(config.entryColumnFamily);
         entryKeyPrefix = ENTRY_KEY_PREFIX + (config.isSharedKeyspace() ? cacheName + "_" : "");
         expirationColumnParent = new ColumnParent(config.expirationColumnFamily);
         expirationKey = ByteBufferUtil.bytes(EXPIRATION_KEY
View Full Code Here

        client.set_keyspace(ks);

        ByteBuffer key_user_id = ByteBufferUtil.bytes(key);

        long timestamp = System.currentTimeMillis();
        ColumnPath cp = new ColumnPath(cf);
        ColumnParent par = new ColumnParent(cf);
        cp.column = ByteBufferUtil.bytes(colName);

        // read
        ColumnOrSuperColumn got = client.get(key_user_id, cp, ConsistencyLevel.ONE);
View Full Code Here

        TestRingCache tester = new TestRingCache(keyspace);

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBufferUtil.bytes((rowPrefix + nRows));
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
View Full Code Here

        TestRingCache tester = new TestRingCache(keyspace);

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBufferUtil.bytes((rowPrefix + nRows));
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
View Full Code Here

    {
        Cassandra.Client client = getClient();
        client.set_keyspace(ks);

        ByteBuffer key_user_id = ByteBufferUtil.bytes(key);
        ColumnPath cp = new ColumnPath(cf);
        cp.column = ByteBufferUtil.bytes(colName);

        // read
        ColumnOrSuperColumn got = client.get(key_user_id, cp, ConsistencyLevel.ONE);
        return parseType(validator).getString(got.getColumn().value);
View Full Code Here

        // do some writing.
        final AbstractType comp = ColumnFamily.getComparatorFor("Keyspace1", "Standard1", null);
        for (int i = 0; i < 100; i++)
        {
            RowMutation change = new RowMutation("Keyspace1", ("key" + i).getBytes());
            ColumnPath cp = new ColumnPath("Standard1").setColumn(("colb").getBytes());
            change.add(new QueryPath(cp), ("value" + i).getBytes(), new TimestampClock(0));

            // don't call change.apply().  The reason is that is makes a static call into Table, which will perform
            // local storage initialization, which creates local directories.
            // change.apply();
View Full Code Here

        Column column = new Column("name".getBytes("utf-8"), "Ran".getBytes("UTF-8"), new Clock(timestamp));
       
        client.insert(key_user_id.getBytes(), colParent, column, ConsistencyLevel.ONE);

        // read
        ColumnPath cp = new ColumnPath("Standard1");
        cp.setColumn("name".getBytes("utf-8"));

        ColumnOrSuperColumn got = client.get(key_user_id.getBytes(), cp,
                ConsistencyLevel.ONE);

        // assert
View Full Code Here

        TestRingCache tester = new TestRingCache(keyspace);

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBufferUtil.bytes((rowPrefix + nRows));
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.ColumnPath

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.