public void BatchInsert(string key, IDictionary <string, IList <Column> > columnMap, IDictionary <string, IList <SuperColumn> > superColumnMap) { if (columnMap == null && superColumnMap == null) { throw new Exception("columnMap and SuperColumnMap can not be null at same time"); } var cfmap = new Dictionary <string, List <Apache.Cassandra.ColumnOrSuperColumn> >(); if (columnMap != null) { foreach (var map in columnMap) { cfmap.Add(map.Key, GetSoscList(map.Value)); } } if (superColumnMap != null) { foreach (var map in superColumnMap) { cfmap.Add(map.Key, GetSoscSuperList(map.Value)); } } var op = new VoidOperation(ClientCounter.WRITE_FAIL, client => client.batch_insert(Name, key, cfmap, ConsistencyLevel.ToThrift()) ); OperateWithFailover(op); }
public void Remove(string key, ColumnPath columnPath) { var op = new VoidOperation(ClientCounter.WRITE_FAIL, client => { client.remove(Name, key, columnPath.ToThrift(), Util.UnixTimestamp, ConsistencyLevel.ToThrift()); } ); OperateWithFailover(op); }
public void Insert(string key, ColumnPath columnPath, byte[] value) { AssertColumnPath(columnPath); var op = new VoidOperation(ClientCounter.WRITE_FAIL, client => { client.insert(Name, key, columnPath.ToThrift(), value, Util.UnixTimestamp, ConsistencyLevel.ToThrift()); }); OperateWithFailover(op); }
public void BatchInsert(string key, IDictionary<string, IList<Column>> columnMap, IDictionary<string, IList<SuperColumn>> superColumnMap) { if (columnMap == null && superColumnMap == null) throw new Exception("columnMap and SuperColumnMap can not be null at same time"); var cfmap = new Dictionary<string, List<Apache.Cassandra051.ColumnOrSuperColumn>>(); if (columnMap != null) foreach (var map in columnMap) cfmap.Add(map.Key, GetSoscList(map.Value)); if (superColumnMap != null) foreach (var map in superColumnMap) cfmap.Add(map.Key, GetSoscSuperList(map.Value)); var op = new VoidOperation(ClientCounter.WRITE_FAIL, client => client.batch_insert(Name, key, cfmap, ConsistencyLevel.ToThrift()) ); OperateWithFailover(op); }