Permalink
Browse files

added mvn commands, minor tweaks

  • Loading branch information...
1 parent 4d010a1 commit ad091f62e68ccf9f650611b244c02eef124c75bd zznate committed Jul 11, 2011
@@ -13,6 +13,9 @@
* http://wiki.apache.org/cassandra/FAQ#range_ghosts
* http://wiki.apache.org/cassandra/DistributedDeletes
*
+ * To run this example from maven:
+ * mvn -e exec:java -Dexec.args="delete" -Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
+ *
* @author zznate
*/
public class DeleteRowsForColumnFamily extends TutorialCommand {
@@ -34,7 +34,7 @@ public GetIndexedSlicesForCityState(Keyspace keyspace) {
IndexedSlicesQuery<String, String, String> indexedSlicesQuery =
HFactory.createIndexedSlicesQuery(keyspace, stringSerializer, stringSerializer, stringSerializer);
indexedSlicesQuery.setColumnFamily("Npanxx");
- indexedSlicesQuery.setColumnNames("city","state","lat","lng");
+ indexedSlicesQuery.setColumnNames("city","lat","lng");
indexedSlicesQuery.addEqualsExpression("state", "TX");
indexedSlicesQuery.addEqualsExpression("city", "Austin");
indexedSlicesQuery.addGteExpression("lat", "30.30");
@@ -11,6 +11,9 @@
* Uses batch_mutate to insert several rows into mutliple column families in
* one execution.
*
+ * To run this example from maven:
+ * mvn -e exec:java -Dexec.args="insert" -Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
+ *
* @author zznate
*/
public class InsertRowsForColumnFamilies extends TutorialCommand {
@@ -24,11 +27,11 @@ public InsertRowsForColumnFamilies(Keyspace keyspace) {
Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
mutator.addInsertion("CA Burlingame", "StateCity", HFactory.createColumn(650L, "37.57x122.34",longSerializer,stringSerializer));
- mutator.addInsertion("650", "AreaCode", HFactory.createColumn("Burlingame__650", "37.57x122.34",stringSerializer,stringSerializer));
- mutator.addInsertion("650222", "Npanxx", HFactory.createColumn("lat", "37.57",stringSerializer,stringSerializer));
- mutator.addInsertion("650222", "Npanxx", HFactory.createColumn("lng", "122.34",stringSerializer,stringSerializer));
- mutator.addInsertion("650222", "Npanxx", HFactory.createColumn("city", "Burlingame",stringSerializer,stringSerializer));
- mutator.addInsertion("650222", "Npanxx", HFactory.createColumn("state", "CA",stringSerializer,stringSerializer));
+ mutator.addInsertion("650", "AreaCode", HFactory.createStringColumn("Burlingame__650", "37.57x122.34"));
+ mutator.addInsertion("650222", "Npanxx", HFactory.createStringColumn("lat", "37.57"));
+ mutator.addInsertion("650222", "Npanxx", HFactory.createStringColumn("lng", "122.34"));
+ mutator.addInsertion("650222", "Npanxx", HFactory.createStringColumn("city", "Burlingame"));
+ mutator.addInsertion("650222", "Npanxx", HFactory.createStringColumn("state", "CA"));
MutationResult mr = mutator.execute();
return null;
@@ -28,7 +28,7 @@ public MultigetSliceForNpanxx(Keyspace keyspace) {
HFactory.createMultigetSliceQuery(keyspace, stringSerializer, stringSerializer, stringSerializer);
multigetSlicesQuery.setColumnFamily("Npanxx");
multigetSlicesQuery.setColumnNames("city","state","lat","lng");
- multigetSlicesQuery.setKeys("512202","512203","512204","512205");
+ multigetSlicesQuery.setKeys("512202","512203","512205","512206");
QueryResult<Rows<String, String, String>> results = multigetSlicesQuery.execute();
return results;
}

0 comments on commit ad091f6

Please sign in to comment.