<div dir="ltr"><div>+1  I agree that we should enable custom page size pagination.</div><div><br></div><div>While my initial preference is cursor pagination, given the two use cases described, we should go with the DRF default of page number pagination.<br></div><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>
<p style="font-weight:bold;margin:0;padding:0;font-size:14px;text-transform:uppercase;margin-bottom:0"><span>Dana</span> <span>Walker</span></p>
<p style="font-weight:normal;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span>Associate Software Engineer</span><span style="font-weight:normal;color:#aaa;margin:0"></span></p>
<p style="font-weight:normal;margin:0;font-size:10px;color:#999"><a style="color:#0088ce;font-size:10px;margin:0;text-decoration:none;font-family:'overpass',sans-serif" href="https://www.redhat.com" target="_blank">Red Hat <span><br><br></span></a></p>




<table border="0"><tbody><tr><td width="100px"><a href="https://red.ht/sig" target="_blank"> <img src="https://www.redhat.com/files/brand/email/sig-redhat.png" width="90" height="auto"></a> </td>
</tr></tbody></table>

</div></div></div></div>
<br><div class="gmail_quote">On Tue, Jun 26, 2018 at 9:48 AM, Dennis Kliban <span dir="ltr"><<a href="mailto:dkliban@redhat.com" target="_blank">dkliban@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The user should be able to specify a page size at request time. The user should also be able to specify which page they are requesting. <br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Jun 26, 2018 at 9:31 AM, David Davis <span dir="ltr"><<a href="mailto:daviddavis@redhat.com" target="_blank">daviddavis@redhat.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">I was looking at the pagination code this morning and there were two things I wanted to discuss.<div><br></div><div>First, there’s no way to override the number of results per request. Instead, page size has to be configured for the whole app. Allowing users to override page size is trivial[0] so I wonder if we should enable it.</div><div><br></div><div>The second topic is a bit more complex. We currently use cursor based pagination where pages must be fetched sequentially as opposed to the default DRF pagination method of using page numbers. Cursors work great for large data sets as you don’t have to figure out things like the number of pages.</div><div><br></div><div>The first problem is that in Pulp we parallelize web requests for things like fetching metadata. See our Ansible plugin as an example[1]. If we want to support things like syncing content from one Pulp server to another, we probably have to use offset/page-based pagination for certain endpoints. </div><div><br></div><div>Another consideration is Katello. In Katello’s UI they show the number of pages and allow users to jump to arbitrary pages or the last page. If we want Katello to stop indexing Pulp data and instead query Pulp directly, we’ll need to allow them to use page numbers somehow.</div><div><br></div><div>Thoughts?</div><div><br></div><div>[0] <a href="https://gist.github.com/daviddavis/56a0b86629cd675d57aac61583c01944" target="_blank">https://gist.github.com/da<wbr>viddavis/56a0b86629cd675d57aac<wbr>61583c01944</a><br clear="all"><div><div dir="ltr" class="m_8580162502567582317m_2199165952748460416gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>[1] <a href="https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/app/tasks/synchronizing.py#L147-L171" target="_blank">https://github.com/pulp/pu<wbr>lp_ansible/blob/master/pulp_an<wbr>sible/app/tasks/synchronizing.<wbr>py#L147-L171</a></div><span class="m_8580162502567582317HOEnZb"><font color="#888888"><div><br></div><div>David<br></div></font></span></div></div></div></div></div></div></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/pulp-dev</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<br></blockquote></div><br></div>