Skip to content
Newer
Older
100644 184 lines (141 sloc) 6.93 KB
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
1 using System;
2 using System.Collections.Generic;
3 using FluentCassandra.Operations;
ac522e7 @nberardi added support for counter column
nberardi authored Feb 15, 2012
4 using FluentCassandra.Types;
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
5
6 namespace FluentCassandra
7 {
8 public static class CassandraSuperColumnFamilyOperations
9 {
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 1, 2010
10 #region ColumnCount
11
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 7, 2012
12 public static int ColumnCount(this CassandraSuperColumnFamily family, CassandraObject key, IEnumerable<CassandraObject> columnNames)
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
13 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
14 var op = new ColumnCount(key, new CassandraColumnSlicePredicate(columnNames));
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
15 return family.ExecuteOperation(op);
16 }
17
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
18 public static int ColumnCount(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject columnStart, CassandraObject columnEnd, bool reversed = false, int count = 100)
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
19 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
20 var op = new ColumnCount(key, new CassandraRangeSlicePredicate(columnStart, columnEnd, reversed, count));
e06a0b5 @nberardi everything compiles
nberardi authored Aug 31, 2010
21 return family.ExecuteOperation(op);
22 }
23
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
24 public static int SuperColumnCount(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, IEnumerable<CassandraObject> columnNames)
e06a0b5 @nberardi everything compiles
nberardi authored Sep 1, 2010
25 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
26 var op = new ColumnCount(key, superColumnName, new CassandraColumnSlicePredicate(columnNames));
e06a0b5 @nberardi everything compiles
nberardi authored Sep 1, 2010
27 return family.ExecuteOperation(op);
28 }
29
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
30 public static int SuperColumnCount(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject columnStart, CassandraObject columnEnd, bool reversed = false, int count = 100)
e06a0b5 @nberardi everything compiles
nberardi authored Sep 1, 2010
31 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
32 var op = new ColumnCount(key, superColumnName, new CassandraRangeSlicePredicate(columnStart, columnEnd, reversed, count));
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
33 return family.ExecuteOperation(op);
34 }
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
35
36 #endregion
37
38 #region InsertColumn
39
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
40 public static void InsertColumn(this CassandraSuperColumnFamily family, CassandraObject key, FluentColumn column)
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
41 {
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored Feb 1, 2012
42 InsertColumn(family, key, column.GetPath());
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
43 }
44
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
45 public static void InsertColumn(this CassandraSuperColumnFamily family, CassandraObject key, FluentColumnPath path)
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
46 {
a19e80c @nberardi added commenting to the demo
nberardi authored Jun 5, 2010
47 var superColumnName = path.SuperColumn.ColumnName;
48 var name = path.Column.ColumnName;
49 var value = path.Column.ColumnValue;
50 var timestamp = path.Column.ColumnTimestamp;
dc0875f @nberardi only in Cassandra does TTL mean Seconds Until Deleted
nberardi authored Jan 27, 2012
51 var timeToLive = path.Column.ColumnSecondsUntilDeleted;
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
52
ce017c8 @nberardi all tests working for 0.7
nberardi authored Sep 5, 2010
53 var op = new InsertColumn(key, superColumnName, name, value, timestamp, timeToLive);
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
54 family.ExecuteOperation(op);
55 }
56
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
57 public static void InsertColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject name, BytesType value)
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
58 {
c0c3d4d @nberardi decided to add an option of Fast vs NoDuplicates, since NoDuplicates …
nberardi authored Sep 25, 2012
59 InsertColumn(family, key, superColumnName, name, value, TimestampHelper.UtcNow(), null);
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
60 }
61
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
62 public static void InsertColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject name, BytesType value, DateTimeOffset timestamp, int? timeToLive)
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
63 {
ce017c8 @nberardi all tests working for 0.7
nberardi authored Sep 5, 2010
64 var op = new InsertColumn(key, superColumnName, name, value, timestamp, timeToLive);
6298c40 @nberardi Added a couple more tests for CassandraType types
nberardi authored May 2, 2010
65 family.ExecuteOperation(op);
66 }
67
68 #endregion
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
69
3fe5603 @nberardi basic support DynamicCompositeType and CompositeType
nberardi authored Dec 22, 2011
70 #region AddColumn
71
ac522e7 @nberardi added support for counter column
nberardi authored Feb 15, 2012
72 public static void InsertCounterColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject columnName, long columnValue)
3fe5603 @nberardi basic support DynamicCompositeType and CompositeType
nberardi authored Dec 22, 2011
73 {
74 var op = new AddColumn(key, superColumnName, columnName, columnValue);
75 family.ExecuteOperation(op);
76 }
77
78 #endregion
79
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
80 #region GetColumn
81
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
82 public static FluentColumn GetColumn(this CassandraSuperColumnFamily family, CassandraObject key, FluentColumnPath path)
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
83 {
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored Feb 2, 2012
84 var columnName = path.Column.ColumnName;
85 var superColumnName = path.SuperColumn.ColumnName;
86 return GetColumn(family, key, superColumnName, columnName);
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
87 }
88
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
89 public static FluentColumn GetColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject columnName)
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
90 {
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored Feb 2, 2012
91 var op = new GetColumn(key, superColumnName, columnName);
e384304 @nberardi finished up tests for 0.7
nberardi authored Sep 12, 2010
92 return family.ExecuteOperation(op);
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
93 }
94
95 #endregion
96
97 #region GetSuperColumn
98
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
99 public static FluentSuperColumn GetSuperColumn(this CassandraSuperColumnFamily family, CassandraObject key, FluentColumnParent parent)
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
100 {
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored Feb 2, 2012
101 var superColumnName = parent.SuperColumn.ColumnName;
102 return GetSuperColumn(family, key, superColumnName);
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
103 }
104
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
105 public static FluentSuperColumn GetSuperColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName)
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
106 {
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored Feb 2, 2012
107 var op = new GetSuperColumn(key, superColumnName);
2e93bd7 @nberardi all tests passing for GetColumn for both standard and super families
nberardi authored May 2, 2010
108 return family.ExecuteOperation(op);
109 }
110
111 #endregion
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
112
113 #region RemoveColumn
114
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
115 public static void RemoveColumn(this CassandraSuperColumnFamily family, CassandraObject key, FluentColumnPath path)
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
116 {
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored Feb 2, 2012
117 var columnName = path.Column.ColumnName;
118 var superColumnName = path.SuperColumn.ColumnName;
119 RemoveColumn(family, key, superColumnName, columnName);
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
120 }
121
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
122 public static void RemoveColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName)
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
123 {
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
124 RemoveColumn(family, key, superColumnName, null);
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
125 }
126
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
127 public static void RemoveColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject columnName)
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
128 {
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
129 var op = new Remove(key, superColumnName, columnName);
0191d22 @nberardi all tests passing for RemoveKey, RemoveColumn, and RemoveSuperColumn …
nberardi authored May 2, 2010
130 family.ExecuteOperation(op);
131 }
132
133 #endregion
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 5, 2010
134
30ce4f8 @nberardi added multi_get_slice and tests, last to add is get_range_slice
nberardi authored May 9, 2010
135 #region GetSingleSuperColumn
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
136
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
137 public static FluentSuperColumn GetSingleSuperColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, IEnumerable<CassandraObject> columnNames)
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
138 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
139 var op = new GetSuperColumnSlice(key, superColumnName, new CassandraColumnSlicePredicate(columnNames));
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
140 return family.ExecuteOperation(op);
141 }
142
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
143 public static FluentSuperColumn GetSingleSuperColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject columnStart, CassandraObject columnEnd, bool reversed = false, int count = 100)
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
144 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
145 var op = new GetSuperColumnSlice(key, superColumnName, new CassandraRangeSlicePredicate(columnStart, columnEnd, reversed, count));
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
146 return family.ExecuteOperation(op);
147 }
148
149 #endregion
150
d7df425 @nberardi reformatted the GetSlice a little to return the column family instead…
nberardi authored May 8, 2010
151 #region GetSingle
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
152
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
153 public static FluentSuperColumnFamily GetSingle(this CassandraSuperColumnFamily family, CassandraObject key, IEnumerable<CassandraObject> columnNames)
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
154 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
155 var op = new GetSuperColumnFamilySlice(key, new CassandraColumnSlicePredicate(columnNames));
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
156 return family.ExecuteOperation(op);
157 }
158
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored Feb 8, 2012
159 public static FluentSuperColumnFamily GetSingle(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject columnStart, CassandraObject columnEnd, bool reversed = false, int count = 100)
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
160 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored Feb 5, 2012
161 var op = new GetSuperColumnFamilySlice(key, new CassandraRangeSlicePredicate(columnStart, columnEnd, reversed, count));
62eb2e8 @nberardi added support for get_slice, will be creating tests next push
nberardi authored May 6, 2010
162 return family.ExecuteOperation(op);
163 }
164
165 #endregion
30ce4f8 @nberardi added multi_get_slice and tests, last to add is get_range_slice
nberardi authored May 10, 2010
166
167 #region Get
168
b94a37c @nberardi uncompilable - getting query side of LINQ worked out
nberardi authored May 17, 2010
169 // queryable
170
1e57fcf @nberardi refactored the cassandra slice query to be more inteligent and requir…
nberardi authored Feb 15, 2012
171 public static CassandraSlicePredicateQuery<FluentSuperColumnFamily> Get(this CassandraSuperColumnFamily family)
b94a37c @nberardi uncompilable - getting query side of LINQ worked out
nberardi authored May 17, 2010
172 {
1e57fcf @nberardi refactored the cassandra slice query to be more inteligent and requir…
nberardi authored Feb 15, 2012
173 return family.CreateCassandraSlicePredicateQuery<FluentSuperColumnFamily>(null);
b94a37c @nberardi uncompilable - getting query side of LINQ worked out
nberardi authored May 17, 2010
174 }
175
1e57fcf @nberardi refactored the cassandra slice query to be more inteligent and requir…
nberardi authored Feb 15, 2012
176 public static CassandraSlicePredicateQuery<FluentSuperColumnFamily> Get(this CassandraSuperColumnFamily family, params CassandraObject[] keys)
b94a37c @nberardi uncompilable - getting query side of LINQ worked out
nberardi authored May 17, 2010
177 {
1e57fcf @nberardi refactored the cassandra slice query to be more inteligent and requir…
nberardi authored Feb 15, 2012
178 return Get(family).FetchKeys(keys);
b94a37c @nberardi uncompilable - getting query side of LINQ worked out
nberardi authored May 17, 2010
179 }
180
30ce4f8 @nberardi added multi_get_slice and tests, last to add is get_range_slice
nberardi authored May 10, 2010
181 #endregion
70e1aa1 @nberardi added the column count operation and test
nberardi authored Apr 30, 2010
182 }
183 }
Something went wrong with that request. Please try again.