I am currently working on creating a Java code that can read Titan Vertex From from Hadoop HBase backend. I know blueprint api provides a getVertices() method on every TransactionalGraph, but still I am trying implement my own method. Now for usual vertex reading I already a working code that can read the entire HBase backend and fetch all the vertices from Titan Graph, but I am having a problem in implementing Pagination.
My Code so far :
Scan scan = new Scan();
Filter pageFilter = new ColumnPaginationFilter(DEFAULT_PAGE_SIZE, currentOffSet);
scan.setFilter(pageFilter);
scan.addFamily(Backend.EDGESTORE_NAME.getBytes());
scan.setMaxVersions(10);
List<Vertex> vertexList = new ArrayList<>(DEFAULT_PAGE_SIZE);
HTablePool pool = new HTablePool(config, DEFAULT_PAGE_SIZE);
ResultScanner scanner = pool.getTable(attributeMap.get("storage.tablename")).getScanner(scan);
But the ResultScanner returning the entire Graph.
currentOffSet is a int variable which determines the Current Page Number.
I also tried with ResultScanner#next(int rowCount). It works fine. But in this process I don't have an option to Go Back to Previous Page.
Can any one help me ?
Thank you in advance.