Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.Deletion$DeletionTupleScheme


  }

  @Override
  public <SN, N> Mutator<K> addCounterSubDeletion(K key, String cf, HCounterSuperColumn<SN, N> sc) {
    SlicePredicate pred = new SlicePredicate();
    Deletion d = new Deletion();
    if ( sc.getColumns() != null ) {     
      for (HCounterColumn<N> col : sc.getColumns()) {
        pred.addToColumn_names(col.getNameSerializer().toByteBuffer(col.getName()));
      }
      d.setPredicate(pred);
    }   
    d.setSuper_column(sc.getNameByteBuffer());
    getPendingMutations().addDeletion(key, Arrays.asList(cf), d);
    return this;
  }
View Full Code Here


  }
 
  @Override
  public <SN, N> Mutator<K> addSubDelete(K key, String cf, SN sColumnName,
      N columnName, Serializer<SN> sNameSerializer, Serializer<N> nameSerializer, long clock) {
    Deletion d = new Deletion().setTimestamp(clock);           
    SlicePredicate predicate = new SlicePredicate();
    predicate.addToColumn_names(nameSerializer.toByteBuffer(columnName));
    d.setPredicate(predicate);
    d.setSuper_column(sNameSerializer.toByteBuffer(sColumnName));
    getPendingMutations().addDeletion(key, Arrays.asList(cf), d);
    return this;
  }
View Full Code Here

 
  @Override
  public <SN> Mutator<K> addSuperDelete(K key, String cf, SN sColumnName,
      Serializer<SN> sNameSerializer) {   
    Deletion d = new Deletion().setTimestamp(keyspace.createClock());           
    d.setSuper_column(sNameSerializer.toByteBuffer(sColumnName));
    getPendingMutations().addDeletion(key, Arrays.asList(cf), d);   

    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++;
View Full Code Here

    public ColumnListMutation<C> deleteColumn(C columnName) {
        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()) {
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

    @Override
    public ColumnListMutation<C> deleteColumn(C columnName) {
        if (deletionPredicate == null) {
            deletionPredicate = new SlicePredicate();
            Deletion d = new Deletion().setTimestamp(timestamp).setSuper_column(path.get(0))
                    .setPredicate(deletionPredicate);

            mutationList.add(new Mutation().setDeletion(d));
        }
View Full Code Here

        return this;
    }

    @Override
    public ColumnListMutation<C> delete() {
        Deletion d = new Deletion();
        d.setSuper_column(path.get(0));
        d.setTimestamp(timestamp);
        mutationList.add(new Mutation().setDeletion(d));

        timestamp++;
        return this;
    }
View Full Code Here

    @Override
    public ColumnListMutation<C> deleteColumn(C columnName) {
        if (deletionPredicate == null) {
            deletionPredicate = new SlicePredicate();
            Deletion d = new Deletion();
            d.setTimestamp(timestamp);
            d.setSuper_column(path.get(0));
            d.setPredicate(deletionPredicate);

            mutationList.add(new Mutation().setDeletion(d));
        }

        deletionPredicate.addToColumn_names(path.getSerializer().toByteBuffer(columnName));
View Full Code Here

    public Mutator deleteColumns(String colFamily, Bytes rowKey, List<Bytes> colNames) {
      safeGetRowKey(rowKey);
      validateColumnNames(colNames);
        SlicePredicate pred = new SlicePredicate();
        pred.setColumn_names(Bytes.transformBytesToList(colNames));
        Deletion deletion = new Deletion();
        deletion.setTimestamp(timestamp);
        deletion.setPredicate(pred);
        Mutation mutation = new Mutation();
        mutation.setDeletion(deletion);
        getMutationList(colFamily, rowKey).add(mutation);
        return this;
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.Deletion$DeletionTupleScheme

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.