Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.ColumnPath$ColumnPathTupleScheme


        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


        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

                                 final String columnFamilyName,
                                 final String rowKey,
                                 CassandraTemplate template) {
        template.write(keyspaceName, new KeyspaceCallback<Void>() {
            public Void execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, (String) null, null);
                keyspace.remove(rowKey, columnPath);
                return null;
            }
        });
    }
View Full Code Here

                                    final String superColumnName,
                                    final String columnName,
                                    CassandraTemplate template) {
        template.write(keyspaceName, new KeyspaceCallback<Void>() {
            public Void execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, columnName);
                keyspace.remove(rowKey, columnPath);
                return null;
            }
        });
    }
View Full Code Here

                public Void execute(KeyspaceService keyspace) {
                    String colName = null;
                    if (columnNames != null) {
                        colName = columnNames.get(0);
                    }
                    ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, colName);
                    keyspace.remove(rowKey, columnPath);
                    return null;
                }
            });
        } else {
View Full Code Here

                                     final String value,
                                     final CassandraTemplate template,
                                     String keyspaceName) {
        template.write(keyspaceName, new KeyspaceCallback<Void>() {
            public Void execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, propertyName);
                keyspace.insert(rowKey, columnPath, bytes(value));
                return null;
            }
        });
    }
View Full Code Here

                                     final CassandraTemplate template,
                                     String keyspaceName,
                                     ConsistencyLevelPolicy consistencyLevel) {
        template.execute(keyspaceName, new KeyspaceCallback<Void>() {
            public Void execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, propertyName);
                keyspace.insert(rowKey, columnPath, bytes(value));
                return null;
            }
        }, consistencyLevel, false);
    }
View Full Code Here

                                     String keyspaceName,
                                     final int ttlInMinutes) {
        template.write(keyspaceName, new KeyspaceCallback<Void>() {
            public Void execute(KeyspaceService keyspace) {
              int ttlInSeconds = (int) TimeUnit.SECONDS.convert(ttlInMinutes, TimeUnit.MINUTES);
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, propertyName);
                ColumnParent columnParent = new ColumnParent(columnPath.getColumn_family());
                if (columnPath.isSetSuper_column()) {
                  columnParent.setSuper_column(columnPath.getSuper_column());
                }
               
                Column column = new Column(ByteBuffer.wrap(columnPath.getColumn()));
                column.setTtl(ttlInSeconds);
                ByteBuffer key = StringSerializer.get().toByteBuffer(rowKey);
                keyspace.insert(key, columnParent, column);

                return null;
View Full Code Here

                                               final String columnName,
                                               CassandraTemplate template,
                                               String keyspaceName) {
        return template.read(keyspaceName, new KeyspaceCallback<PropertyValue>() {
            public PropertyValue execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, columnName);
                try {
                    Column column = keyspace.getColumn(rowKey, columnPath);
                    // allow for possibility that this could return null instead of throwing not found exception
                    if (column == null) {
                        return null;
View Full Code Here

                                                                      final ByteBuffer superColumnName,
                                                                      CassandraTemplate template,
                                                                      String keyspaceName) {
        return template.read(keyspaceName, new KeyspaceCallback<Map<ByteBuffer, SuperColumn>>() {
            public Map<ByteBuffer, SuperColumn> execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, null);
                return keyspace.multigetSuperColumn(keys, columnPath);
            }
        });
    }
View Full Code Here

TOP

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

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.