Package org.apache.cassandra.thrift

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


    }

    public void insert(ByteBuffer key, ByteBuffer name, ByteBuffer value) throws Exception
    {
        Column col = new Column(name).setValue(value).setTimestamp(System.nanoTime());
        ColumnParent cp = new ColumnParent(cfName);
        client.insert(key, cp, col, cl);
    }
View Full Code Here


        sliceRange.setStart(start).setFinish(finish);
        // reversed/count
        sliceRange.setReversed(false).setCount(order);
        // initialize SlicePredicate with existing SliceRange
        SlicePredicate predicate = new SlicePredicate().setSlice_range(sliceRange);
        ColumnParent parent = new ColumnParent(cfName);
        return client.get_slice(keyBuffer, parent, predicate, cl);
    }
View Full Code Here

        ByteBuffer rKey = kser.toByteBuffer(rkey);
        ByteBuffer sname = colser.toByteBuffer(startColumn);
        ByteBuffer ename = colser.toByteBuffer(endColumn);
       
        List<ReadCommand> commands = new ArrayList<ReadCommand>();
        ReadCommand readCommand = new SliceFromReadCommand(ks, rKey, new ColumnParent(cf), sname, ename, reversed, count);
        readCommand.setDigestQuery(false);
        commands.add(readCommand);
        List<Row> rows;
        try
        {
View Full Code Here

    }

    public void deleteDocuments(String indexName, Term term, boolean autoCommit) throws CorruptIndexException,
            IOException
    {
        ColumnParent cp = new ColumnParent(CassandraUtils.termVecColumnFamily);

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

        ReadCommand rc = new SliceFromReadCommand(CassandraUtils.keySpace, key, cp, ByteBufferUtil.EMPTY_BYTE_BUFFER,
View Full Code Here

        // Scan range of terms in this field (reversed, so we have a exit point)
        List<Row> rows = CassandraUtils.robustRead(CassandraUtils.consistency, new SliceFromReadCommand(
                CassandraUtils.keySpace, termsListKey, fieldColumnFamily, CassandraUtils.createColumnName(startTerm),
                ByteBufferUtil.EMPTY_BYTE_BUFFER, false, bufferSize));

        ColumnParent columnParent = new ColumnParent(CassandraUtils.termVecColumnFamily);

        // Collect read commands
        Collection<IColumn> columns;

        if (rows == null || rows.size() != 1 || rows.get(0).cf == null)
View Full Code Here

        byte[] indexNameBytes = indexName.getBytes("UTF-8");

        if(logger.isDebugEnabled())
            logger.debug("Loading field cache from " + indexName + " " + field);

        ColumnParent fieldCacheParent = new ColumnParent(CassandraUtils.fieldCacheColumnFamily);
        ByteBuffer fieldCacheKey = CassandraUtils.hashKeyBytes(indexNameBytes, CassandraUtils.delimeterBytes, field
                .getBytes());

        List<Row> rows = CassandraUtils.robustRead(CassandraUtils.consistency, new SliceFromReadCommand(
                CassandraUtils.keySpace, fieldCacheKey, fieldCacheParent, ByteBufferUtil.EMPTY_BYTE_BUFFER,
View Full Code Here

                keyMap.put(otherDocNum, CassandraUtils.hashKeyBytes(indexName.getBytes("UTF-8"),
                        CassandraUtils.delimeterBytes, docKey));
            }
        }

        ColumnParent columnParent = new ColumnParent();
        columnParent.setColumn_family(CassandraUtils.docColumnFamily);

        long start = System.currentTimeMillis();

        try
        {
View Full Code Here

        {

            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

        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

  @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

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.