-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pagintion to backfills index and service show pages #422
Conversation
adrw
commented
Feb 26, 2025
•
edited
Loading
edited




@QueryParam offset: String? = null, | ||
@QueryParam lastOffset: String? = null, | ||
): Response<ResponseBody> { | ||
val (backfills, nextOffset) = transacter.transaction { session -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - readOnly()
. Could also use replicaRead
since the replication lag should be acceptable for querying live status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpawliszyn does Backfila have read replicas in staging/production?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for now the simplicity is worth more than the performance.
.newPager( | ||
idDescPaginator(), | ||
initialOffset = offset?.let { Offset(it) }, | ||
pageSize = 12, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - put the page size in a companion object
const
(could also make it user configurable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to punt on this to match the existing style across other callsites, but generally agree with this approach of moving to companion object
} | ||
.list(session) | ||
.newPager( | ||
idDescPaginator(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't you want to order by updated_at
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out the old impl just used the id so I'll stick with that pattern since it matches status quo and is easier.
?.contents | ||
} | ||
|
||
val a = "a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded?
@Inject private lateinit var scope: ActionScope | ||
|
||
@Test | ||
fun happyPath() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we inject the BackfillIndexAction
and assert the contents of its response for a couple different offset values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I'll go ahead and delete this test class, I was just using it to play with the Paginator and have a debugger.
8791e72
to
37605c3
Compare
37605c3
to
e7322f4
Compare