public IDictionary <string, IList <Column> > GetRangeSlice(ColumnParent columnParent, SlicePredicate predicate, string start, string finish, int count) { var op = new Operation <IDictionary <string, IList <Column> > >(ClientCounter.READ_FAIL, client => { var result = new Dictionary <string, IList <Column> >(); var keySlices = client.get_range_slice(Name, columnParent.ToThrift(), predicate.ToThrift(), start, finish, count, ConsistencyLevel.ToThrift()); if (keySlices == null || keySlices.Count == 0) { return(result); } foreach (var entry in keySlices.Transform(entry => new { entry.Key, Columns = GetColumnList(entry.Columns) })) { result.Add(entry.Key, entry.Columns); } return(result); }); OperateWithFailover(op); return(op.Result); }
public int GetCount(string key, ColumnParent columnParent) { var op = new Operation <int>(ClientCounter.READ_FAIL, client => { return(client.get_count(Name, key, columnParent.ToThrift(), ConsistencyLevel.ToThrift())); }); OperateWithFailover(op); return(op.Result); }
public IEnumerable <SuperColumn> GetSuperSlice(string key, ColumnParent columnParent, SlicePredicate predicate) { var op = new Operation <IEnumerable <SuperColumn> >(ClientCounter.READ_FAIL, client => { return(client.get_slice(Name, key, columnParent.ToThrift(), predicate.ToThrift(), ConsistencyLevel.ToThrift()) .Transform(c => c.Super_column.ToModel())); }); OperateWithFailover(op); return(op.Result); }
public IDictionary <string, IList <Column> > MultigetSlice(IList <string> keys, ColumnParent columnParent, SlicePredicate predicate) { var op = new Operation <IDictionary <string, IList <Column> > >(ClientCounter.READ_FAIL, client => { var result = new Dictionary <string, IList <Column> >(); var cfmap = client.multiget_slice(Name, new List <string>(keys), columnParent.ToThrift(), predicate.ToThrift(), ConsistencyLevel.ToThrift()); foreach (var entry in cfmap.Transform(m => new { m.Key, List = GetColumnList(m.Value) })) { result.Add(entry.Key, entry.List); } return(result); }); OperateWithFailover(op); return(op.Result); }
public int GetCount(string key, ColumnParent columnParent) { var op = new Operation<int>(ClientCounter.READ_FAIL, client => { return client.get_count(Name, key, columnParent.ToThrift(), ConsistencyLevel.ToThrift()); }); OperateWithFailover(op); return op.Result; }
public IDictionary<string, IList<SuperColumn>> MultigetSuperSlice(IList<string> keys, ColumnParent columnParent, SlicePredicate predicate) { var op = new Operation<IDictionary<string, IList<SuperColumn>>>(ClientCounter.READ_FAIL, client => { var result = new Dictionary<string, IList<SuperColumn>>(); var cfmap = client.multiget_slice(Name, new List<string>(keys), columnParent.ToThrift(), predicate.ToThrift(), ConsistencyLevel.ToThrift()); if (string.IsNullOrEmpty(columnParent.SuperColumn)) { foreach (var entry in cfmap.Transform(m => new { m.Key, List = GetSuperColumnList(m.Value) })) result.Add(entry.Key, entry.List); } else { foreach (var entry in cfmap.Transform(m => new { m.Key, List = new List<SuperColumn> { new SuperColumn(columnParent.SuperColumn, GetColumnList(m.Value)) } })) result.Add(entry.Key, entry.List); } return result; } ); OperateWithFailover(op); return op.Result; }
public IEnumerable<SuperColumn> GetSuperSlice(string key, ColumnParent columnParent, SlicePredicate predicate) { var op = new Operation<IEnumerable<SuperColumn>>(ClientCounter.READ_FAIL, client => { return client.get_slice(Name, key, columnParent.ToThrift(), predicate.ToThrift(), ConsistencyLevel.ToThrift()) .Transform(c => c.Super_column.ToModel()); }); OperateWithFailover(op); return op.Result; }
public IDictionary<string, IList<SuperColumn>> GetSuperRangeSlice(ColumnParent columnParent, SlicePredicate predicate, string start, string finish, int count) { var op = new Operation<IDictionary<string, IList<SuperColumn>>>(ClientCounter.READ_FAIL, client => { var result = new Dictionary<string, IList<SuperColumn>>(); var keySlices = client.get_range_slice(Name, columnParent.ToThrift(), predicate.ToThrift(), start, finish, count, ConsistencyLevel.ToThrift()); if (keySlices == null || keySlices.Count == 0) return result; foreach (var entry in keySlices.Transform(entry => new { entry.Key, Columns = GetSuperColumnList(entry.Columns) })) result.Add(entry.Key, entry.Columns); return result; } ); OperateWithFailover(op); return op.Result; }