Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.SlicePredicate$SlicePredicateTupleScheme


        // start/finish
        sliceRange.setStart(start).setFinish(finish);
        // reversed/count
        sliceRange.setReversed(false).setCount(order);
        // initialize SlicePredicate with existing SliceRange
        SlicePredicate predicate = new SlicePredicate().setSlice_range(sliceRange);
        ColumnParent parent = new ColumnParent(cfName);
        return client.get_slice(keyBuffer, parent, predicate, cl);
    }
View Full Code Here


    private List<Row> multiRangeSlice(List<ByteBuffer> variables) throws InvalidRequestException, TimedOutException, UnavailableException
    {
        List<Row> rows;

        // XXX: Our use of Thrift structs internally makes me Sad. :(
        SlicePredicate thriftSlicePredicate = makeSlicePredicate(variables);
        QueryProcessor.validateSlicePredicate(cfDef.cfm, thriftSlicePredicate);

        List<IndexExpression> expressions = getIndexExpressions(variables);

        try
View Full Code Here

    }

    private SlicePredicate makeSlicePredicate(List<ByteBuffer> variables)
    throws InvalidRequestException
    {
        SlicePredicate thriftSlicePredicate = new SlicePredicate();

        if (isColumnRange())
        {
            SliceRange sliceRange = new SliceRange();
            sliceRange.start = getRequestedBound(isReversed ? Bound.END : Bound.START, variables);
View Full Code Here

    }

    @Override
    public void run(final ThriftClient client) throws IOException
    {
        final SlicePredicate predicate = new SlicePredicate()
                .setSlice_range(
                        new SliceRange(
                                ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                false,
View Full Code Here

        super(state, index);
    }

    public void run(final ThriftClient client) throws IOException
    {
        final SlicePredicate predicate = slicePredicate();
        final ByteBuffer key = getKey();
        for (final ColumnParent parent : state.columnParents)
        {

            timeWithRetry(new RunOp()
View Full Code Here

        super(state, index);
    }

    public void run(final ThriftClient client) throws IOException
    {
        final SlicePredicate predicate = slicePredicate();
        final ByteBuffer key = getKey();
        final List<ByteBuffer> expect = state.rowGen.isDeterministic() ? generateColumnValues(key) : null;
        for (final ColumnParent parent : state.columnParents)
        {
            timeWithRetry(new RunOp()
View Full Code Here

    }

    public void run(final ThriftClient client) throws IOException
    {

        final SlicePredicate predicate = new SlicePredicate().setSlice_range(
                new SliceRange(
                        ByteBufferUtil.EMPTY_BYTE_BUFFER,
                        ByteBufferUtil.EMPTY_BYTE_BUFFER,
                        false,
                        state.settings.columns.maxColumnsPerKey
View Full Code Here

    // batch_mutate delete by key
    for (int i = 0; i < 10; i++) {
      ArrayList<Mutation> mutations = new ArrayList<Mutation>(10);
      Map<String, List<Mutation>> mutationMap = new HashMap<String, List<Mutation>>();
      SlicePredicate slicePredicate = new SlicePredicate();
      for (int j = 0; j < 10; j++) {
        slicePredicate.addToColumn_names(StringSerializer.get().toByteBuffer("testBatchMutateColumn_" + j));
      }
      Mutation mutation = new Mutation();
      Deletion deletion = new Deletion(connectionManager.createClock());
      deletion.setPredicate(slicePredicate);
      mutation.setDeletion(deletion);
View Full Code Here

      }
    }
    batchMutation = new BatchMutation<String>(StringSerializer.get());
    // batch_mutate delete by key
    for (int i = 0; i < 10; i++) {
      SlicePredicate slicePredicate = new SlicePredicate();
      for (int j = 0; j < 10; j++) {
        slicePredicate.addToColumn_names(StringSerializer.get().toByteBuffer("testBatchMutateColumn_" + j));
      }
      Deletion deletion = new Deletion(connectionManager.createClock());
      deletion.setPredicate(slicePredicate);
      batchMutation.addDeletion("testBatchMutateColumn_" + i, columnFamilies, deletion);
    }
View Full Code Here

        Column col = new Column(StringSerializer.get().toByteBuffer("testBatchMutateColumn_" + j),
            StringSerializer.get().toByteBuffer("testBatchMutateColumn_value_" + j), connectionManager.createClock());
        batchMutation.addInsertion("testBatchMutateColumn_" + i, columnFamilies, col);
      }
    }
    SlicePredicate slicePredicate = new SlicePredicate();
    slicePredicate.addToColumn_names(StringSerializer.get().toByteBuffer("deleteThroughInserBatch_col"));

    Deletion deletion = new Deletion(connectionManager.createClock());
    deletion.setPredicate(slicePredicate);

    batchMutation.addDeletion("deleteThroughInserBatch_key", columnFamilies, deletion);
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.SlicePredicate$SlicePredicateTupleScheme

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.