DICE-UNC / jargon

Jargon core libraries
Other
28 stars 31 forks source link

Collection listing operation will not return the full sub-collections. maxRow issue? #341

Open bingzhang opened 5 years ago

bingzhang commented 5 years ago

Hello:

I tried to list the number of 5010 subfolders, but it seems it can only return back 5000 subfolders. And this number is limited by the value of maxRow, https://github.com/DICE-UNC/jargon/blob/master/jargon-core/src/main/java/org/irods/jargon/core/pub/SpecificQueryAOImpl.java#L155

So how I can list the full subfolders, and I am not sure the remote irods server is supposed to have limitation of the number of subfiles? But at least, server is not limited by the value of ``getJargonProperties().getMaxFilesAndDirsQueryMax()''.

I understand the default value can be changed in the jargon property file. I saw the code has the continuous flag, and I thought the limitation of 5000 is one round retrieval and in the end it will retrieve the full subfolders. But in my test, it just return back 5000 subfolders.

This is my test code:

        UserAO userAO = irodsAccessObjectFactory.getUserAO(irodsAccount);

        CollectionAndDataObjectListAndSearchAO actualCollection = irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount);

        List<CollectionAndDataObjectListingEntry> entries = null;
        try {
            //entries = actualCollection.listDataObjectsAndCollectionsUnderPath(targetIrodsCollection);
            entries = actualCollection.listDataObjectsAndCollectionsUnderPathWithPermissions(targetIrodsCollection);
        } catch (org.irods.jargon.core.exception.FileNotFoundException e1) {
            e1.printStackTrace();
        } catch (Exception ex) {
            ex.printStackTrace();
        }

Regards.

michael-conway commented 5 years ago

It is a 'last row issue'. There are variants in that listing class that provide an offset. NB there is work in progress on a much smoother experience with the CollectionPager that is slated for the next release that can help manage paging across collections and data objects, which are different entitites.

See https://github.com/DICE-UNC/jargon/blob/master/jargon-core/src/main/java/org/irods/jargon/core/pub/CollectionAndDataObjectListAndSearchAOImpl.java#L637 for an example with paging offset

korydraughn commented 2 weeks ago

Please confirm whether the issue is still valid.