Skip to content

Commit

Permalink
minor cleanup of getslice classes
Browse files Browse the repository at this point in the history
  • Loading branch information
zznate committed Jan 28, 2011
1 parent 6c88b59 commit 4eff9d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/main/java/com/datastax/tutorial/GetSliceForAreaCodeCity.java
Expand Up @@ -6,6 +6,12 @@
import me.prettyprint.hector.api.query.QueryResult;
import me.prettyprint.hector.api.query.SliceQuery;

/**
* A get_slice query showing off 'limit' of columns for a given key.
*
* @author zznate
*
*/
public class GetSliceForAreaCodeCity extends TutorialCommand {

public GetSliceForAreaCodeCity(Keyspace keyspace) {
Expand All @@ -18,10 +24,8 @@ public QueryResult<ColumnSlice<String,String>> execute() {
HFactory.createSliceQuery(keyspace, stringSerializer, stringSerializer, stringSerializer);
sliceQuery.setColumnFamily("AreaCode");
sliceQuery.setKey("512");
// generates impossible slice and hangs reader thread!!!
sliceQuery.setRange("Austin__", "Austin__999", false, 5);
//sliceQuery.setRange("Austin__", "Austin__999", false, 5);
//sliceQuery.setRange(1, 999, false, 5);
// change the order argument to 'true' to get the last 2 columns in descending order
sliceQuery.setRange("", "", false, 2);

QueryResult<ColumnSlice<String, String>> result = sliceQuery.execute();

Expand Down
Expand Up @@ -30,7 +30,6 @@ public QueryResult<ColumnSlice<Long,String>> execute() {
sliceQuery.setKey("TX Austin");
sliceQuery.setRange(202L, 204L, false, 5);
QueryResult<ColumnSlice<Long, String>> result = sliceQuery.execute();

return result;
}

Expand Down

0 comments on commit 4eff9d6

Please sign in to comment.