Package org.apache.cassandra.db.filter

Examples of org.apache.cassandra.db.filter.QueryPath


        AvroValidation.validateColumn(state().getKeyspace(), parent, column);

        RowMutation rm = new RowMutation(state().getKeyspace(), key);
        try
        {
            rm.add(new QueryPath(parent.column_family.toString(),
                   parent.super_column,
                   column.name),
                   column.value,
                   column.timestamp,
                   column.ttl == null ? 0 : column.ttl);
View Full Code Here


       
        AvroValidation.validateKey(key);
        AvroValidation.validateColumnPath(state().getKeyspace(), columnPath);

        RowMutation rm = new RowMutation(state().getKeyspace(), key);
        rm.delete(new QueryPath(columnPath.column_family.toString(), columnPath.super_column), timestamp);
       
        doInsert(consistencyLevel, rm);
       
        return null;
    }
View Full Code Here

    private static void addColumnOrSuperColumnToRowMutation(RowMutation rm, String cfName, ColumnOrSuperColumn cosc)
    {
        if (cosc.column == null)
        {
            for (Column column : cosc.super_column.columns)
                rm.add(new QueryPath(cfName, cosc.super_column.name, column.name), column.value, column.timestamp);
        }
        else
        {
            rm.add(new QueryPath(cfName, null, cosc.column.name), cosc.column.value, cosc.column.timestamp);
        }
    }
View Full Code Here

        if (del.predicate != null && del.predicate.column_names != null)
        {
            for (ByteBuffer col : del.predicate.column_names)
            {
                if (del.super_column == null && DatabaseDescriptor.getColumnFamilyType(rm.getTable(), cfName) == ColumnFamilyType.Super)
                    rm.delete(new QueryPath(cfName, col), del.timestamp);
                else
                    rm.delete(new QueryPath(cfName, del.super_column, col), del.timestamp);
            }
        }
        else
        {
            rm.delete(new QueryPath(cfName, del.super_column), del.timestamp);
        }
    }
View Full Code Here

                String[] fields = line.split("\1");
                String SuperColumnName = fields[1];
                String ColumnName = fields[2];
                String ColumnValue = fields[3];
                int timestamp = 0;
                columnFamily.addColumn(new QueryPath(cfName,
                                                     ByteBufferUtil.bytes(SuperColumnName),
                                                     ByteBufferUtil.bytes(ColumnName)),
                                       ByteBufferUtil.bytes(ColumnValue),
                                       timestamp);
            }
View Full Code Here

        String keyspace = state().getKeyspace();

        ThriftValidation.validateColumnPath(keyspace, column_path);
        ThriftValidation.validateConsistencyLevel(keyspace, consistency_level);

        QueryPath path = new QueryPath(column_path.column_family, column_path.column == null ? null : column_path.super_column);
        List<ByteBuffer> nameAsList = Arrays.asList(column_path.column == null ? column_path.super_column : column_path.column);
        ThriftValidation.validateKey(key);
        ReadCommand command = new SliceByNamesReadCommand(keyspace, key, path, nameAsList);

        Map<DecoratedKey, ColumnFamily> cfamilies = readColumnFamily(Arrays.asList(command), consistency_level);
View Full Code Here

        ThriftValidation.validateColumnData(state().getKeyspace(), column_parent.column_family, column);

        RowMutation rm = new RowMutation(state().getKeyspace(), key);
        try
        {
            rm.add(new QueryPath(column_parent.column_family, column_parent.super_column, column.name), column.value, column.timestamp, column.ttl);
        }
        catch (MarshalException e)
        {
            throw new InvalidRequestException(e.getMessage());
        }
View Full Code Here

        ThriftValidation.validateKey(key);
        ThriftValidation.validateColumnPathOrParent(state().getKeyspace(), column_path);

        RowMutation rm = new RowMutation(state().getKeyspace(), key);
        rm.delete(new QueryPath(column_path), timestamp);

        doInsert(consistency_level, Arrays.asList(rm));
    }
View Full Code Here

        Table table = Table.open(tableName);
        RowMutation rm = new RowMutation(tableName, key);
        for (ColumnFamilyStore cfstore : table.getColumnFamilyStores())
        {
            ColumnFamily cf = cfstore.getColumnFamily(new IdentityQueryFilter(key, new QueryPath(cfstore.getColumnFamilyName())));
            if (cf != null)
                rm.add(cf);
        }
        Message message = rm.makeRowMutationMessage();
        WriteResponseHandler responseHandler = new WriteResponseHandler(1, tableName);
View Full Code Here

    }

    private static void deleteEndPoint(byte[] endpointAddress, String tableName, byte[] key, long timestamp) throws IOException
    {
        RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, tableName);
        rm.delete(new QueryPath(HINTS_CF, key, endpointAddress), timestamp);
        rm.apply();
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.filter.QueryPath

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.