Examples of ColumnParent


Examples of org.apache.cassandra.thrift.ColumnParent

        {

            ByteBuffer key = CassandraUtils.hashKeyBytes(indexName.getBytes("UTF-8"), CassandraUtils.delimeterBytes,
                    "shards".getBytes("UTF-8"));

            ReadCommand cmd = new SliceFromReadCommand(CassandraUtils.keySpace, key, new ColumnParent(
                    CassandraUtils.schemaInfoColumnFamily), ByteBufferUtil.EMPTY_BYTE_BUFFER,
                    ByteBufferUtil.EMPTY_BYTE_BUFFER, false, Integer.MAX_VALUE);

            List<Row> rows = CassandraUtils.robustRead(ConsistencyLevel.QUORUM, cmd);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

        ByteBuffer key_user_id = ByteBufferUtil.bytes(key);

        long timestamp = System.currentTimeMillis();
        ColumnPath cp = new ColumnPath(cf);
        ColumnParent par = new ColumnParent(cf);
        cp.column = ByteBufferUtil.bytes(colName);

        // read
        ColumnOrSuperColumn got = client.get(key_user_id, cp, ConsistencyLevel.ONE);
        return parseType(validator).getString(got.getColumn().value);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

  @Test
  public void testInsertSuper() throws IllegalArgumentException, NoSuchElementException,
  IllegalStateException, HNotFoundException, Exception {

    // insert value
    ColumnParent columnParent = new ColumnParent("Super1");
    columnParent.setSuper_column(StringSerializer.get().toByteBuffer("testInsertSuper_super"));
    Column column = new Column(StringSerializer.get().toByteBuffer("testInsertSuper_column"),
        StringSerializer.get().toByteBuffer("testInsertSuper_value"), connectionManager.createClock());


View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

    Operation<SuperColumn> op = new Operation<SuperColumn>(OperationType.READ, failoverPolicy,
        keyspaceName, credentials) {

      @Override
      public SuperColumn execute(Cassandra.Client cassandra) throws HectorException {
        ColumnParent clp = new ColumnParent(columnPath.getColumn_family());
        clp.setSuper_column(columnPath.getSuper_column());

        SlicePredicate sp = new SlicePredicate();
        sp.setSlice_range(sliceRange);

        try {
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

      keyspace.insert("testGetSlice", cp, StringSerializer.get().toByteBuffer("testGetSlice_Value_" + i));
      columnnames.add("testGetSlice_" + i);
    }

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

Examples of org.apache.cassandra.thrift.ColumnParent

  }

  @Override
  public void insert(String key, ColumnPath columnPath, ByteBuffer value) throws HectorException {
//    valideColumnPath(columnPath);
      ColumnParent columnParent = new ColumnParent(columnPath.getColumn_family());
      if (columnPath.isSetSuper_column()) {
        columnParent.setSuper_column(columnPath.getSuper_column());
      }
      Column column = new Column(ByteBuffer.wrap(columnPath.getColumn()), value, connectionManager.createClock());
      insert(StringSerializer.get().toByteBuffer(key), columnParent, column);
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

      keyspace.insert("testGetSuperSlice", cp, StringSerializer.get().toByteBuffer("testGetSuperSlice_Value_" + i));
      keyspace.insert("testGetSuperSlice", cp2, StringSerializer.get().toByteBuffer("testGetSuperSlice_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);
    List<SuperColumn> cols = keyspace.getSuperSlice("testGetSuperSlice", clp, sp);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

    for (int i = 0; i < 100; i++) {
      keyspace.insert("testMultigetSlice_" + i, cp, StringSerializer.get().toByteBuffer("testMultigetSlice_value_" + i));
      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++) {
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

  }

  @Override
  public void insert(String key, ColumnPath columnPath, ByteBuffer value, long timestamp) throws HectorException {
//    valideColumnPath(columnPath);
      ColumnParent columnParent = new ColumnParent(columnPath.getColumn_family());
      if (columnPath.isSetSuper_column()) {
      columnParent.setSuper_column(columnPath.getSuper_column());
    }
      Column column = new Column(ByteBuffer.wrap(columnPath.getColumn()), value, timestamp);
      insert(StringSerializer.get().toByteBuffer(key), columnParent, column);
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

      cp.setColumn(bytes("testInsertAndGetAndRemove_" + i));
      keyspace.insert("testGetCount", cp, StringSerializer.get().toByteBuffer("testInsertAndGetAndRemove_value_" + i));
    }

    // get value
    ColumnParent clp = new ColumnParent("Standard1");
    //int count = keyspace.getCount("testGetCount", clp, se);
    //assertEquals(100, count);

    ColumnPath cp = new ColumnPath("Standard1");
    keyspace.remove("testGetCount", cp);
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.