Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.ColumnPath


        TestRingCache tester = new TestRingCache(keyspace);

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBuffer.wrap((rowPrefix + nRows).getBytes());
            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

        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

        client.set_keyspace("Keyspace1");

        byte[] key_user_id = "1".getBytes();

        long timestamp = System.currentTimeMillis();
        ColumnPath cp = new ColumnPath("Standard1");
        ColumnParent par = new ColumnParent("Standard1");
        cp.setColumn("name".getBytes("utf-8"));

        // insert
        Clock clock = new Clock();
        clock.setTimestamp(timestamp);
        client.insert(key_user_id, par, new Column("name".getBytes("utf-8"),
View Full Code Here

        TestRingCache tester = new TestRingCache(keyspace);

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

            List<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            String hosts="";
            for (int i = 0; i < endpoints.size(); i++)
View Full Code Here

        // do some writing.
        for (int i = 0; i < 100; i++)
        {
            RowMutation change = new RowMutation("Keyspace1", ByteBuffer.wrap(("key" + i).getBytes()));
            ColumnPath cp = new ColumnPath("Standard1").setColumn(("colb").getBytes());
            change.add(new QueryPath(cp), ByteBuffer.wrap(("value" + i).getBytes()), 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

                ByteBufferUtil.bytes("Ran"), timestamp);
       
        client.insert(ByteBufferUtil.bytes(key_user_id), colParent, column, ConsistencyLevel.ONE);

        // read
        ColumnPath cp = new ColumnPath("Standard1");
        cp.setColumn(ByteBufferUtil.bytes("name"));

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

        // assert
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);
            ColumnPath cp = createColumnPath("Standard1", null, ("colb").getBytes());
            change.add(new QueryPath(cp), ("value" + i).getBytes(), 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

        Cassandra.Client client = getClient();

        String key_user_id = "1";

        long timestamp = System.currentTimeMillis();
        ColumnPath cp = new ColumnPath("Standard1");
        cp.setColumn("name".getBytes("utf-8"));

        // insert
        client.insert("Keyspace1", key_user_id, cp, "Ran".getBytes("UTF-8"),
                timestamp, ConsistencyLevel.ONE);
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.