コード例 #1
0
ファイル: Client.cs プロジェクト: mehtarakesh/Nector
        public List <NColumn <N, V> > getColumns <N, V>(string keyspace, Object columnFamily, Object key, HashSet <String> columnNames)
        {
            client.set_keyspace(keyspace);
            SlicePredicate sp = new SlicePredicate();

            sp.Column_names = columnNames.ToByteArrayListFromCollection <string>();
            var results = ThriftUtility.ToNColumnList <N, V>(client.get_slice(key.ToByteArray(),
                                                                              new ColumnParent()
            {
                Column_family = columnFamily.ToString()
            }, sp, consistencyLevel));

            return(results);
        }
コード例 #2
0
ファイル: Client.cs プロジェクト: mehtarakesh/Nector
        public ColumnSlice <N, V> getColumns <N, V>(string keyspace, Object columnFamily, Object key, N[] columnNames)
        {
            client.set_keyspace(keyspace);
            byte[]       binaryKey = key.ToByteArray();
            ColumnParent cp        = new ColumnParent()
            {
                Column_family = columnFamily.ToString()
            };
            SlicePredicate sp = new SlicePredicate();

            sp.Column_names = columnNames.ToByteArrayListFromCollection <N>();
            var result = ThriftUtility.ToNColumnList <N, V>(client.get_slice(binaryKey, cp, sp, consistencyLevel));
            ColumnSlice <N, V> cslice = new ColumnSlice <N, V>();

            cslice.Columns = result;
            return(cslice);
        }
コード例 #3
0
ファイル: Client.cs プロジェクト: mehtarakesh/Nector
        /// <summary>
        /// Returns the columns in the range from the start column to the finish column for a given row key
        /// </summary>
        /// <param name="keyspace"></param>
        /// <param name="columnFamily"></param>
        /// <param name="key"></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 List <NColumn <byte, byte> > getColumns(string keyspace, Object columnFamily, Object key, Object start,
                                                       Object finish, int count, Boolean reversed)
        {
            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    = start.ToByteArray();
            sp.Slice_range.Finish   = finish.ToByteArray();
            sp.Slice_range.Reversed = reversed;
            sp.Slice_range.Count    = count;
            return(ThriftUtility.ToNColumnList <byte, byte>(client.get_slice(binaryKey, cp, sp, consistencyLevel)));
        }
コード例 #4
0
ファイル: Client.cs プロジェクト: mehtarakesh/Nector
        /// <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);
        }