public override void Execute(Apache.Cassandra.Cassandra.Client cassandraClient, ILog logger)
        {
            var columnParent   = BuildColumnParent();
            var slicePredicate = predicate.ToCassandraSlicePredicate();
            var output         = new MultigetQueryHelper(nameof(MultiGetSliceCommand), keyspace, columnFamily, consistencyLevel)
                                 .EnumerateAllKeysWithPartialFetcher(
                keys,
                queryKeys => cassandraClient.multiget_slice(queryKeys, columnParent, slicePredicate, consistencyLevel), logger);

            BuildOut(output);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns a dictionary of NColumns for a given set of row keys from start colmn to finish column
        /// </summary>
        /// <param name="keyspace"></param>
        /// <param name="columnFamily"></param>
        /// <param name="keys"></param>
        /// <param name="start">start column name</param>
        /// <param name="finish">end column name</param>
        /// <param name="count"></param>
        /// <param name="reversed"></param>
        /// <returns></returns>
        public Dictionary <byte[], List <NColumn <byte[], byte[]> > > multiGetColumns(string keyspace, Object columnFamily,
                                                                                      List <object> keys, Object start,
                                                                                      Object finish, int count,
                                                                                      bool reversed)
        {
            client.set_keyspace(keyspace);
            List <byte[]>  binaryKeys = keys.ToByteArrayListFromCollection <object>();
            SlicePredicate sp         = new SlicePredicate();

            sp.Slice_range          = new SliceRange();
            sp.Slice_range.Start    = start.ToByteArray();
            sp.Slice_range.Finish   = finish.ToByteArray();
            sp.Slice_range.Reversed = reversed;
            sp.Slice_range.Count    = count;
            var results = ThriftUtility.ToByteDictionaryFromColumnDictionary(client.multiget_slice(binaryKeys,
                                                                                                   new ColumnParent()
            {
                Column_family = columnFamily.ToString()
            }, sp, consistencyLevel));

            return(results);
        }
        public override void Execute(Apache.Cassandra.Cassandra.Client cassandraClient)
        {
            var output = cassandraClient.multiget_slice(keys, BuildColumnParent(), predicate.ToCassandraSlicePredicate(), consistencyLevel);

            BuildOut(output);
        }