Package org.apache.cassandra.thrift

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


    return addSubDelete(key, cf, sc, keyspace.createClock());
  }

  public <SN, N, V> Mutator<K> addSubDelete(K key, String cf, HSuperColumn<SN, N, V> sc, long clock)
  {
    Deletion d = new Deletion().setTimestamp(clock);

    if (sc.getColumns() != null) {
      SlicePredicate pred = new SlicePredicate();
      for (HColumn<N, V> 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


   * {@inheritDoc}
   */
  @Override
  public <N> Mutator<K> addDeletion(K key, String cf, N columnName,
      Serializer<N> nameSerializer, long clock) {
    Deletion d;
    if (columnName != null) {
      SlicePredicate sp = new SlicePredicate();
      sp.addToColumn_names(nameSerializer.toByteBuffer(columnName));
      d = new Deletion().setTimestamp(clock).setPredicate(sp);
    } else {
      d = new Deletion().setTimestamp(clock);
    }
    getPendingMutations().addDeletion(key, Arrays.asList(cf), d);
    return this;
  }
View Full Code Here

  }

  @Override
  public <N> Mutator<K> addCounterDeletion(K key, String cf,
      N counterColumnName, Serializer<N> nameSerializer) {
    Deletion d;
    if (counterColumnName != null) {
      SlicePredicate sp = new SlicePredicate();
      sp.addToColumn_names(nameSerializer.toByteBuffer(counterColumnName));
      d = new Deletion().setPredicate(sp);
    } else {
      d = new Deletion();
    }
    getPendingMutations().addDeletion(key, Arrays.asList(cf), d);
    return this;
  }
View Full Code Here

  }

  @Override
  public <N> Mutator<K> addCounterDeletion(K key, String cf) {
    getPendingMutations().addDeletion(key, Arrays.asList(cf),
        new Deletion());
    return this;
  }
View Full Code Here

  }

  @Override
  public <SN, N> Mutator<K> addCounterSubDeletion(K key, String cf,
      HCounterSuperColumn<SN, N> sc) {
    Deletion d = new Deletion();
    if (sc.getColumns() != null) {
      SlicePredicate pred = new SlicePredicate();
      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

    {
        Mutation mutation = new Mutation();
        if (t.get(1) == null)
        {
            // TODO: optional deletion
            mutation.deletion = new Deletion();
            mutation.deletion.predicate = new org.apache.cassandra.thrift.SlicePredicate();
            mutation.deletion.predicate.column_names = Arrays.asList(objToBB(t.get(0)));
            mutation.deletion.setTimestamp(FBUtilities.timestampMicros());
        }
        else
View Full Code Here

                    column.setTimestamp(FBUtilities.timestampMicros());
                    columns.add(column);
                }
                if (columns.isEmpty()) // TODO: optional deletion
                {
                    mutation.deletion = new Deletion();
                    mutation.deletion.super_column = objToBB(pair.get(0));
                    mutation.deletion.setTimestamp(FBUtilities.timestampMicros());
                }
                else
                {
View Full Code Here

        Mutation mutation = new Mutation();
        if (t.get(1) == null)
        {
            if (allow_deletes)
            {
                mutation.deletion = new Deletion();
                mutation.deletion.predicate = new org.apache.cassandra.thrift.SlicePredicate();
                mutation.deletion.predicate.column_names = Arrays.asList(objToBB(t.get(0)));
                mutation.deletion.setTimestamp(FBUtilities.timestampMicros());
            }
            else
View Full Code Here

TOP

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

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.