Package org.apache.cassandra.thrift

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


      keyspace.insert("testGetSuperRangeSlice0", cp, StringSerializer.get().toByteBuffer("testGetSuperRangeSlice_Value_" + i));
      keyspace.insert("testGetSuperRangeSlice1", cp, StringSerializer.get().toByteBuffer("testGetSuperRangeSlice_Value_" + i));
    }

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

    /*
 
View Full Code Here


      keyspace.insert("testGetSuperRangeSlices0", cp, StringSerializer.get().toByteBuffer("testGetSuperRangeSlices_Value_" + i));
      keyspace.insert("testGetSuperRangeSlices1", cp, StringSerializer.get().toByteBuffer("testGetSuperRangeSlices_Value_" + i));
    }

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

    KeyRange range = new KeyRange();
View Full Code Here

        keys.add(StringSerializer.get().toByteBuffer("testMultigetCount_key_"+j));
      }
    }

    // get value
    ColumnParent clp = new ColumnParent("Standard1");
    SlicePredicate slicePredicate = new SlicePredicate();
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    slicePredicate.setSlice_range(sr);
    Map<ByteBuffer,Integer> counts = keyspace.multigetCount(keys, clp, slicePredicate);
    assertEquals(5,counts.size());
View Full Code Here

          public Rows<K, N,V> doInKeyspace(KeyspaceService ks) throws HectorException {
            List<ByteBuffer> keysList = new ArrayList<ByteBuffer>();
            for (K k : keys) {
              keysList.add(keySerializer.toByteBuffer(k));
            }
            ColumnParent columnParent = new ColumnParent(columnFamilyName);
            Map<K, List<Column>> thriftRet = keySerializer.fromBytesMap(
                ks.multigetSlice(keysList, columnParent, getPredicate()));
            return new RowsImpl<K, N, V>(thriftRet, columnNameSerializer, valueSerializer);
          }
        }), this);
View Full Code Here

        keyspace.doExecute(new KeyspaceOperationCallback<SuperRows<K, SN, N, V>>() {
          @Override
          public SuperRows<K, SN, N, V> doInKeyspace(KeyspaceService ks) throws HectorException {
            List<K> keysList = new ArrayList<K>();
            keysList.addAll(keys);
            ColumnParent columnParent = new ColumnParent(columnFamilyName);
            Map<K, List<SuperColumn>> thriftRet = keySerializer.fromBytesMap(ks.multigetSuperSlice(
                keySerializer.toBytesList(keysList), columnParent, getPredicate()));
            return new SuperRowsImpl<K, SN, N, V>(thriftRet, keySerializer, columnNameSerializer,
                nameSerializer, valueSerializer);
          }
View Full Code Here

        keyspace.doExecute(new KeyspaceOperationCallback<Rows<K, N, V>>() {
          @Override
          public Rows<K, N, V> doInKeyspace(KeyspaceService ks) throws HectorException {
            List<K> keysList = new ArrayList<K>();
            keysList.addAll(keys);
            ColumnParent columnParent = new ColumnParent(columnFamilyName);
            columnParent.setSuper_column(sNameSerializer.toByteBuffer(superColumn));
            Map<K, List<Column>> thriftRet = keySerializer.fromBytesMap(ks.multigetSlice(
                keySerializer.toBytesList(keysList), columnParent, getPredicate()));
            return new RowsImpl<K, N, V>(thriftRet, columnNameSerializer, valueSerializer);
          }
        }), this);
View Full Code Here

            LinkedHashMap<ByteBuffer, List<Column>> ret = null;
            try {
              if (!indexClause.isSetStart_key()) {
                indexClause.setStart_key(new byte[0]);
              }
              ColumnParent columnParent = new ColumnParent(columnFamilyName);
              List<KeySlice> keySlices = client.get_indexed_slices(columnParent, indexClause,
                  getPredicate(), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType)));

              ret = (keySlices == null || keySlices.isEmpty() ) ? new LinkedHashMap<ByteBuffer, List<Column>>(0) :
                new LinkedHashMap<ByteBuffer, List<Column>>(
View Full Code Here

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBuffer.wrap((rowPrefix + nRows).getBytes());
            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

    return predicate;
  }

  public Select addColumnName(String superColumnFamily, String superColumn,
      String columnName) {
    ColumnParent parent = new ColumnParent(superColumnFamily);
    parent.setSuper_column(ByteUtils.toBytes(superColumn));
    SlicePredicate predicate = getOrCreate(parent);
    if (predicate.getSlice_range() != null) {
      // TODO: Make this another exception
      throw new RuntimeException("Can't add columns if slice_range is not null");
    }
View Full Code Here

    predicate.addToColumn_names(ByteUtils.toBytes(columnName));
    return this;
  }

  public Select addColumnName(String columnFamily, String columnName) {
    SlicePredicate predicate = getOrCreate(new ColumnParent(columnFamily));
    if (predicate.getSlice_range() != null) {
      // TODO: Make this another exception
      throw new RuntimeException("Can't add columns if slice_range is not null");
    }
    predicate.addToColumn_names(ByteUtils.toBytes(columnName));
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.