(Quick Reference)

Querying Multiple Rows

Returning All Columns

Returns com.netflix.astyanax.model.RowsList<String>

def rowKeys = ["xxx-1","xxx-2","xxx-3"]
def result = astyanaxService.keyspace().prepareQuery("Standard1")
    .getKeySlice(rowKeys)
    .execute()
    .result

Returning Specific Columns

Returns com.netflix.astyanax.model.RowsList<String>

def rowKeys = ["xxx-1","xxx-2","xxx-3"]
def result = astyanaxService.keyspace().prepareQuery("Standard1")
    .getKeySlice(rowKeys)
    .withColumnSlice(["ColumnName1","ColumnName2"])
    .execute()
    .result

Return a Nested Map of Columns

Returns Map<String,Map<String, com.netflix.astyanax.model.Column<String>>>

def rowKeys = ["xxx-1","xxx-2","xxx-3"]
def result = astyanaxService.keyspace().prepareQuery("Standard1")
    .getKeySlice(rowKeys)
    .execute()
    .result
    .toMap()

Return a Nested Map of Strings

Returns Map<String,Map<String, String>>

def rowKeys = ["xxx-1","xxx-2","xxx-3"]
def result = astyanaxService.keyspace().prepareQuery("Standard1")
    .getKeySlice(rowKeys)
    .execute()
    .result
    .toStringMap()

Return a Map of Longs

Returns Map<String,Map<String, Long>>

def rowKeys = ["xxx-1","xxx-2","xxx-3"]
def result = astyanaxService.keyspace().prepareQuery("Standard1")
    .getKeySlice(rowKeys)
    .execute()
    .result
    .toLongMap()