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 = 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

            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

            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

        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

    {
        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

        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

        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

    {
        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

  IllegalStateException, HNotFoundException, Exception {
    KeyspaceService keyspace = new KeyspaceServiceImpl("Keyspace1", new QuorumAllConsistencyLevelPolicy(),
        connectionManager, FailoverPolicy.ON_FAIL_TRY_ALL_AVAILABLE, user1Credentials);

    // insert value
    ColumnPath cp = new ColumnPath("Standard1");
    cp.setColumn(bytes("testInsertAndGetAndRemove"));
    for (int i = 0; i < 100; i++) {
      keyspace.insert("testInsertAndGetAndRemove_" + i, cp,
          StringSerializer.get().toByteBuffer("testInsertAndGetAndRemove_value_" + i));
    }
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.