public List<Apache.Cassandra.KeySlice> get_range_slices(CassandraColumnParent column_parent, CassandraSlicePredicate predicate, CassandraKeyRange range, Apache.Cassandra.ConsistencyLevel consistency_level)
		{
			return _client.get_range_slices(
				Helper.CreateColumnParent(column_parent),
				Helper.CreateSlicePredicate(predicate),
				Helper.CreateKeyRange(range),
				consistency_level);
		}
Exemple #2
0
        private static object BuildOperation <TResult>(CassandraQuerySetup setup, CassandraSlicePredicate predicate, IDictionary <string, object> calls)
        {
            if (calls.ContainsKey("CountColumnsByKey"))
            {
                return(new MultiGetColumnCount(setup.Keys, setup.SuperColumnName, predicate));
            }

            if (calls.ContainsKey("CountColumns"))
            {
                return(new ColumnCount(setup.Keys.First(), setup.SuperColumnName, predicate));
            }

            var forSuperColumn = typeof(TResult) == typeof(FluentSuperColumnFamily);

            if (!forSuperColumn && setup.SuperColumnName != null)
            {
                throw new CassandraException("'ForSuperColumn' can only be used on a super column family.");
            }

            if (forSuperColumn)
            {
                if (setup.IndexClause != null)
                {
                    var indexClause = new CassandraIndexClause(setup.StartKey, setup.ColumnCount, setup.IndexClause);
                    return(new GetSuperColumnFamilyIndexedSlices(indexClause, predicate));
                }
                else if (setup.Keys.Count() > 0)
                {
                    return(new MultiGetSuperColumnFamilySlice(setup.Keys, setup.SuperColumnName, predicate));
                }
                else
                {
                    var keyRange = new CassandraKeyRange(setup.StartKey, setup.EndKey, setup.StartToken, setup.EndToken, setup.KeyCount);
                    return(new GetSuperColumnFamilyRangeSlices(keyRange, setup.SuperColumnName, predicate));
                }
            }
            else
            {
                if (setup.IndexClause != null)
                {
                    var indexClause = new CassandraIndexClause(setup.StartKey, setup.KeyCount, setup.IndexClause);
                    return(new GetColumnFamilyIndexedSlices(indexClause, predicate));
                }
                else if (setup.Keys.Count() > 0)
                {
                    return(new MultiGetColumnFamilySlice(setup.Keys, predicate));
                }
                else
                {
                    var keyRange = new CassandraKeyRange(setup.StartKey, setup.EndKey, setup.StartToken, setup.EndToken, setup.KeyCount);
                    return(new GetColumnFamilyRangeSlices(keyRange, predicate));
                }
            }
        }
Exemple #3
0
		public static KeyRange CreateKeyRange(CassandraKeyRange range)
		{
			if (range.StartKey == null && range.EndKey == null && range.StartToken == null && range.EndToken == null)
				range = new CassandraKeyRange("", "", null, null, range.Count);

			return new KeyRange {
				Start_key = range.StartKey.TryToBigEndian(),
				End_key = range.EndKey.TryToBigEndian(),
				Start_token = range.StartToken,
				End_token = range.EndToken,
				Count = range.Count
			};
		}
Exemple #4
0
        public static KeyRange CreateKeyRange(CassandraKeyRange range)
        {
            if (range.StartKey == null && range.EndKey == null && range.StartToken == null && range.EndToken == null)
            {
                range = new CassandraKeyRange("", "", null, null, range.Count);
            }

            return(new KeyRange {
                Start_key = range.StartKey.TryToBigEndian(),
                End_key = range.EndKey.TryToBigEndian(),
                Start_token = range.StartToken,
                End_token = range.EndToken,
                Count = range.Count
            });
        }
Exemple #5
0
 public GetSuperColumnFamilyRangeSlices(CassandraKeyRange keyRange, CassandraObject superColumnName, CassandraSlicePredicate columnSlicePredicate)
 {
     KeyRange        = keyRange;
     SuperColumnName = superColumnName;
     SlicePredicate  = columnSlicePredicate;
 }
Exemple #6
0
 public List <Apache.Cassandra.KeySlice> get_range_slices(CassandraColumnParent column_parent, CassandraSlicePredicate predicate, CassandraKeyRange range, Apache.Cassandra.ConsistencyLevel consistency_level)
 {
     return(_client.get_range_slices(
                Helper.CreateColumnParent(column_parent),
                Helper.CreateSlicePredicate(predicate),
                Helper.CreateKeyRange(range),
                consistency_level));
 }
Exemple #7
0
 public List <Apache.Cassandra.KeySlice> get_paged_slice(string column_family, CassandraKeyRange range, CassandraObject start_column, Apache.Cassandra.ConsistencyLevel consistency_level)
 {
     return(_client.get_paged_slice(
                column_family,
                Helper.CreateKeyRange(range),
                start_column.TryToBigEndian(),
                consistency_level));
 }
 public GetColumnFamilyRangeSlices(CassandraKeyRange keyRange, CassandraSlicePredicate columnSlicePredicate)
 {
     KeyRange       = keyRange;
     SlicePredicate = columnSlicePredicate;
 }
 public GetSuperColumnRangeSlices(CassandraKeyRange keyRange, CassandraType superColumnName, CassandraSlicePredicate columnSlicePredicate)
 {
     KeyRange        = keyRange;
     SuperColumnName = superColumnName;
     SlicePredicate  = columnSlicePredicate;
 }
		public List<Apache.Cassandra.KeySlice> get_paged_slice(string column_family, CassandraKeyRange range, CassandraObject start_column, Apache.Cassandra.ConsistencyLevel consistency_level)
		{
			return _client.get_paged_slice(
				column_family,
				Helper.CreateKeyRange(range),
				start_column.TryToBigEndian(),
				consistency_level);
		}