Javadocs added

pull/1639/head
Nikita 7 years ago
parent 7006fa5903
commit f574b60315

@ -41,7 +41,7 @@ public interface RBucketsAsync {
* don't set none of them.
*
* @param buckets - map of buckets
* @return <code>true</code> if object has been set overwise <code>false</code>
* @return <code>true</code> if object has been set otherwise <code>false</code>
*/
RFuture<Boolean> trySetAsync(Map<String, ?> buckets);

@ -18,7 +18,7 @@ package org.redisson.api;
import java.util.concurrent.TimeUnit;
/**
* Distributed alternative to the {@link java.util.concurrent.CountDownLatch}
* Distributed implementation of {@link java.util.concurrent.CountDownLatch}
*
* It has an advantage over {@link java.util.concurrent.CountDownLatch} --
* count can be set via {@link #trySetCount} method.

@ -16,7 +16,7 @@
package org.redisson.api;
/**
* Distributed alternative to the {@link java.util.concurrent.CountDownLatch}
* Distributed async implementation of {@link java.util.concurrent.CountDownLatch}
*
* It has an advantage over {@link java.util.concurrent.CountDownLatch} --
* count can be set via {@link #trySetCountAsync} method.

@ -18,6 +18,7 @@ package org.redisson.api;
import java.util.concurrent.TimeUnit;
/**
* Distributed implementation of delayed queue.
*
* @author Nikita Koksharov
*

@ -18,7 +18,7 @@ package org.redisson.api;
import java.util.Deque;
/**
* {@link java.util.Deque} backed by Redis
* Distributed implementation of {@link java.util.Deque}
*
* @author Nikita Koksharov
*

@ -16,7 +16,7 @@
package org.redisson.api;
/**
* {@link java.util.Deque} backed by Redis
* Distributed async implementation of {@link java.util.Deque}
*
* @author Nikita Koksharov
*
@ -24,34 +24,124 @@ package org.redisson.api;
*/
public interface RDequeAsync<V> extends RQueueAsync<V> {
/**
* Removes last occurrence of element <code>o</code>
*
* @param o - element
* @return <code>true</code> if object has been removed otherwise <code>false</code>
*/
RFuture<Boolean> removeLastOccurrenceAsync(Object o);
/**
* Retrieves and removes the last element of deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> removeLastAsync();
/**
* Retrieves and removes the first element of deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> removeFirstAsync();
/**
* Removes first occurrence of element <code>o</code>
*
* @param o - element to remove
* @return <code>true</code> if object has been removed otherwise <code>false</code>
*/
RFuture<Boolean> removeFirstOccurrenceAsync(Object o);
/**
* Adds element at the head of this deque.
*
* @param e - element to add
* @return void
*/
RFuture<Void> pushAsync(V e);
/**
* Retrieves and removes element at the head of this deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> popAsync();
/**
* Retrieves and removes element at the tail of this deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> pollLastAsync();
/**
* Retrieves and removes element at the head of this deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> pollFirstAsync();
/**
* Returns element at the tail of this deque
* or <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> peekLastAsync();
/**
* Returns element at the head of this deque
* or <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> peekFirstAsync();
/**
* Adds element at the tail of this deque.
*
* @param e - element to add
* @return <code>true</code> if element was added to this deque otherwise <code>false</code>
*/
RFuture<Boolean> offerLastAsync(V e);
/**
* Returns element at the tail of this deque
* or <code>null</code> if there are no elements in deque.
*
* @return element
*/
RFuture<V> getLastAsync();
/**
* Adds element at the tail of this deque.
*
* @param e - element to add
* @return void
*/
RFuture<Void> addLastAsync(V e);
/**
* Adds element at the head of this deque.
*
* @param e - element to add
* @return void
*/
RFuture<Void> addFirstAsync(V e);
/**
* Adds element at the head of this deque.
*
* @param e - element to add
* @return <code>true</code> if element was added to this deque otherwise <code>false</code>
*/
RFuture<Boolean> offerFirstAsync(V e);
}

@ -18,7 +18,7 @@ package org.redisson.api;
import org.reactivestreams.Publisher;
/**
* {@link java.util.Deque} backed by Redis
* Distributed reactive implementation of {@link java.util.Deque}
*
* @author Nikita Koksharov
*
@ -28,34 +28,124 @@ public interface RDequeReactive<V> extends RQueueReactive<V> {
Publisher<V> descendingIterator();
/**
* Removes last occurrence of element <code>o</code>
*
* @param o - element
* @return <code>true</code> if object has been removed otherwise <code>false</code>
*/
Publisher<Boolean> removeLastOccurrence(Object o);
/**
* Retrieves and removes the last element of deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> removeLast();
/**
* Retrieves and removes the first element of deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> removeFirst();
/**
* Removes first occurrence of element <code>o</code>
*
* @param o - element to remove
* @return <code>true</code> if object has been removed otherwise <code>false</code>
*/
Publisher<Boolean> removeFirstOccurrence(Object o);
/**
* Adds element at the head of this deque.
*
* @param e - element to add
* @return void
*/
Publisher<Void> push(V e);
/**
* Retrieves and removes element at the head of this deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> pop();
/**
* Retrieves and removes element at the tail of this deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> pollLast();
/**
* Retrieves and removes element at the head of this deque.
* Returns <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> pollFirst();
/**
* Returns element at the tail of this deque
* or <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> peekLast();
/**
* Returns element at the head of this deque
* or <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> peekFirst();
/**
* Adds element at the tail of this deque.
*
* @param e - element to add
* @return <code>true</code> if element was added to this deque otherwise <code>false</code>
*/
Publisher<Integer> offerLast(V e);
/**
* Returns element at the tail of this deque
* or <code>null</code> if there are no elements in deque.
*
* @return element
*/
Publisher<V> getLast();
/**
* Adds element at the tail of this deque.
*
* @param e - element to add
* @return void
*/
Publisher<Void> addLast(V e);
/**
* Adds element at the head of this deque.
*
* @param e - element to add
* @return void
*/
Publisher<Void> addFirst(V e);
/**
* Adds element at the head of this deque.
*
* @param e - element to add
* @return <code>true</code> if element was added to this deque otherwise <code>false</code>
*/
Publisher<Boolean> offerFirst(V e);
}

