Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.KeyRange


    return getKeyRange(range, select);
  }

  public List<Row> getTokenRangeIntl(String startToken, String endToken, int rowCount,
      Select select) throws IOException {
    KeyRange range =
      new KeyRange(rowCount).setStart_token(startToken).setEnd_token(endToken);
    return getKeyRange(range, select);
  }
View Full Code Here


        List<InputSplit> splits = new ArrayList<InputSplit>();

        try
        {
            List<Future<List<InputSplit>>> splitfutures = new ArrayList<Future<List<InputSplit>>>();
            KeyRange jobKeyRange = ConfigHelper.getInputKeyRange(conf);
            Range<Token> jobRange = null;
            if (jobKeyRange != null)
            {
                if (jobKeyRange.start_key == null)
                {
View Full Code Here

                                state.settings.columns.maxColumnsPerKey
                        )
                );

        final ByteBuffer start = getKey();
        final KeyRange range =
                new KeyRange(state.settings.columns.maxColumnsPerKey)
                        .setStart_key(start)
                        .setEnd_key(ByteBufferUtil.EMPTY_BYTE_BUFFER)
                        .setCount(((SettingsCommandMulti)state.settings.command).keysAtOnce);

        for (final ColumnParent parent : state.columnParents)
        {
            timeWithRetry(new RunOp()
            {
                private int count = 0;
                @Override
                public boolean run() throws Exception
                {
                    return (count = client.get_range_slices(parent, predicate, range, state.settings.command.consistencyLevel).size()) != 0;
                }

                @Override
                public String key()
                {
                    return new String(range.bufferForStart_key().array());
                }

                @Override
                public int keyCount()
                {
View Full Code Here

        List<InputSplit> splits = new ArrayList<InputSplit>();

        try
        {
            List<Future<List<InputSplit>>> splitfutures = new ArrayList<Future<List<InputSplit>>>();
            KeyRange jobKeyRange = ConfigHelper.getInputKeyRange(conf);
            IPartitioner partitioner = null;
            Range jobRange = null;
            if (jobKeyRange != null)
            {
                partitioner = ConfigHelper.getPartitioner(context.getConfiguration());
View Full Code Here

     * Set the KeyRange to limit the rows.
     * @param conf Job configuration you are about to run
     */
    public static void setInputRange(Configuration conf, String startToken, String endToken)
    {
        KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken);
        conf.set(INPUT_KEYRANGE_CONFIG, keyRangeToString(range));
    }
View Full Code Here

    private static KeyRange keyRangeFromString(String st)
    {
        assert st != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        KeyRange keyRange = new KeyRange();
        try
        {
            deserializer.deserialize(keyRange, FBUtilities.hexToBytes(st));
        }
        catch (TException e)
View Full Code Here

        List<InputSplit> splits = new ArrayList<InputSplit>();

        try
        {
            List<Future<List<InputSplit>>> splitfutures = new ArrayList<Future<List<InputSplit>>>();
            KeyRange jobKeyRange = ConfigHelper.getInputKeyRange(conf);
            Range<Token> jobRange = null;
            if (jobKeyRange != null && jobKeyRange.start_token != null)
            {
                assert partitioner.preservesOrder() : "ConfigHelper.setInputKeyRange(..) can only be used with a order preserving paritioner";
                assert jobKeyRange.start_key == null : "only start_token supported";
View Full Code Here

        List<InputSplit> splits = new ArrayList<InputSplit>();

        try
        {
            List<Future<List<InputSplit>>> splitfutures = new ArrayList<Future<List<InputSplit>>>();
            KeyRange jobKeyRange = ConfigHelper.getInputKeyRange(conf);
            IPartitioner partitioner = null;
            Range jobRange = null;
            if (jobKeyRange != null)
            {
                partitioner = ConfigHelper.getPartitioner(context.getConfiguration());
View Full Code Here

    public void verifyOutput() throws Exception
    {
        List<KeySlice> keySlices = thriftClient.get_range_slices(new ColumnParent().setColumn_family(COLUMN_FAMILY),
                                                                 new SlicePredicate().setColumn_names(new ArrayList<byte[]>()),
                                                                 new KeyRange().setStart_key("".getBytes()).setEnd_key("".getBytes()),
                                                                 ConsistencyLevel.ONE);
        for (KeySlice keySlice : keySlices)
        {
            Integer key = Integer.parseInt(new String(keySlice.getKey()));
            List<Integer> columnValues = new ArrayList<Integer>();
View Full Code Here

     * Set the KeyRange to limit the rows.
     * @param conf Job configuration you are about to run
     */
    public static void setInputRange(Configuration conf, String startToken, String endToken)
    {
        KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken);
        conf.set(INPUT_KEYRANGE_CONFIG, keyRangeToString(range));
    }
View Full Code Here

TOP

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

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.