Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.SliceRange


      Cassandra.Client cassandraClient = null;
      try {
         cassandraClient = dataSource.getConnection();
         Set<InternalCacheEntry> s = new HashSet<InternalCacheEntry>();
         SlicePredicate slicePredicate = new SlicePredicate();
         slicePredicate.setSlice_range(new SliceRange(ByteBuffer.wrap(entryColumnPath.getColumn()),
                  ByteBufferUtil.EMPTY_BYTE_BUFFER, false, 1));
         String startKey = "";

         // Get the keys in SLICE_SIZE blocks
         int sliceSize = Math.min(SLICE_SIZE, numEntries);
View Full Code Here


      Cassandra.Client cassandraClient = null;
      try {
         cassandraClient = dataSource.getConnection();
         Set<Object> s = new HashSet<Object>();
         SlicePredicate slicePredicate = new SlicePredicate();
         slicePredicate.setSlice_range(new SliceRange(ByteBuffer.wrap(entryColumnPath.getColumn()),
                  ByteBufferUtil.EMPTY_BYTE_BUFFER, false, 1));
         String startKey = "";
         boolean complete = false;
         // Get the keys in SLICE_SIZE blocks
         while (!complete) {
View Full Code Here

   public void clear() throws CacheLoaderException {
      Cassandra.Client cassandraClient = null;
      try {
         cassandraClient = dataSource.getConnection();
         SlicePredicate slicePredicate = new SlicePredicate();
         slicePredicate.setSlice_range(new SliceRange(ByteBuffer.wrap(entryColumnPath.getColumn()),
                  ByteBufferUtil.EMPTY_BYTE_BUFFER, false, 1));
         String startKey = "";
         boolean complete = false;
         // Get the keys in SLICE_SIZE blocks
         while (!complete) {
View Full Code Here

      try {
         cassandraClient = dataSource.getConnection();
         // We need to get all supercolumns from the beginning of time until
         // now, in SLICE_SIZE chunks
         SlicePredicate predicate = new SlicePredicate();
         predicate.setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil
                  .bytes(System.currentTimeMillis()), false, SLICE_SIZE));
         Map<ByteBuffer, Map<String, List<Mutation>>> mutationMap = new HashMap<ByteBuffer, Map<String, List<Mutation>>>();
         for (boolean complete = false; !complete;) {
            // Get all columns
            List<ColumnOrSuperColumn> slice = cassandraClient.get_slice(expirationKey,
View Full Code Here

        conf = job.getConfiguration();
        setLocationFromUri(location);

        if (ConfigHelper.getInputSlicePredicate(conf) == null)
        {
            SliceRange range = new SliceRange(slice_start, slice_end, slice_reverse, limit);
            SlicePredicate predicate = new SlicePredicate().setSlice_range(range);
            ConfigHelper.setInputSlicePredicate(conf, predicate);
        }
        if (System.getenv(PIG_WIDEROW_INPUT) != null)
            widerows = Boolean.valueOf(System.getenv(PIG_WIDEROW_INPUT));
View Full Code Here

            sp.setColumn_names(new ArrayList<ByteBuffer>(((NamesQueryFilter)predicate).columns));
        }
        else
        {
            SliceQueryFilter sqf = (SliceQueryFilter)predicate;
            sp.setSlice_range(new SliceRange(sqf.start(), sqf.finish(), sqf.reversed, sqf.count));
        }
        return sp;
    }
View Full Code Here

        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();
View Full Code Here

        {
            throw new IOException("Expected 'cassandra://<keyspace>/<columnfamily>': " + e.getMessage());
        }

        // and configure
        SliceRange range = new SliceRange(BOUND, BOUND, false, LIMIT);
        SlicePredicate predicate = new SlicePredicate().setSlice_range(range);
        conf = job.getConfiguration();
        ConfigHelper.setInputSlicePredicate(conf, predicate);
        ConfigHelper.setInputColumnFamily(conf, ksname, cfname);
View Full Code Here

            final SortedSet<byte[]> columnNameSet = new TreeSet<byte[]>(comparator);
            columnNameSet.addAll(predicate.column_names);
            return new NamesQueryFilter(columnNameSet);
        }

        SliceRange range = predicate.slice_range;
        return new SliceQueryFilter(range.start, range.finish, range.reversed, range.count);
    }
View Full Code Here

    {
        SlicePredicate thriftSlicePredicate = new SlicePredicate();

        if (isColumnRange())
        {
            SliceRange sliceRange = new SliceRange();
            sliceRange.start = getRequestedBound(Bound.START, variables);
            sliceRange.finish = getRequestedBound(Bound.END, variables);
            sliceRange.reversed = parameters.isColumnsReversed;
            sliceRange.count = -1; // We use this for range slices, where the count is ignored in favor of the global column count
            thriftSlicePredicate.slice_range = sliceRange;
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.SliceRange

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.