@ -16,6 +16,8 @@
package org.redisson.api;
/**
* All objects that implement this interface
* should be destroyed via {@link #destroy()} method.
*
* @author Nikita Koksharov
*

@ -18,12 +18,18 @@ package org.redisson.api;
import java.util.List;
/**
* Future object for submitted tasks in a batch
*
* @author Nikita Koksharov
*
*/
public interface RExecutorBatchFuture extends RFuture<Void> {
/**
* Returns list of Future objects. Each Future object represents submitted task.
*
* @return list
*/
List<RExecutorFuture<?>> getTaskFutures();
}

@ -16,6 +16,7 @@
package org.redisson.api;
/**
* Future object for submitted task
*
* @author Nikita Koksharov
*

@ -19,7 +19,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
/**
* Redis based implementation of {@link java.util.concurrent.ExecutorService}
* Distributed implementation of {@link java.util.concurrent.ExecutorService}
*
* @author Nikita Koksharov
*

@ -18,7 +18,7 @@ package org.redisson.api;
import java.util.concurrent.Callable;
/**
* Redis based implementation of {@link java.util.concurrent.ExecutorService}
* Distributed async implementation of {@link java.util.concurrent.ExecutorService}
*
* @author Nikita Koksharov
*

@ -21,7 +21,7 @@ import java.util.Map;
import org.reactivestreams.Publisher;
/**
* Geospatial items holder.
* Geospatial items holder. Reactive interface.
*
* @author Nikita Koksharov
*

@ -22,18 +22,49 @@ import java.util.Collection;
*
* @author Nikita Koksharov
*
* @param <V> value
* @param <V> type of stored values
*/
public interface RHyperLogLog<V> extends RExpirable, RHyperLogLogAsync<V> {
/**
* Adds element into this structure.
*
* @param obj - element to add
* @return <code>true</code> if object has been added
* or <code>false</code> if it was already added
*/
boolean add(V obj);
/**
* Adds all elements contained in <code>objects</code> collection into this structure
*
* @param objects - elements to add
* @return <code>true</code> if at least one object has been added
* or <code>false</code> if all were already added
*/
boolean addAll(Collection<V> objects);
/**
* Returns approximated number of unique elements added into this structure.
*
* @return approximated number of unique elements added into this structure
*/
long count();
/**
* Returns approximated number of unique elements
* added into this instances and other instances defined through <code>otherLogNames</code>.
*
* @param otherLogNames - name of instances
* @return
*/
long countWith(String ... otherLogNames);
/**
* Merges multiple instances into this instance.
*
* @param otherLogNames - name of instances
*/
void mergeWith(String ... otherLogNames);
}

@ -23,18 +23,49 @@ import java.util.Collection;
*
* @author Nikita Koksharov
*
* @param <V> value
* @param <V> type of stored values
*/
public interface RHyperLogLogAsync<V> extends RExpirableAsync {
/**
* Adds element into this structure.
*
* @param obj - element to add
* @return <code>true</code> if object has been added
* or <code>false</code> if it was already added
*/
RFuture<Boolean> addAsync(V obj);
/**
* Adds all elements contained in <code>objects</code> collection into this structure
*
* @param objects - elements to add
* @return <code>true</code> if at least one object has been added
* or <code>false</code> if all were already added
*/
RFuture<Boolean> addAllAsync(Collection<V> objects);
/**
* Returns approximated number of unique elements added into this structure.
*
* @return approximated number of unique elements added into this structure
*/
RFuture<Long> countAsync();
/**
* Returns approximated number of unique elements
* added into this instances and other instances defined through <code>otherLogNames</code>.
*
* @param otherLogNames - name of instances
* @return
*/
RFuture<Long> countWithAsync(String ... otherLogNames);
/**
* Merges multiple instances into this instance.
*
* @param otherLogNames - name of instances
*/
RFuture<Void> mergeWithAsync(String ... otherLogNames);
}

