Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.SuperColumn$SuperColumnStandardScheme


     */
    private void writeSubColumnsInternal(String colFamily, Bytes rowKey, Bytes colName, List<Column> subColumns) {
      safeGetRowKey(rowKey);
      validateColumnName(colName);
      validateColumns(subColumns);
        SuperColumn scol = new SuperColumn(nullSafeGet(colName), subColumns);
        ColumnOrSuperColumn cosc = new ColumnOrSuperColumn();
        cosc.setSuper_column(scol);
        Mutation mutation = new Mutation();
        mutation.setColumn_or_supercolumn(cosc);
        getMutationList(colFamily, rowKey).add(mutation);
View Full Code Here


        Iterator<SuperColumn> iterator = createSelector().iterateSuperColumnsFromRow(SCF, fromLong(50l), null, false, 10, ConsistencyLevel.ONE);

        char letter = 'A';
        int count = 0;
        while (iterator.hasNext()) {
            SuperColumn superColumn = iterator.next();

            assertEquals("Wrong super column value returned", letter, Bytes.fromByteArray(superColumn.getName()).toChar());

            letter++;
            count++;
        }
View Full Code Here

        Iterator<SuperColumn> iterator = createSelector().iterateSuperColumnsFromRow(SCF, fromLong(50l), null, false, 10, ConsistencyLevel.ONE);

        char letter = 'A';
        int count = 0;
        for (int i = 0; i < 26; i++) {
            SuperColumn superColumn = iterator.next();

            assertEquals("Wrong super column value returned", letter, Bytes.fromByteArray(superColumn.getName()).toChar());

            letter++;
            count++;
        }
View Full Code Here

        } else {
            int incrementedCount = count + 1// cassandra will return the start row but the user is expecting a page of results beyond that point
            SlicePredicate predicate = Selector.newColumnsPredicate(startBeyondName, Bytes.EMPTY, reversed, incrementedCount);
            List<SuperColumn> columns = getSuperColumnsFromRow(columnFamily, rowKey, predicate, cLevel);
            if (columns.size() > 0) {
              SuperColumn first = columns.get(0);
              if (first.name.equals(startBeyondName.getBytes()))
                return columns.subList(1, columns.size());
              else if (columns.size() == incrementedCount)
                return columns.subList(0, columns.size()-1);
            }
View Full Code Here

            List<ColumnOrSuperColumn> slice = cassandraClient.get_slice(expirationKey,
                     expirationColumnParent, predicate, readConsistencyLevel);
            complete = slice.size() < SLICE_SIZE;
            // Delete all keys returned by the slice
            for (ColumnOrSuperColumn crumb : slice) {
               SuperColumn scol = crumb.getSuper_column();
               for (Iterator<Column> i = scol.getColumnsIterator(); i.hasNext();) {
                  Column col = i.next();
                  // Remove the entry row
                  remove0(ByteBuffer.wrap(col.getName()), mutationMap);
               }
               // Remove the expiration supercolumn
               addMutation(mutationMap, expirationKey, config.expirationColumnFamily,
                        ByteBuffer.wrap(scol.getName()), null, null);
            }
         }
         cassandraClient.batch_mutate(mutationMap, writeConsistencyLevel);
      } catch (Exception e) {
         throw new CacheLoaderException(e);
View Full Code Here

            List<Column> columns = new ArrayList<Column>();
            Column col = new Column(columnName);
            col.setValue(value);
            col.setTimestamp(microTimestamp());
            columns.add(col);
            cosc.setSuper_column(new SuperColumn(superColumn, columns));
         } else {
            Column col = new Column(columnName);
            col.setValue(value);
            col.setTimestamp(microTimestamp());
            cosc.setColumn(col);
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.SuperColumn$SuperColumnStandardScheme

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.