Skip to content

Commit

Permalink
Merge pull request #518 from oliviarla/develop
Browse files Browse the repository at this point in the history
INTERNAL: add omitted parameter methods - list/set/map
  • Loading branch information
jhpark816 authored Jul 19, 2022
2 parents 2caee25 + 8ee0ca3 commit 1e19ff2
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 9 deletions.
59 changes: 59 additions & 0 deletions src/main/java/net/spy/memcached/ArcusClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,11 @@ public <T> CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key,
return asyncBopGet(key, get, reverse, tc);
}

@Override
public CollectionFuture<Map<String, Object>> asyncMopGet(String key) {
return asyncMopGet(key, false, false);
}

@Override
public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
boolean withDelete,
Expand All @@ -1535,6 +1540,11 @@ public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
return asyncMopGet(key, get, collectionTranscoder);
}

@Override
public CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey) {
return asyncMopGet(key, mkey, false, false);
}

@Override
public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
String mkey,
Expand All @@ -1550,6 +1560,11 @@ public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
return asyncMopGet(key, get, collectionTranscoder);
}

@Override
public CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList) {
return asyncMopGet(key, mkeyList, false, false);
}

@Override
public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
List<String> mkeyList,
Expand All @@ -1565,6 +1580,11 @@ public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
return asyncMopGet(key, get, collectionTranscoder);
}

@Override
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, Transcoder<T> tc) {
return asyncMopGet(key, false, false, tc);
}

@Override
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
boolean withDelete, boolean dropIfEmpty,
Expand All @@ -1574,6 +1594,11 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
return asyncMopGet(key, get, tc);
}

@Override
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, String mkey, Transcoder<T> tc) {
return asyncMopGet(key, mkey, false, false, tc);
}

@Override
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
String mkey,
Expand All @@ -1589,6 +1614,11 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
return asyncMopGet(key, get, tc);
}

@Override
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, List<String> mkeyList, Transcoder<T> tc) {
return asyncMopGet(key, mkeyList, false, false, tc);
}

@Override
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
List<String> mkeyList,
Expand All @@ -1604,13 +1634,23 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
return asyncMopGet(key, get, tc);
}

@Override
public CollectionFuture<List<Object>> asyncLopGet(String key, int index) {
return asyncLopGet(key, index, false, false);
}

@Override
public CollectionFuture<List<Object>> asyncLopGet(String key, int index,
boolean withDelete, boolean dropIfEmpty) {
ListGet get = new ListGet(index, withDelete, dropIfEmpty);
return asyncLopGet(key, get, collectionTranscoder);
}

@Override
public CollectionFuture<List<Object>> asyncLopGet(String key, int from, int to) {
return asyncLopGet(key, from, to, false, false);
}

@Override
public CollectionFuture<List<Object>> asyncLopGet(String key,
int from, int to,
Expand All @@ -1619,6 +1659,10 @@ public CollectionFuture<List<Object>> asyncLopGet(String key,
return asyncLopGet(key, get, collectionTranscoder);
}

@Override
public <T> CollectionFuture<List<T>> asyncLopGet(String key, int index, Transcoder<T> tc) {
return asyncLopGet(key, index, false, false, tc);
}
@Override
public <T> CollectionFuture<List<T>> asyncLopGet(String key, int index,
boolean withDelete, boolean dropIfEmpty,
Expand All @@ -1627,6 +1671,11 @@ public <T> CollectionFuture<List<T>> asyncLopGet(String key, int index,
return asyncLopGet(key, get, tc);
}

@Override
public <T> CollectionFuture<List<T>> asyncLopGet(String key, int from, int to, Transcoder<T> tc) {
return asyncLopGet(key, from, to, false, false, tc);
}

@Override
public <T> CollectionFuture<List<T>> asyncLopGet(String key,
int from, int to,
Expand All @@ -1636,13 +1685,23 @@ public <T> CollectionFuture<List<T>> asyncLopGet(String key,
return asyncLopGet(key, get, tc);
}

@Override
public CollectionFuture<Set<Object>> asyncSopGet(String key, int count) {
return asyncSopGet(key, count, false, false);
}

@Override
public CollectionFuture<Set<Object>> asyncSopGet(String key, int count,
boolean withDelete, boolean dropIfEmpty) {
SetGet get = new SetGet(count, withDelete, dropIfEmpty);
return asyncSopGet(key, get, collectionTranscoder);
}

@Override
public <T> CollectionFuture<Set<T>> asyncSopGet(String key, int count, Transcoder<T> tc) {
return asyncSopGet(key, count, false, false, tc);
}

@Override
public <T> CollectionFuture<Set<T>> asyncSopGet(String key, int count,
boolean withDelete, boolean dropIfEmpty,
Expand Down
128 changes: 128 additions & 0 deletions src/main/java/net/spy/memcached/ArcusClientIF.java
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,14 @@ public <T> CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key,
boolean dropIfEmpty,
Transcoder<T> tc);

/**
* Retrieves all items from the map
*
* @param key key of a map
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture<Map<String, Object>> asyncMopGet(String key);

/**
* Retrieves all items from the map
*
Expand All @@ -611,6 +619,15 @@ public <T> CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key,
public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
boolean withDelete, boolean dropIfEmpty);

/**
* Retrieves an item on given mkey in the map.
*
* @param key key of a map
* @param mkey mkey of a map
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey);

/**
* Retrieves an item on given mkey in the map.
*
Expand All @@ -624,6 +641,15 @@ public CollectionFuture<Map<String, Object>> asyncMopGet(String key,
public CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey,
boolean withDelete, boolean dropIfEmpty);

/**
* Retrieves items on given mkey list in the map.
*
* @param key key of a map
* @param mkeyList mkeyList
* @return a future that will hold the return value map of the fetch.
*/
public CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList);

/**
* Retrieves items on given mkey list in the map.
*
Expand All @@ -637,6 +663,17 @@ public CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey
public CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList,
boolean withDelete, boolean dropIfEmpty);

/**
* Retrieves all items from the map
*
* @param <T> the expected class of the value
* @param key key of a map
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch
*/
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
Transcoder<T> tc);

/**
* Retrieves all items from the map
*
Expand All @@ -652,6 +689,18 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key,
boolean withDelete, boolean dropIfEmpty,
Transcoder<T> tc);

/**
* Retrieves an item on given mkey in the map.
*
* @param <T> the expected class of the value
* @param key key of a map
* @param mkey mkey of a map
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch
*/
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, String mkey,
Transcoder<T> tc);