@ -20,21 +20,54 @@ import java.util.Collection;
import org.reactivestreams.Publisher;
/**
* Probabilistic data structure that lets you maintain counts of millions of items with extreme space efficiency.
* Reactive interface.
*
* @author Nikita Koksharov
*
* @param <V>
* @param <V> type of stored values
*/
public interface RHyperLogLogReactive<V> extends RExpirableReactive {
/**
* Adds element into this structure.
*
* @param obj - element to add
* @return <code>true</code> if object has been added
* or <code>false</code> if it was already added
*/
Publisher<Boolean> add(V obj);
/**
* Adds all elements contained in <code>objects</code> collection into this structure
*
* @param objects - elements to add
* @return <code>true</code> if at least one object has been added
* or <code>false</code> if all were already added
*/
Publisher<Boolean> addAll(Collection<V> objects);
/**
* Returns approximated number of unique elements added into this structure.
*
* @return approximated number of unique elements added into this structure
*/
Publisher<Long> count();
/**
* Returns approximated number of unique elements
* added into this instances and other instances defined through <code>otherLogNames</code>.
*
* @param otherLogNames - name of instances
* @return
*/
Publisher<Long> countWith(String ... otherLogNames);
/**
* Merges multiple instances into this instance.
*
* @param otherLogNames - name of instances
*/
Publisher<Void> mergeWith(String ... otherLogNames);
}

@ -25,7 +25,7 @@ import org.redisson.api.map.MapWriter;
import org.redisson.api.mapreduce.RMapReduce;
/**
* Distributed and concurrent implementation of {@link java.util.concurrent.ConcurrentMap}
* Distributed implementation of {@link java.util.concurrent.ConcurrentMap}
* and {@link java.util.Map}
*
* This map doesn't allow to store <code>null</code> as key or value.

@ -25,7 +25,9 @@ import org.redisson.api.map.MapWriter;
import java.util.Set;
/**
* Async map functions
* Distributed async implementation of {@link Map}.
*
* This map doesn't allow to store <code>null</code> as key or value.
*
* @author Nikita Koksharov
*
@ -86,12 +88,27 @@ public interface RMapAsync<K, V> extends RExpirableAsync {
*/
RFuture<Void> putAllAsync(Map<? extends K, ? extends V> map);
/**
* Atomically adds the given <code>delta</code> to the current value
* by mapped <code>key</code>.
*
* Works only for <b>numeric</b> values!
*
* @param key - map key
* @param value - delta the value to add
* @return the updated value
*/
RFuture<V> addAndGetAsync(K key, Number value);
RFuture<Boolean> containsValueAsync(Object value);
RFuture<Boolean> containsKeyAsync(Object key);
/**
* Returns size of this map
*
* @return size
*/
RFuture<Integer> sizeAsync();
/**

@ -18,6 +18,7 @@ package org.redisson.api;
import org.redisson.RedissonNode;
/**
* Node initializer callback interface.
*
* @author Nikita Koksharov
*

@ -105,31 +105,67 @@ public class RemoteInvocationOptions implements Serializable {
return executionTimeoutInMillis != null;
}
/**
* Defines ACK timeout
*
* @param ackTimeoutInMillis - timeout in milliseconds
* @return RemoteInvocationOptions object
*/
public RemoteInvocationOptions expectAckWithin(long ackTimeoutInMillis) {
this.ackTimeoutInMillis = ackTimeoutInMillis;
return this;
}
/**
* Defines ACK timeout
*
* @param ackTimeout - timeout
* @param timeUnit - timeout unit
* @return RemoteInvocationOptions object
*/
public RemoteInvocationOptions expectAckWithin(long ackTimeout, TimeUnit timeUnit) {
this.ackTimeoutInMillis = timeUnit.toMillis(ackTimeout);
return this;
}
/**
* Specifies to not wait for ACK reply
*
* @return RemoteInvocationOptions object
*/
public RemoteInvocationOptions noAck() {
ackTimeoutInMillis = null;
return this;
}
/**
* Defines execution timeout
*
* @param executionTimeoutInMillis - timeout in milliseconds
* @return RemoteInvocationOptions object
*/
public RemoteInvocationOptions expectResultWithin(long executionTimeoutInMillis) {
this.executionTimeoutInMillis = executionTimeoutInMillis;
return this;
}
/**
* Defines execution timeout
*
* @param executionTimeout - timeout
* @param timeUnit - timeout unit
* @return RemoteInvocationOptions object
*/
public RemoteInvocationOptions expectResultWithin(long executionTimeout, TimeUnit timeUnit) {
this.executionTimeoutInMillis = timeUnit.toMillis(executionTimeout);
return this;
}
/**
* Specifies to not wait for result
*
* @return RemoteInvocationOptions object
*/
public RemoteInvocationOptions noResult() {
executionTimeoutInMillis = null;
return this;

Loading…
Cancel
Save