open-nomad/nomad/structs
Luiz Aoqui 01931587ba
api: paginated results with different ordering (#12128)
The paginator logic was built when go-memdb iterators would return items
ordered lexicographically by their ID prefixes, but #12054 added the
option for some tables to return results ordered by their `CreateIndex`
instead, which invalidated the previous paginator assumption.

The iterator used for pagination must still return results in some order
so that the paginator can properly handle requests where the next_token
value is not present in the results anymore (e.g., the eval was GC'ed).

In these situations, the paginator will start the returned page in the
first element right after where the requested token should've been.

This commit moves the logic to generate pagination tokens from the
elements being paginated to the iterator itself so that callers can have
more control over the token format to make sure they are properly
ordered and stable.

It also allows configuring the paginator as being ordered in ascending
or descending order, which is relevant when looking for a token that may
not be present anymore.
2022-03-01 15:36:49 -05:00
..
config add go-sockaddr templating support to nomad consul address (#12084) 2022-02-24 09:34:54 -05:00
batch_future.go drain: refactor batch_future into its own file 2018-04-02 16:40:06 -07:00
batch_future_test.go drain: refactor batch_future into its own file 2018-04-02 16:40:06 -07:00
bitmap.go
bitmap_test.go
connect.go e2e: consul namespace tests from nomad ent 2021-04-19 15:35:31 -06:00
connect_test.go consul/connect: add support for connect mesh gateways 2021-06-04 08:24:49 -05:00
consul.go chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
consul_oss.go gofmt all the files 2021-10-01 10:14:28 -04:00
consul_oss_test.go gofmt all the files 2021-10-01 10:14:28 -04:00
consul_test.go consul: plubming for specifying consul namespace in job/group 2021-04-05 10:03:19 -06:00
csi.go CSI: implement support for topology (#12129) 2022-03-01 10:15:46 -05:00
csi_test.go CSI: implement support for topology (#12129) 2022-03-01 10:15:46 -05:00
devices.go Initial implementation of device preemption 2018-11-15 11:09:26 -06:00
devices_test.go Split device accounter and allocator 2018-11-07 10:32:03 -08:00
diff.go Expose Consul template configuration parameters (#11606) 2022-01-10 10:19:07 -05:00
diff_test.go Expose Consul template configuration parameters (#11606) 2022-01-10 10:19:07 -05:00
encoding.go json handles were moved to a new package in #10202 2021-04-02 13:31:10 +00:00
errors.go CSI: minor refactoring (#12105) 2022-02-23 11:13:51 -05:00
errors_test.go api: acl bootstrap errors aren't 500 2019-11-19 15:51:57 -05:00
event.go docs: fix typo in structs/event.go 2021-08-21 17:02:07 +05:30
extensions.go json handles were moved to a new package in #10202 2021-04-02 13:31:10 +00:00
funcs.go scheduler: detect and log unexpected scheduling collisions (#11793) 2022-01-14 20:09:14 -05:00
funcs_test.go agent: validate reserved_ports are valid 2022-01-12 14:21:47 -08:00
generate.sh When serializing msgpack, only consider codec tag 2020-05-11 14:14:10 -04:00
handlers.go json handles were moved to a new package in #10202 2021-04-02 13:31:10 +00:00
network.go scheduler: detect and log unexpected scheduling collisions (#11793) 2022-01-14 20:09:14 -05:00
network_test.go scheduler: detect and log unexpected scheduling collisions (#11793) 2022-01-14 20:09:14 -05:00
node.go CSI: implement support for topology (#12129) 2022-03-01 10:15:46 -05:00
node_class.go use allow/deny instead of the colored alternatives (#9019) 2020-10-12 08:47:05 -04:00
node_class_test.go Device hook and devices affect computed node class 2018-11-27 17:25:33 -08:00
node_test.go
operator.go scheduler: config option to reject job registration (#11610) 2021-12-06 15:20:34 -05:00
search.go api: implement fuzzy search API 2021-04-16 16:36:07 -06:00
service_identities.go consul: plubming for specifying consul namespace in job/group 2021-04-05 10:03:19 -06:00
services.go improve error message on service length (#12012) 2022-02-04 19:39:34 -05:00
services_test.go connect: update allowed protocols in ingress gateway config (#11187) 2021-09-16 10:47:53 -04:00
streaming_rpc.go Fix some errcheck errors (#9811) 2021-01-14 12:46:35 -08:00
structs.go api: paginated results with different ordering (#12128) 2022-03-01 15:36:49 -05:00
structs_codegen.go Codecgen full package 2018-04-26 15:24:53 -07:00
structs_oss.go gofmt all the files 2021-10-01 10:14:28 -04:00
structs_periodic_test.go tests for periodic job scheduling and DST 2020-05-07 17:36:59 -04:00
structs_test.go scheduler: detect and log unexpected scheduling collisions (#11793) 2022-01-14 20:09:14 -05:00
testing.go chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
volumes.go csi: validate volume block has attachment_mode and access_mode 2021-06-03 16:07:19 -04:00