Examples of SlicePredicate


Examples of org.apache.cassandra.thrift.SlicePredicate

  @Override
  public <SN, N> Mutator<K> addSubDelete(K key, String cf, SN sColumnName,
      N columnName, Serializer<SN> sNameSerializer,
      Serializer<N> nameSerializer, long clock) {
    Deletion d = new Deletion().setTimestamp(clock);
    SlicePredicate predicate = new SlicePredicate();
    predicate.addToColumn_names(nameSerializer.toByteBuffer(columnName));
    d.setPredicate(predicate);
    d.setSuper_column(sNameSerializer.toByteBuffer(sColumnName));
    getPendingMutations().addDeletion(key, Arrays.asList(cf), d);
    return this;
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    sliceRange.setStart(new byte[0]);
    sliceRange.setFinish(new byte[0]);
    sliceRange.setCount(columnCount + 1);
   
   
    SlicePredicate slicePredicate = new SlicePredicate();
    slicePredicate.setSlice_range(sliceRange);
   
    // Set row range from request
    KeyRange range = new KeyRange(count + 1);
    if (start.length() > 0) {
      range.setStart_key(Hex.decodeHex(start.toCharArray()));
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

            ConfigHelper.setRpcPort(job.getConfiguration(), "9160");
            ConfigHelper.setInitialAddress(job.getConfiguration(), "localhost");
            ConfigHelper.setPartitioner(job.getConfiguration(), "org.apache.cassandra.dht.RandomPartitioner");
            ConfigHelper.setInputColumnFamily(job.getConfiguration(), KEYSPACE, COLUMN_FAMILY);
            SlicePredicate predicate = new SlicePredicate().setColumn_names(Arrays.asList(ByteBufferUtil.bytes(columnName)));
            ConfigHelper.setInputSlicePredicate(job.getConfiguration(), predicate);

            job.waitForCompletion(true);
        }
        return 0;
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    private void testRangeSliceCommandWrite() throws IOException
    {
        ByteBuffer startCol = ByteBufferUtil.bytes("Start");
        ByteBuffer stopCol = ByteBufferUtil.bytes("Stop");
        ByteBuffer emptyCol = ByteBufferUtil.bytes("");
        SlicePredicate namesPred = new SlicePredicate();
        namesPred.column_names = Statics.NamedCols;
        SliceRange emptySliceRange = new SliceRange(emptyCol, emptyCol, false, 100);
        SliceRange nonEmptySliceRange = new SliceRange(startCol, stopCol, true, 100);
        SlicePredicate emptyRangePred = new SlicePredicate();
        emptyRangePred.slice_range = emptySliceRange;
        SlicePredicate nonEmptyRangePred = new SlicePredicate();
        nonEmptyRangePred.slice_range = nonEmptySliceRange;
        IPartitioner part = StorageService.getPartitioner();
        AbstractBounds<RowPosition> bounds = new Range<Token>(part.getRandomToken(), part.getRandomToken()).toRowBounds();
       
        Message namesCmd = new RangeSliceCommand(Statics.KS, "Standard1", null, namesPred, bounds, 100).getMessage(MessagingService.version_);
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

                   ? new Range<RowPosition>(startKey, finishKey)
                   : new ExcludingBounds<RowPosition>(startKey, finishKey);
        }

        // 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

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

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

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

Examples of org.apache.cassandra.thrift.SlicePredicate

            String columnFamily = in.readUTF();

            TDeserializer dser = new TDeserializer(new TBinaryProtocol.Factory());
            IndexClause indexClause = new IndexClause();
            FBUtilities.deserialize(dser, indexClause, in);
            SlicePredicate predicate = new SlicePredicate();
            FBUtilities.deserialize(dser, predicate, in);
            AbstractBounds<RowPosition> range = AbstractBounds.serializer().deserialize(in, version).toRowBounds();
            return new IndexScanCommand(keyspace, columnFamily, indexClause, predicate, range);
        }
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

            dis.readFully(buf);
            superColumn = ByteBuffer.wrap(buf);
        }

        TDeserializer dser = new TDeserializer(new TBinaryProtocol.Factory());
        SlicePredicate pred = new SlicePredicate();
        FBUtilities.deserialize(dser, pred, dis);

        List<IndexExpression> rowFilter = null;
        if (version >= MessagingService.VERSION_11)
        {
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    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

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    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
TOP
Copyright © 2018 www.massapi.com. 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.