Examples of ColumnPath


Examples of org.apache.cassandra.service.ColumnPath

    {
        String table = "Keyspace1";
        for (int nRows=1; nRows<10; nRows++)
        {
            String row = "row" + nRows;
            ColumnPath col = new ColumnPath("Standard1", null, "col1".getBytes());

            List<InetAddress> endPoints = ringCache.getEndPoint(row);
            String hosts="";
            for (int i = 0; i < endPoints.size(); i++)
                hosts = hosts + ((i > 0) ? "," : "") + endPoints.get(i);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnPath

        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

Examples of org.apache.cassandra.thrift.ColumnPath

        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

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

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

Examples of org.apache.cassandra.thrift.ColumnPath

        return client.get_slice(key, parent, predicate, cl);
    }

    public ColumnOrSuperColumn get(ByteBuffer key, ByteBuffer column) throws Exception
    {
        ColumnPath cp = new ColumnPath().setColumn_family(cfName).setColumn(column);
        return client.get(key, cp, cl);
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnPath

    {
        ByteBuffer rKey = kser.toByteBuffer(key);
        ByteBuffer name = colser.toByteBuffer(colName);
        ByteBuffer val = valser.toByteBuffer(value);
        RowMutation change = new RowMutation(ks, rKey);
        ColumnPath cp = new ColumnPath(cf).setColumn(name);
        change.add(new QueryPath(cp), val, System.currentTimeMillis());
        try
        {
            StorageProxy.mutate(Arrays.asList(change), wConsistecy);
        }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnPath

        RowMutation change = new RowMutation(ks, rKey);
        for (Map.Entry entry : nv.entrySet())
        {
            ByteBuffer name = colser.toByteBuffer(entry.getKey());
            ByteBuffer val = valser.toByteBuffer(entry.getValue());
            ColumnPath cp = new ColumnPath(cf).setColumn(name);
            change.add(new QueryPath(cp), val, System.currentTimeMillis());
        }
        try
        {
            StorageProxy.mutate(Arrays.asList(change), wConsistecy);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnPath

        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

Examples of org.apache.cassandra.thrift.ColumnPath

    {
        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
TOP
Copyright © 2018 www.massapi.com. 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.