spring-projects / spring-projects/spring-data-redis

Provide a builder-style API for Template methods accepting variable parameters [DATAREDIS-615]

Open
#1,190 0 comments 0 reactions 1 assignee View on GitHub

@mp911de is already working on this.

Since Dec 30, 2020.

in: core type: task
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Mark Paluch opened DATAREDIS-615 and commented

Methods accepting variable parameters require various overloads to reflect multiple input values.

geoAdd(K key, Point point, M member)
geoAdd(K key, GeoLocation<M> location)
geoAdd(K key, Map<M, Point> memberCoordinateMap)
geoAdd(K key, Iterable<GeoLocation<M>> locations)

Switching to a builder-style API that builds the operand stack and executes with a terminal operation consuming the stack could leverage creating various overloads:

Geo (ReactiveGeoOperations):

Map<V, Point> memberCoordinateMap = …
Collection<GeoLocation<V>> geoLocations = …
Mono<Long> mono = geoOperations.justGeoLocation(POINT_PALERMO, valueFactory.instance())
	.addAll(memberCoordinateMap)
	.addAll(geoLocations)
	.add(POINT_PALERMO, valueFactory.instance())
	.geoAdd(key);

Values (ReactiveValueOperations):

Collection<K> keys = …;
Mono<List<V>> mono = valueOperations.forJustKeys(key2, key1).addAll(keys).multiGet();

Issue Links:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.