Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.Mutation$MutationTupleSchemeFactory


  /**
   * Add a SuperColumn insertion (or update) to the batch mutation request.
   */
  public BatchMutation<K> addSuperInsertion(K key, List<String> columnFamilies,
      SuperColumn superColumn) {
    Mutation mutation = new Mutation();
    mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setSuper_column(superColumn));
    addMutation(key, columnFamilies, mutation);
    return this;
  }
View Full Code Here


 
  /**
   * Add a ColumnCounter insertion (or update)
   */
  public BatchMutation<K> addCounterInsertion(K key, List<String> columnFamilies, CounterColumn counterColumn) {
    Mutation mutation = new Mutation();
    mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_column(counterColumn));
    addMutation(key, columnFamilies, mutation);
    return this;
  }
View Full Code Here

  /**
   * Add a SuperColumnCounter insertion (or update)
   */
  public BatchMutation<K> addSuperCounterInsertion(K key, List<String> columnFamilies,
      CounterSuperColumn counterSuperColumn) {
    Mutation mutation = new Mutation();
    mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_super_column(counterSuperColumn));
    addMutation(key, columnFamilies, mutation);
    return this;
  }
View Full Code Here

  /**
   * Add a deletion request to the batch mutation.
   */
  public BatchMutation<K> addDeletion(K key, List<String> columnFamilies, Deletion deletion) {
    Mutation mutation = new Mutation();
    mutation.setDeletion(deletion);
    addMutation(key, columnFamilies, mutation);
    return this;
  }
View Full Code Here

        }
        else if (defaultTtl != null)
            column.setTtl(defaultTtl);

        // 2. Create a mutation and append to the mutation list.
        Mutation mutation = new Mutation();
        mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
        mutationList.add(mutation);

        return this;
    }
View Full Code Here

        }
        else if (defaultTtl != null)
            column.setTtl(defaultTtl);

        // 2. Create a mutation and append to the mutation list.
        Mutation mutation = new Mutation();
        mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
        mutationList.add(mutation);
        return this;
    }
View Full Code Here

    @Override
    public ColumnListMutation<C> delete() {
        // Delete the entire row
        Deletion d = new Deletion().setTimestamp(timestamp);
        mutationList.add(new Mutation().setDeletion(d));

        // Increment the timestamp by 1 so subsequent puts on this column may be
        // written
        timestamp++;
        return this;
View Full Code Here

            throw new RuntimeException("Column name cannot be empty");
        }
        column.setValue(amount);

        // 2. Create a mutation and append to the mutation list.
        Mutation mutation = new Mutation();
        mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_column(column));
        mutationList.add(mutation);
        return this;
    }
View Full Code Here

        Preconditions.checkNotNull(columnName, "Column name cannot be null");
       
        // Create a reusable predicate for deleting columns and insert only once
        if (null == lastDeletion || lastDeletion.getTimestamp() != timestamp) {
            lastDeletion = new Deletion().setPredicate(new SlicePredicate()).setTimestamp(timestamp);
            mutationList.add(new Mutation().setDeletion(lastDeletion));
        }
       
        ByteBuffer bb = this.columnSerializer.toByteBuffer(columnName);
        if (!bb.hasRemaining()) {
            throw new RuntimeException("Column name cannot be empty");
View Full Code Here

    @Override
    public ColumnListMutation<C> delete() {
        // Delete the entire super column
        Deletion d = new Deletion().setSuper_column(path.get(0)).setTimestamp(timestamp);
        mutationList.add(new Mutation().setDeletion(d));
        timestamp++;
        return this;
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.Mutation$MutationTupleSchemeFactory

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.