Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.Clock


        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"),
                "Ran".getBytes("UTF-8"), clock), ConsistencyLevel.ONE);

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


            System.out.println("hosts with key " + new String(row) + " : " + hosts + "; choose " + endpoints.get(0));

            // now, read the row back directly from the host owning the row locally
            tester.setup(endpoints.get(0).getHostAddress(), DatabaseDescriptor.getRpcPort());
            tester.thriftClient.set_keyspace(keyspace);
            Clock clock = new Clock();
            clock.setTimestamp(1);
            tester.thriftClient.insert(row, parent, new Column("col1".getBytes(), "val1".getBytes(), clock), ConsistencyLevel.ONE);
            Column column = tester.thriftClient.get(row, col, ConsistencyLevel.ONE).column;
            System.out.println("read row " + new String(row) + " " + new String(column.name) + ":" + new String(column.value) + ":" + column.clock.timestamp);
        }
View Full Code Here

        String key_user_id = "1";
        long timestamp = System.currentTimeMillis();  

        // insert
        ColumnParent colParent = new ColumnParent("Standard1");
        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");
View Full Code Here

        }

        Map<String, List<Mutation>> cfMutation = new HashMap<String, List<Mutation>>();
        mutationsByKey.put(key, cfMutation);

        Clock clock = new Clock(System.currentTimeMillis());
        List<Mutation> mutationList = new ArrayList<Mutation>();
        cfMutation.put(ConfigHelper.getOutputColumnFamily(context.getConfiguration()), mutationList);

        if (value == null)
        {
View Full Code Here

TOP

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

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.