Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Jun 18, 2014
1 parent 15daf1d commit 1a12055
Show file tree
Hide file tree
Showing 21 changed files with 2,757 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,106 @@
*/
public interface BaseRedisAsyncConnection<K, V> extends Closeable {

/**
* Post a message to a channel.
*
* @param channel the channel type: key
* @param message the message type: value
* @return RedisFuture<Long> integer-reply the number of clients that received the message.
*/
RedisFuture<Long> publish(K channel, V message);

/**
* Lists the currently *active channels*.
*
* @return RedisFuture<List<K>> array-reply a list of active channels, optionally matching the specified pattern.
*/
RedisFuture<List<K>> pubsubChannels();

/**
* Lists the currently *active channels*.
*
* @param channel the key
* @return RedisFuture<List<K>> array-reply a list of active channels, optionally matching the specified pattern.
*/
RedisFuture<List<K>> pubsubChannels(K channel);

/**
* Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
*
* @param channels
* @return array-reply a list of channels and number of subscribers for every channel.
*/
RedisFuture<Map<K, Long>> pubsubNumsub(K... channels);

/**
* Returns the number of subscriptions to patterns.
*
* @return RedisFuture<Long> integer-reply the number of patterns all the clients are subscribed to.
*/
RedisFuture<Long> pubsubNumpat();

/**
* Echo the given string.
*
* @param msg the message type: value
* @return RedisFuture<V> bulk-string-reply
*/
RedisFuture<V> echo(V msg);

/**
* Ping the server.
*
* @return RedisFuture<String> simple-string-reply
*/
RedisFuture<String> ping();

/**
* Close the connection.
*
* @return RedisFuture<String> simple-string-reply always OK.
*/
RedisFuture<String> quit();

String digest(V script);

/**
* Discard all commands issued after MULTI.
*
* @return RedisFuture<String> simple-string-reply always `OK`.
*/
RedisFuture<String> discard();

/**
* Execute all commands issued after MULTI.
*
* @return RedisFuture<List<Object>> array-reply each element being the reply to each of the commands in the atomic
* transaction.
*
* When using `WATCH`, `EXEC` can return a
*/
RedisFuture<List<Object>> exec();

/**
* Mark the start of a transaction block.
*
* @return RedisFuture<String> simple-string-reply always `OK`.
*/
RedisFuture<String> multi();

/**
* Watch the given keys to determine execution of the MULTI/EXEC block.
*
* @param keys the key
* @return RedisFuture<String> simple-string-reply always `OK`.
*/
RedisFuture<String> watch(K... keys);

/**
* Forget about all watched keys.
*
* @return RedisFuture<String> simple-string-reply always `OK`.
*/
RedisFuture<String> unwatch();

RedisFuture<Long> waitForReplication(int replicas, long timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,105 @@
*/
public interface BaseRedisConnection<K, V> extends Closeable {

/**
* Post a message to a channel.
*
* @param channel the channel type: key
* @param message the message type: value
* @return Long integer-reply the number of clients that received the message.
*/
Long publish(K channel, V message);

/**
* Lists the currently *active channels*.
*
* @return List<K> array-reply a list of active channels, optionally matching the specified pattern.
*/
List<K> pubsubChannels();

/**
* Lists the currently *active channels*.
*
* @param channel the key
* @return List<K> array-reply a list of active channels, optionally matching the specified pattern.
*/
List<K> pubsubChannels(K channel);

/**
* Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
*
* @param channels
* @return array-reply a list of channels and number of subscribers for every channel.
*/
Map<K, Long> pubsubNumsub(K... channels);

/**
* Returns the number of subscriptions to patterns.
*
* @return Long integer-reply the number of patterns all the clients are subscribed to.
*/
Long pubsubNumpat();

/**
* Echo the given string.
*
* @param msg the message type: value
* @return V bulk-string-reply
*/
V echo(V msg);

/**
* Ping the server.
*
* @return String simple-string-reply
*/
String ping();

/**
* Close the connection.
*
* @return String simple-string-reply always OK.
*/
String quit();

String digest(V script);

/**
* Discard all commands issued after MULTI.
*
* @return String simple-string-reply always `OK`.
*/
String discard();

/**
* Execute all commands issued after MULTI.
*
* @return List<Object> array-reply each element being the reply to each of the commands in the atomic transaction.
*
* When using `WATCH`, `EXEC` can return a
*/
List<Object> exec();

/**
* Mark the start of a transaction block.
*
* @return String simple-string-reply always `OK`.
*/
String multi();

/**
* Watch the given keys to determine execution of the MULTI/EXEC block.
*
* @param keys the key
* @return String simple-string-reply always `OK`.
*/
String watch(K... keys);

/**
* Forget about all watched keys.
*
* @return String simple-string-reply always `OK`.
*/
String unwatch();

Long waitForReplication(int replicas, long timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,29 @@
* @since 17.05.14 21:14
*/
public interface RedisHLLAsyncConnection<K, V> {
/**
* Adds the specified elements to the specified HyperLogLog.
*
* @return RedisFuture<Long> integer-reply specifically:
*
* 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.
*/
RedisFuture<Long> pfadd(K key, V value, V... moreValues);

/**
* Merge N different HyperLogLogs into a single one.
*
* @return RedisFuture<Long> simple-string-reply The command just returns `OK`.
*/
RedisFuture<Long> pfmerge(K destkey, K sourcekey, K... moreSourceKeys);

/**
* Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
*
* @return RedisFuture<Long> integer-reply specifically:
*
* The approximated number of unique elements observed via `PFADD`.
*/
RedisFuture<Long> pfcount(K key, K... moreKeys);

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,29 @@
* @since 17.05.14 21:14
*/
public interface RedisHLLConnection<K, V> {
/**
* Adds the specified elements to the specified HyperLogLog.
*
* @return Long integer-reply specifically:
*
* 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.
*/
Long pfadd(K key, V value, V... moreValues);

/**
* Merge N different HyperLogLogs into a single one.
*
* @return Long simple-string-reply The command just returns `OK`.
*/
Long pfmerge(K destkey, K sourcekey, K... moreSourceKeys);

/**
* Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
*
* @return Long integer-reply specifically:
*
* The approximated number of unique elements observed via `PFADD`.
*/
Long pfcount(K key, K... moreKeys);

}
Loading

0 comments on commit 1a12055

Please sign in to comment.