GraphResultSet.size()

Description

Add method to easily determine result set size without having to materialize it via all()

Environment

None

Pull Requests

None

Activity

Show:

Kevin Gallardo 
March 11, 2016 at 11:03 AM

Resolution : As described by Andrew, GraphResultSet.getAvailableWithoutFetching() does the job.

Matthias Broecheler 
March 10, 2016 at 9:35 PM

Yes

Kevin Gallardo 
March 10, 2016 at 11:31 AM

are you OK with those answers? Can we close the ticket?

Olivier Michallat 
February 16, 2016 at 3:25 PM

getAvailableWithoutFetching() gives you the remaining records in the ResultSet, and if you call it before iterating, you get the size of the entire ResultSet

Assuming that the whole result set can be fetched in one request. AFAIK DSE graph does not implement paging yet so that's currently the case, but it might change in the future.

Kevin Gallardo 
February 16, 2016 at 12:30 PM

Indeed, the GraphResultSet works as for the ResultSet in the core driver, which means it is a consumable set, so if you iterated n times on the ResultSet the number of remaining records is not the same. By calling all() before iterating, you say you want to consume the entire ResultSet in one time, and hence, the size of the result List is fixed. As said Andy, getAvailableWithoutFetching() gives you the remaining records in the ResultSet, and if you call it before iterating, you get the size of the entire ResultSet.

Not a Problem

Details

Assignee

Reporter

Labels

Components

Sprint

Priority

Created February 15, 2016 at 9:26 PM
Updated August 17, 2020 at 7:36 AM
Resolved March 11, 2016 at 11:03 AM