Examples of SlicePredicate


Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    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

Examples of org.apache.cassandra.thrift.SlicePredicate

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

Examples of org.apache.cassandra.thrift.SlicePredicate

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

Examples of org.apache.cassandra.thrift.SlicePredicate

        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

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    // get value
    ColumnParent clp = new ColumnParent("Standard2");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);
    List<Column> cols = keyspace.getSlice("testGetSlice", clp, sp);

    assertNotNull(cols);
    assertEquals(100, cols.size());
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    // get value
    ColumnParent clp = new ColumnParent("Super1");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);
    List<SuperColumn> cols = keyspace.getSuperSlice("testGetSuperSlice", clp, sp);

    assertNotNull(cols);
    assertEquals(2, cols.size());
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

      keys.add("testMultigetSlice_" + i);
    }
    // get value
    ColumnParent clp = new ColumnParent("Standard1");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);
    Map<String, List<Column>> ms = se.fromBytesMap(keyspace.multigetSlice(se.toBytesList(keys), clp, sp));
    for (int i = 0; i < 100; i++) {
      List<Column> cl = ms.get(keys.get(i));
      assertNotNull(cl);
      assertEquals(1, cl.size());
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    // get value
    ColumnParent clp = new ColumnParent("Standard2");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);
    /*
    @SuppressWarnings("deprecation")
    Map<String, List<Column>> keySlices = keyspace.getRangeSlice(clp, sp, "testGetRangeSlice0", "testGetRangeSlice3", 5);

    assertNotNull(keySlices);
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    // get value
    ColumnParent clp = new ColumnParent("Standard2");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);

    KeyRange range = new KeyRange();
    range.setStart_key( "".getBytes());
    range.setEnd_key( "".getBytes());
View Full Code Here

Examples of org.apache.cassandra.thrift.SlicePredicate

    }

    // get value
    ColumnParent clp = new ColumnParent("Super1");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);

    /*
    @SuppressWarnings("deprecation")
    Map<String, List<SuperColumn>> keySlices = keyspace.getSuperRangeSlice(clp, sp,
        "testGetSuperRangeSlice0", "testGetSuperRangeSlice3", 5);
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.