Skip to content
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
6 changes: 3 additions & 3 deletions src/main/java/net/spy/memcached/v2/AbstractArcusResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

public class AbstractArcusResult<T> implements ArcusResult<T> {

protected AtomicReference<T> value;

private final List<Exception> exceptions = new ArrayList<>();
private final AtomicReference<T> value;
private final List<Exception> exceptions;

public AbstractArcusResult(AtomicReference<T> value) {
this.value = value;
this.exceptions = new ArrayList<>();
}

@Override
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/net/spy/memcached/v2/ArcusMultiFuture.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* also completes exceptionally. If multiple futures completed exceptionally,
* This future will throw CompositeException containing all exceptions.
* And the combined result can be obtained.
*
* @param <T>
*/
public final class ArcusMultiFuture<T> extends CompletableFuture<T> implements ArcusFuture<T> {

Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/spy/memcached/v2/ArcusResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* Class to hold the result and errors occurred during Arcus operation.
*
* @param <T> the type of the result
*/
public interface ArcusResult<T> {
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/spy/memcached/v2/vo/BKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import net.spy.memcached.util.BTreeUtil;

public final class BKey implements Comparable<BKey> {

public enum BKeyType {
BYTE_ARRAY,
LONG
}

private final BKeyType type;
private final Object data;

Expand Down Expand Up @@ -71,11 +77,6 @@ public static BKey of(BKeyObject bkeyObject) {
}
}

public enum BKeyType {
BYTE_ARRAY,
LONG;
}

public Object getData() {
if (type == BKeyType.BYTE_ARRAY) {
byte[] bytes = (byte[]) data;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/spy/memcached/v2/vo/GetArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ public final class GetArgs {
private final boolean withDelete;
private final boolean dropIfEmpty;

private GetArgs(boolean withDelete, boolean dropIfEmpty) {
this.withDelete = withDelete;
this.dropIfEmpty = dropIfEmpty;
}

public boolean isWithDelete() {
return withDelete;
}
Expand All @@ -15,11 +20,6 @@ public boolean isDropIfEmpty() {
return dropIfEmpty;
}

private GetArgs(boolean withDelete, boolean dropIfEmpty) {
this.withDelete = withDelete;
this.dropIfEmpty = dropIfEmpty;
}

public static class Builder {
private boolean withDelete = false;
private boolean dropIfEmpty = false;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/net/spy/memcached/v2/vo/SMGetElements.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static <T> SMGetElements<T> mergeSMGetElements(List<SMGetElements<T>> smG

// 1) Collect elements considering unique, count option.
mergeSMGetElements(smGetElementsList, elements, missedKeys, trimmedKeys,
ascending, unique, count);
ascending, unique, count);

// 2) Sort missed keys, and trimmed keys
Collections.sort(missedKeys);
Expand All @@ -53,15 +53,15 @@ public static <T> SMGetElements<T> mergeSMGetElements(List<SMGetElements<T>> smG
}

private static <T> void mergeSMGetElements(
List<SMGetElements<T>> smGetElementsList,
List<Element<T>> elements,
List<MissedKey> missedKeys,
List<TrimmedKey> trimmedKeys,
boolean ascending, boolean unique, int count) {
List<SMGetElements<T>> smGetElementsList,
List<Element<T>> elements,
List<MissedKey> missedKeys,
List<TrimmedKey> trimmedKeys,
boolean ascending, boolean unique, int count) {
// 1) Create Priority queue to hold the current smallest/largest element from each list
Comparator<ElementWithIndex<T>> comparator = ascending
? Comparator.naturalOrder()
: Comparator.reverseOrder();
? Comparator.naturalOrder()
: Comparator.reverseOrder();
PriorityQueue<ElementWithIndex<T>> pq = new PriorityQueue<>(comparator);

// 2) Initialize the priority queue with the first element from each list
Expand Down Expand Up @@ -93,7 +93,7 @@ private static <T> void mergeSMGetElements(
List<Element<T>> sourceList = smGetElementsList.get(current.listIndex).getElements();
if (nextIndex < sourceList.size()) {
pq.offer(new ElementWithIndex<>(sourceList.get(nextIndex),
current.listIndex, nextIndex));
current.listIndex, nextIndex));
}
}
}
Expand Down
Loading