/**
* Retrieves an item on given mkey in the map.
*
Expand All @@ -668,6 +717,18 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, String mkey,
boolean withDelete, boolean dropIfEmpty,
Transcoder<T> tc);

/**
* Retrieves items on given mkey list in the map.
*
* @param <T> the expected class of the value
* @param key key of a map
* @param mkeyList mkeyList
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch.
*/
public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, List<String> mkeyList,
Transcoder<T> tc);

/**
* Retrieves items on given mkey list in the map.
*
Expand All @@ -684,6 +745,15 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, List<String>
boolean withDelete, boolean dropIfEmpty,
Transcoder<T> tc);

/**
* Retrieves an item on given index in the list.
*
* @param key key of a list
* @param index list index
* @return a future that will hold the return value list of the fetch
*/
public CollectionFuture<List<Object>> asyncLopGet(String key, int index);

/**
* Retrieves an item on given index in the list.
*
Expand All @@ -697,6 +767,17 @@ public <T> CollectionFuture<Map<String, T>> asyncMopGet(String key, List<String>
public CollectionFuture<List<Object>> asyncLopGet(String key, int index,
boolean withDelete, boolean dropIfEmpty);

/**
* Retrieves items on given index range(from..to) in the list.
*
* @param key key of a list
* @param from the first index to delete
* @param to the last index to delete
* @return a future that will hold the return value list of the fetch
*/
public CollectionFuture<List<Object>> asyncLopGet(String key,
int from, int to);

/**
* Retrieves items on given index range(from..to) in the list.
*
Expand All @@ -712,6 +793,18 @@ public CollectionFuture<List<Object>> asyncLopGet(String key,
int from, int to,
boolean withDelete, boolean dropIfEmpty);

/**
* Retrieves an item on given index in the list.
*
* @param <T> the expected class of the value
* @param key key of a list
* @param index list index
* @param tc a tranacoder to decode returned value
* @return a future that will hold the return value list of the fetch
*/
public <T> CollectionFuture<List<T>> asyncLopGet(String key, int index,
Transcoder<T> tc);

/**
* Retrieves an item on given index in the list.
*
Expand All @@ -728,6 +821,20 @@ public <T> CollectionFuture<List<T>> asyncLopGet(String key, int index,
boolean withDelete, boolean dropIfEmpty,
Transcoder<T> tc);

/**
* Retrieves items on given index range(from..to) in the list. (Arcus 1.6 and above)
*
* @param <T> the expected class of the value
* @param key key of a list
* @param from the first index to delete
* @param to the last index to delete
* @param tc a transcoder to decode the returned values
* @return a future that will hold the return value list of the fetch
*/
public <T> CollectionFuture<List<T>> asyncLopGet(String key,
int from, int to,
Transcoder<T> tc);

/**
* Retrieves items on given index range(from..to) in the list. (Arcus 1.6 and above)
*
Expand All @@ -746,6 +853,15 @@ public <T> CollectionFuture<List<T>> asyncLopGet(String key,
boolean withDelete, boolean dropIfEmpty,
Transcoder<T> tc);

/**
* Retrieves count number of random items in the set.
*
* @param key key of a set
* @param count number of items to fetch
* @return a future that will hold the return value set of the fetch
*/
public CollectionFuture<Set<Object>> asyncSopGet(String key, int count);

/**
* Retrieves count number of random items in the set.
*
Expand All @@ -759,6 +875,18 @@ public <T> CollectionFuture<List<T>> asyncLopGet(String key,
public CollectionFuture<Set<Object>> asyncSopGet(String key, int count,
boolean withDelete, boolean dropIfEmpty);

/**
* Retrieves count number of random items in the set.
*
* @param <T> the expected class of the value
* @param key key of a set
* @param count number of items to fetch
* @param tc a tranacoder to decode returned value
* @return a future that will hold the return value set of the fetch
*/
public <T> CollectionFuture<Set<T>> asyncSopGet(String key, int count,
Transcoder<T> tc);

/**
* Retrieves count number of random items in the set.
*
Expand Down
Loading

0 comments on commit 1e19ff2

Please sign in to comment.