Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.ColumnParent$ColumnParentStandardSchemeFactory


        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBufferUtil.bytes((rowPrefix + nRows));
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
                              new String(row.array()), StringUtils.join(endpoints, ","), firstEndpoint);
View Full Code Here


   
    Client client = clientProvider.getThriftClient();
    // set target keyspace.
    client.set_keyspace(keyspaceName);
    // set target column family
    ColumnParent parent = new ColumnParent(columnFamilyName);
    // create target range
    SliceRange sliceRange = new SliceRange();
    sliceRange.setStart(new byte[0]);
    sliceRange.setFinish(new byte[0]);
    sliceRange.setCount(columnCount + 1);
View Full Code Here

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBufferUtil.bytes((rowPrefix + nRows));
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
                              new String(row.array()), StringUtils.join(endpoints, ","), firstEndpoint);
View Full Code Here

        // to make sure we have SSTable
        cfs.forceBlockingFlush();

        // reads to cache key position
        cfs.getColumnFamily(QueryFilter.getSliceFilter(key1,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));

        cfs.getColumnFamily(QueryFilter.getSliceFilter(key2,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));

        assert CacheService.instance.keyCache.size() == 2;

        Util.compactAll(cfs).get();
        keyCacheSize = CacheService.instance.keyCache.size();
        // after compaction cache should have entries for
        // new SSTables, if we had 2 keys in cache previously it should become 4
        assert keyCacheSize == 4 : keyCacheSize;

        // re-read same keys to verify that key cache didn't grow further
        cfs.getColumnFamily(QueryFilter.getSliceFilter(key1,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));

        cfs.getColumnFamily(QueryFilter.getSliceFilter(key2,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));
View Full Code Here

       String tableName = CliCompiler.getTableName(columnFamilySpec);
       String key = CliCompiler.getKey(columnFamilySpec);
       String columnFamily = CliCompiler.getColumnFamily(columnFamilySpec);
       int columnSpecCnt = CliCompiler.numColumnSpecifiers(columnFamilySpec);
      
       ColumnParent colParent;
      
       if (columnSpecCnt == 0)
       {
           colParent = createColumnParent(columnFamily, null);
       }
View Full Code Here

       String tableName = CliCompiler.getTableName(columnFamilySpec);
       String key = CliCompiler.getKey(columnFamilySpec);
       String columnFamily = CliCompiler.getColumnFamily(columnFamilySpec);
       int columnSpecCnt = CliCompiler.numColumnSpecifiers(columnFamilySpec);
      
       ColumnParent colParent;
      
       if (columnSpecCnt == 0)
       {
           colParent = createColumnParent(columnFamily, null);
       }
View Full Code Here

    }

    public List<KeySlice> indexGet(ByteBuffer columnName, ByteBuffer value, ByteBuffer startOffset, int limit, boolean isReverse) throws Exception
    {
        SlicePredicate predicate = new SlicePredicate().setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil.EMPTY_BYTE_BUFFER, isReverse, limit));
        ColumnParent parent = new ColumnParent(cfName);
        IndexExpression expression = new IndexExpression(columnName, IndexOperator.EQ, value);
        IndexClause clause = new IndexClause(Arrays.asList(expression), startOffset, limit);
        return client.get_indexed_slices(parent, clause, predicate, cl);
    }
View Full Code Here

    }

    public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiGet(List<ByteBuffer> keys, int limit) throws Exception
    {
        SlicePredicate predicate = new SlicePredicate().setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, limit));
        ColumnParent parent = new ColumnParent(cfName);
        return client.multiget_slice(keys, parent, predicate, cl);
    }
View Full Code Here

    }

    public List<KeySlice> getRangeSlice(ByteBuffer start, ByteBuffer end, int limit) throws Exception
    {
        SlicePredicate predicate = new SlicePredicate().setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, limit));
        ColumnParent parent = new ColumnParent(cfName);
        KeyRange range = new KeyRange(limit).setStart_key(start).setEnd_key(end);
        return client.get_range_slices(parent, predicate, range, cl);
    }
View Full Code Here

    public List<ColumnOrSuperColumn> getSlice(ByteBuffer key, ByteBuffer start, ByteBuffer end, int limit, boolean isReverse) throws Exception
    {
        SliceRange sliceRange = new SliceRange().setStart(start).setFinish(end).setReversed(isReverse).setCount(limit);
        // initialize SlicePredicate with existing SliceRange
        SlicePredicate predicate = new SlicePredicate().setSlice_range(sliceRange);
        ColumnParent parent = new ColumnParent(cfName);
        return client.get_slice(key, parent, predicate, cl);
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.ColumnParent$ColumnParentStandardSchemeFactory

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.