Package org.apache.cassandra.thrift

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


                    }
                    else
                    {
                        for (ColumnOrSuperColumn col : row)
                        {
                            SuperColumn superColumn = col.getSuper_column();
                            if (superColumn.getColumns().size() != expect.size())
                                return false;
                            for (int i = 0 ; i < expect.size() ; i++)
                                if (!superColumn.getColumns().get(i).bufferForValue().equals(expect.get(i)))
                                    return false;
                        }
                    }
                    return true;
                }
View Full Code Here


        // Print out super columns or columns.
        for (ColumnOrSuperColumn cosc : columns)
        {
            if (cosc.isSetSuper_column())
            {
                SuperColumn superColumn = cosc.super_column;

                css_.out.printf("=> (super_column=%s,", formatSuperColumnName(keyspace, columnFamily, superColumn));
                for (Column col : superColumn.getColumns())
                    css_.out.printf("\n     (column=%s, value=%s, timestamp=%d)", formatSubcolumnName(keyspace, columnFamily, col),
                                    new String(col.value, "UTF-8"), col.timestamp);
               
                css_.out.println(")");
            }
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

        for (Tuple pair : bag)
        {
            Mutation mutation = new Mutation();
            if (DataType.findType(pair.get(1)) == DataType.BAG) // supercolumn
            {
                SuperColumn sc = new SuperColumn();
                sc.setName(objToBB(pair.get(0)));
                List<org.apache.cassandra.thrift.Column> columns = new ArrayList<org.apache.cassandra.thrift.Column>();
                for (Tuple subcol : (DefaultDataBag) pair.get(1))
                {
                    org.apache.cassandra.thrift.Column column = new org.apache.cassandra.thrift.Column();
                    column.setName(objToBB(subcol.get(0)));
View Full Code Here

        for (Tuple pair : bag)
        {
            Mutation mutation = new Mutation();
            if (DataType.findType(pair.get(1)) == DataType.BAG) // supercolumn
            {
                SuperColumn sc = new SuperColumn();
                sc.setName(objToBB(pair.get(0)));
                List<org.apache.cassandra.thrift.Column> columns = new ArrayList<org.apache.cassandra.thrift.Column>();
                for (Tuple subcol : (DefaultDataBag) pair.get(1))
                {
                    org.apache.cassandra.thrift.Column column = new org.apache.cassandra.thrift.Column();
                    column.setName(objToBB(subcol.get(0)));
View Full Code Here

                column.setValue(entry.getValue());
                column.setTimestamp(timestamp);
                columns.add(column);
            }

            SuperColumn superColumn = new SuperColumn(bytes(superColumnName), columns);
            mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setSuper_column(superColumn));
            mutationList.add(mutation);
        } else {
            for (Map.Entry<String, ByteBuffer> entry : mutations.entrySet()) {
                Column column = new Column(bytes(entry.getKey()));
View Full Code Here

        column.setValue(bytes(propertyValue));
        column.setTimestamp(timestamp);
        List<Column> columns = Collections.singletonList(column);

        if (superColumnName != null) {
            SuperColumn superColumn = new SuperColumn(bytes(superColumnName), columns);
            batchMutation.addSuperInsertion(rowKey, Collections.singletonList(columnFamilyName), superColumn);
        } else {
            batchMutation.addInsertion(rowKey, Collections.singletonList(columnFamilyName), column);
        }
    }
View Full Code Here

                column.setTimestamp(timestamp);
                columns.add(column);
            }
        }

        SuperColumn superColumn = new SuperColumn(superColumnName, columns);
        batchMutation.addSuperInsertion(rowKey, Collections.singletonList(columnFamilyName), superColumn);
    }
View Full Code Here

        column.setValue(bytes(propertyValue));
        column.setTimestamp(timestamp);
        List<Column> columns = Collections.singletonList(column);

        if (superColumnName != null) {
            SuperColumn superColumn = new SuperColumn(bytes(superColumnName), columns);
            batchMutation.addSuperInsertion(rowKey, Collections.singletonList(columnFamilyName), superColumn);
        } else {
            batchMutation.addInsertion(rowKey, Collections.singletonList(columnFamilyName), column);
        }
    }
View Full Code Here

TOP

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

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.