Skip to content
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 getDataSource accessor in the new Redis API #27718

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.quarkus.redis.datasource;

/**
* Interface implemented by <em>reactive</em> Redis command groups.
*/
public interface ReactiveRedisCommands {

/**
* @return the data source.
*/
ReactiveRedisDataSource getDataSource();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.redis.datasource;

import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;

/**
* Interface implemented by <em>transactional and reactive</em> Redis command groups.
*/
public interface ReactiveTransactionalRedisCommands {

/**
* @return the data source.
*/
ReactiveTransactionalRedisDataSource getDataSource();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.quarkus.redis.datasource;

/**
* Interface implemented by <em>imperative</em> Redis command groups.
*/
public interface RedisCommands {

/**
* @return the data source.
*/
RedisDataSource getDataSource();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.redis.datasource;

import io.quarkus.redis.datasource.transactions.TransactionalRedisDataSource;

/**
* Interface implemented by <em>transactional and imperative</em> Redis command groups.
*/
public interface TransactionalRedisCommands {

/**
* @return the data source.
*/
TransactionalRedisDataSource getDataSource();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import java.util.List;

import io.quarkus.redis.datasource.RedisCommands;

/**
* Allows executing commands from the {@code bitmap} group.
* See <a href="https://redis.io/commands/?group=bitmap">the bitmap command list</a> for further information about these
* commands.
*
* @param <K> the type of the key
*/
public interface BitMapCommands<K> {
public interface BitMapCommands<K> extends RedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/bitcount">BITCOUNT</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.smallrye.mutiny.Uni;

/**
Expand All @@ -11,7 +12,7 @@
*
* @param <K> the type of the key
*/
public interface ReactiveBitMapCommands<K> {
public interface ReactiveBitMapCommands<K> extends ReactiveRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/bitcount">BITCOUNT</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.quarkus.redis.datasource.bitmap;

import io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands;
import io.smallrye.mutiny.Uni;

public interface ReactiveTransactionalBitMapCommands<K> {
public interface ReactiveTransactionalBitMapCommands<K> extends ReactiveTransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/bitcount">BITCOUNT</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.quarkus.redis.datasource.bitmap;

import io.quarkus.redis.datasource.TransactionalRedisCommands;

/**
* Allows executing commands from the {@code bitmap} group in a Redis transaction ({@code Multi}).
* See <a href="https://redis.io/commands/?group=bitmap">the bitmap command list</a> for further information about these
* commands.
*
* @param <K> the type of the key
*/
public interface TransactionalBitMapCommands<K> {
public interface TransactionalBitMapCommands<K> extends TransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/bitcount">BITCOUNT</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.OptionalDouble;
import java.util.Set;

import io.quarkus.redis.datasource.RedisCommands;

/**
* Allows executing commands from the {@code geo} group.
* See <a href="https://redis.io/commands/?group=geo">the geo command list</a> for further information about these commands.
Expand All @@ -14,7 +16,7 @@
* @param <K> the type of the key
* @param <V> the type of the value
*/
public interface GeoCommands<K, V> {
public interface GeoCommands<K, V> extends RedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/geoadd">GEOADD</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;
import java.util.Set;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.smallrye.mutiny.Uni;

/**
Expand All @@ -15,7 +16,7 @@
* @param <K> the type of the key
* @param <V> the type of the value
*/
public interface ReactiveGeoCommands<K, V> {
public interface ReactiveGeoCommands<K, V> extends ReactiveRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/geoadd">GEOADD</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.quarkus.redis.datasource.geo;

import io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands;
import io.smallrye.mutiny.Uni;

public interface ReactiveTransactionalGeoCommands<K, V> {
public interface ReactiveTransactionalGeoCommands<K, V> extends ReactiveTransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/geoadd">GEOADD</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.quarkus.redis.datasource.geo;

public interface TransactionalGeoCommands<K, V> {
import io.quarkus.redis.datasource.TransactionalRedisCommands;

public interface TransactionalGeoCommands<K, V> extends TransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/geoadd">GEOADD</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;
import java.util.Map;

import io.quarkus.redis.datasource.RedisCommands;
import io.quarkus.redis.datasource.ScanArgs;

/**
Expand All @@ -18,7 +19,7 @@
* @param <F> the type of the field
* @param <V> the type of the value
*/
public interface HashCommands<K, F, V> {
public interface HashCommands<K, F, V> extends RedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/hdel">HDEL</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;
import java.util.Map;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.quarkus.redis.datasource.ScanArgs;
import io.smallrye.mutiny.Uni;

Expand All @@ -19,7 +20,7 @@
* @param <F> the type of the field
* @param <V> the type of the value
*/
public interface ReactiveHashCommands<K, F, V> {
public interface ReactiveHashCommands<K, F, V> extends ReactiveRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/hdel">HDEL</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import java.util.Map;

import io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands;
import io.smallrye.mutiny.Uni;

public interface ReactiveTransactionalHashCommands<K, F, V> {
public interface ReactiveTransactionalHashCommands<K, F, V> extends ReactiveTransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/hdel">HDEL</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import java.util.Map;

public interface TransactionalHashCommands<K, F, V> {
import io.quarkus.redis.datasource.TransactionalRedisCommands;

public interface TransactionalHashCommands<K, F, V> extends TransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/hdel">HDEL</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.redis.datasource.hyperloglog;

import io.quarkus.redis.datasource.RedisCommands;

/**
* Allows executing commands from the {@code hyperloglog} group.
* See <a href="https://redis.io/commands/?group=hyperloglog">the hyperloglog command list</a> for further information about
Expand All @@ -9,7 +11,7 @@
* @param <K> the type of the key
* @param <V> the type of the value stored in the sets
*/
public interface HyperLogLogCommands<K, V> {
public interface HyperLogLogCommands<K, V> extends RedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/pfadd">PFADD</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.redis.datasource.hyperloglog;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.smallrye.mutiny.Uni;

/**
Expand All @@ -11,7 +12,7 @@
* @param <K> the type of the key
* @param <V> the type of the value stored in the sets
*/
public interface ReactiveHyperLogLogCommands<K, V> {
public interface ReactiveHyperLogLogCommands<K, V> extends ReactiveRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/pfadd">PFADD</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.quarkus.redis.datasource.hyperloglog;

import io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands;
import io.smallrye.mutiny.Uni;

public interface ReactiveTransactionalHyperLogLogCommands<K, V> {
public interface ReactiveTransactionalHyperLogLogCommands<K, V> extends ReactiveTransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/pfadd">PFADD</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.quarkus.redis.datasource.hyperloglog;

public interface TransactionalHyperLogLogCommands<K, V> {
import io.quarkus.redis.datasource.TransactionalRedisCommands;

public interface TransactionalHyperLogLogCommands<K, V> extends TransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/pfadd">PFADD</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.util.List;
import java.util.Set;

import io.quarkus.redis.datasource.RedisCommands;

/**
* Allows executing commands manipulating keys.
* See <a href="https://redis.io/commands/?group=generic">the generic command list</a> for further information about these
Expand All @@ -13,7 +15,7 @@
*
* @param <K> the type of the keys, often {@link String}
*/
public interface KeyCommands<K> {
public interface KeyCommands<K> extends RedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/copy">COPY</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.Set;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.smallrye.mutiny.Uni;

/**
Expand All @@ -15,7 +16,7 @@
*
* @param <K> the type of the keys, often {@link String}
*/
public interface ReactiveKeyCommands<K> {
public interface ReactiveKeyCommands<K> extends ReactiveRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/copy">COPY</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import java.time.Duration;
import java.time.Instant;

import io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands;
import io.smallrye.mutiny.Uni;

public interface ReactiveTransactionalKeyCommands<K> {
public interface ReactiveTransactionalKeyCommands<K> extends ReactiveTransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/copy">COPY</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import java.time.Duration;
import java.time.Instant;

public interface TransactionalKeyCommands<K> {
import io.quarkus.redis.datasource.TransactionalRedisCommands;

public interface TransactionalKeyCommands<K> extends TransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/copy">COPY</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;
import java.util.OptionalLong;

import io.quarkus.redis.datasource.RedisCommands;
import io.quarkus.redis.datasource.SortArgs;

/**
Expand All @@ -16,7 +17,7 @@
* @param <K> the type of the key
* @param <V> the type of the value stored in the lists
*/
public interface ListCommands<K, V> {
public interface ListCommands<K, V> extends RedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/blmove">BLMOVE</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.time.Duration;
import java.util.List;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.quarkus.redis.datasource.SortArgs;
import io.smallrye.mutiny.Uni;

Expand All @@ -16,7 +17,7 @@
* @param <K> the type of the key
* @param <V> the type of the value stored in the lists
*/
public interface ReactiveListCommands<K, V> {
public interface ReactiveListCommands<K, V> extends ReactiveRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/blmove">BLMOVE</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import java.time.Duration;

import io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands;
import io.smallrye.mutiny.Uni;

public interface ReactiveTransactionalListCommands<K, V> {
public interface ReactiveTransactionalListCommands<K, V> extends ReactiveTransactionalRedisCommands {

/**
* Execute the command <a href="https://redis.io/commands/blmove">BLMOVE</a>.
Expand Down
Loading