Beispiel #1
0
func (w *writer) DeleteColumns(cf string, key []byte, columns [][]byte) Writer {
	tm := w.addWriter(cf, key)
	d := cassandra.NewDeletion()
	d.Timestamp = thrift.Int64Ptr(now())
	sp := cassandra.NewSlicePredicate()
	sp.ColumnNames = columns
	d.Predicate = sp
	tm.Deletion = d
	return w
}
Beispiel #2
0
func (w *writer) DeleteColumns(cf string, key []byte, columns [][]byte) Writer {
	tm := w.addWriter(cf, key)
	d := cassandra.NewDeletion()
	d.Timestamp = now()
	sp := cassandra.NewSlicePredicate()
	sp.ColumnNames = thrift.NewTList(thrift.BINARY, 1)
	for _, name := range columns {
		sp.ColumnNames.Push(name)
	}
	d.Predicate = sp
	tm.Deletion = d
	return w
}
Beispiel #3
0
func (r *reader) buildPredicate() *cassandra.SlicePredicate {
	sp := cassandra.NewSlicePredicate()
	if r.setColumns {
		sp.ColumnNames = thrift.NewTList(thrift.BINARY, 1)
		for _, col := range r.columns {
			sp.ColumnNames.Push(col)
		}
	} else if r.setSlice {
		sp.SliceRange = sliceToCassandra(&r.slice)
	} else {
		sp.SliceRange = fullSlice()
	}
	return sp
}