Package org.apache.cassandra.thrift

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


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

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


        // Get all columns
        List<ColumnOrSuperColumn> slice = cassandraClient.get_slice(config.keySpace, 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(new String(col.getName(), "UTF-8"), mutationMap);
          }
          // Remove the expiration supercolumn
          addMutation(mutationMap, expirationKey, config.expirationColumnFamily, scol.getName(), null, null);
        }       
      }
      cassandraClient.batch_mutate(config.keySpace, mutationMap, writeConsistencyLevel);
    } catch (Exception e) {
      throw new CacheLoaderException(e);
View Full Code Here

    } else { // Insert/update
      ColumnOrSuperColumn cosc = new ColumnOrSuperColumn();
      if(superColumn!=null) {
        List<Column> columns = new ArrayList<Column>();
        columns.add(new Column(column, value, System.currentTimeMillis()));
        cosc.setSuper_column(new SuperColumn(superColumn, columns));
      } else {
        cosc.setColumn(new Column(column, value, System.currentTimeMillis()));
      }
      columnFamilyMutations.add(new Mutation().setColumn_or_supercolumn(cosc));
    }
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

                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(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

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

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.