Package org.apache.cassandra.thrift

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


                                             final String superColumnName,
                                             CassandraTemplate template,
                                             String keyspaceName) {
        return template.read(keyspaceName, new KeyspaceCallback<SuperColumn>() {
            public SuperColumn execute(KeyspaceService keyspace) {
                ColumnPath columnPath = createColumnPath(columnFamilyName, superColumnName, null);
                try {
                    return keyspace.getSuperColumn(rowKey, columnPath);
                } catch (HNotFoundException e) {
                    return null;
                }
View Full Code Here


                                               String columnName) {
        return createColumnPath(columnFamily, superColumnName == null ? null : bytes(superColumnName), columnName);
    }

    private static ColumnPath createColumnPath(String columnFamily, ByteBuffer superColumnName, String columnName) {
        ColumnPath columnPath = new ColumnPath(columnFamily);
        if (superColumnName != null) {
            columnPath.setSuper_column(superColumnName);
        }
        if (columnName != null) {
            columnPath.setColumn(bytes(columnName));
        }
        return columnPath;
    }
View Full Code Here

    try {
      dataSource = new DataSource(config.getPoolProperties());
      readConsistencyLevel = ConsistencyLevel.valueOf(config.readConsistencyLevel);
      writeConsistencyLevel = ConsistencyLevel.valueOf(config.writeConsistencyLevel);
      entryColumnPath = new ColumnPath(config.entryColumnFamily).setColumn(ENTRY_COLUMN_NAME.getBytes("UTF-8"));
      entryColumnParent = new ColumnParent(config.entryColumnFamily);
      entryKeyPrefix = ENTRY_KEY_PREFIX+(config.isSharedKeyspace()?cacheName+"_":"");
      expirationColumnParent = new ColumnParent(config.expirationColumnFamily);
      expirationKey = EXPIRATION_KEY+(config.isSharedKeyspace()?"_"+cacheName:"");
    } catch (Exception e) {
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

TOP

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

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.