Example #1
0
        public override void Execute(Apache.Cassandra.Cassandra.Client cassandraClient)
        {
            Output = null;
            var columnParent = BuildColumnParent();
            var output       = cassandraClient.get_slice(PartitionKey, columnParent, predicate.ToCassandraSlicePredicate(), consistencyLevel);

            BuildOut(output);
        }
Example #2
0
        /// <summary>
        /// Generic method to get the columns.
        /// </summary>
        /// <typeparam name="N">Type of column name</typeparam>
        /// <typeparam name="V">Type of column value</typeparam>
        /// <param name="keyspace"></param>
        /// <param name="columnFamily"></param>
        /// <param name="key">Row key</param>
        /// <returns>List of NColumns of N,V types</returns>
        public List <NColumn <N, V> > getAllColumns <N, V>(string keyspace, Object columnFamily, Object key)
        {
            client.set_keyspace(keyspace);
            byte[]       binaryKey = key.ToByteArray();
            ColumnParent cp        = new ColumnParent()
            {
                Column_family = columnFamily.ToString()
            };
            SlicePredicate sp = new SlicePredicate();

            sp.Slice_range          = new SliceRange();
            sp.Slice_range.Start    = new byte[0];
            sp.Slice_range.Finish   = new byte[0];
            sp.Slice_range.Reversed = false;
            sp.Slice_range.Count    = ALL_COUNT;
            var result = ThriftUtility.ToNColumnList <N, V>(client.get_slice(binaryKey, cp, sp, consistencyLevel));

            return(result);
        }