Exemplo n.º 1
0
    def remove(self,
               column_family,
               key,
               columns=None,
               super_column=None,
               timestamp=None):
        """
        Adds a single row remove to the batch.

        `column_family` is the :class:`~pycassa.columnfamily.ColumnFamily`
        that the remove will be executed on.

        """
        if timestamp is None:
            timestamp = column_family.timestamp()
        deletion = Deletion(timestamp=timestamp)
        _pack_name = column_family._pack_name
        if super_column is not None:
            deletion.super_column = _pack_name(super_column, True)
        if columns is not None:
            is_super = column_family.super and super_column is None
            packed_cols = [_pack_name(col, is_super) for col in columns]
            deletion.predicate = SlicePredicate(column_names=packed_cols)
        mutation = Mutation(deletion=deletion)
        packed_key = column_family._pack_key(key)
        self._enqueue(packed_key, column_family, (mutation, ))
        return self
Exemplo n.º 2
0
 def remove(self, column_family, key, columns=None, super_column=None, timestamp=None):
     if timestamp == None:
         timestamp = column_family.timestamp()
     deletion = Deletion(timestamp=timestamp)
     if columns:
         _pack_name = column_family._pack_name
         packed_cols = [_pack_name(col, column_family.super)
                        for col in columns]
         deletion.predicate = SlicePredicate(column_names=packed_cols)
         if super_column:
             deletion.super_column = super_column
     mutation = Mutation(deletion=deletion)
     self._enqueue(key, column_family, (mutation,))
     return self
Exemplo n.º 3
0
 def remove(self,
            column_family,
            key,
            columns=None,
            super_column=None,
            timestamp=None):
     if timestamp == None:
         timestamp = column_family.timestamp()
     deletion = Deletion(timestamp=timestamp)
     if columns:
         _pack_name = column_family._pack_name
         packed_cols = [
             _pack_name(col, column_family.super) for col in columns
         ]
         deletion.predicate = SlicePredicate(column_names=packed_cols)
         if super_column:
             deletion.super_column = super_column
     mutation = Mutation(deletion=deletion)
     self._enqueue(key, column_family, (mutation, ))
     return self
Exemplo n.º 4
0
    def remove(self, column_family, key, columns=None, super_column=None, timestamp=None):
        """
        Adds a single row remove to the batch.

        `column_family` is the :class:`~pycassa.columnfamily.ColumnFamily`
        that the remove will be executed on.

        """
        if timestamp == None:
            timestamp = column_family.timestamp()
        deletion = Deletion(timestamp=timestamp)
        _pack_name = column_family._pack_name
        if super_column:
            deletion.super_column = _pack_name(super_column, True)
        if columns:
            packed_cols = [_pack_name(col, column_family.super and not super_column)
                           for col in columns]
            deletion.predicate = SlicePredicate(column_names=packed_cols)
        mutation = Mutation(deletion=deletion)
        self._enqueue(key, column_family, (mutation,))
        return self