Cassandra Datastax Driver set paging state on Accessor

前端 未结 2 378
無奈伤痛
無奈伤痛 2021-01-20 19:14

I\'m using Datastax\'s lovely java driver for cassandra. I was trying to encapsulate all of my query strings into the built in accessors for mapping, but I require the abil

相关标签:
2条回答
  • 2021-01-20 20:17

    I agree that this would be really nice to have.

    One way to work with this for now would be to have your accessor return a Statement, i.e.:

    @Query("SELECT * FROM ks.tbl WHERE id = ?")
    Statement getAllById(@Param("id") UUID userId);
    

    And then from there you call setPagingState on the Statement returned and execute it.

    I agree that this isn't as nice as providing the paging state as a parameter to the Accessor, so I went ahead and opened up JAVA-1103.

    0 讨论(0)
  • 2021-01-20 20:19

    You can do it with Achilles:

    manager
       .select()
        .allColumns_FromBaseTable()
        .where()
        .partitionKey_Eq(...)
        ...
        .withPagingState(PagingState.fromString(...))
        .getList();
    
    0 讨论(0)
提交回复
热议问题