Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
net.spy.memcached.ArcusClientIF Maven / Gradle / Ivy
/*
* arcus-java-client : Arcus Java client
* Copyright 2010-2014 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.spy.memcached;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
import net.spy.memcached.collection.Attributes;
import net.spy.memcached.collection.BTreeGetResult;
import net.spy.memcached.collection.BTreeOrder;
import net.spy.memcached.collection.ByteArrayBKey;
import net.spy.memcached.collection.CollectionAttributes;
import net.spy.memcached.collection.Element;
import net.spy.memcached.collection.ElementFlagFilter;
import net.spy.memcached.collection.ElementFlagUpdate;
import net.spy.memcached.collection.ElementValueType;
import net.spy.memcached.collection.SMGetElement;
import net.spy.memcached.collection.SMGetMode;
import net.spy.memcached.internal.BTreeStoreAndGetFuture;
import net.spy.memcached.internal.CollectionFuture;
import net.spy.memcached.internal.CollectionGetBulkFuture;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.internal.SMGetFuture;
import net.spy.memcached.ops.CollectionOperationStatus;
import net.spy.memcached.ops.OperationStatus;
import net.spy.memcached.ops.StoreType;
import net.spy.memcached.transcoders.Transcoder;
/**
* Interface for Arcus specific commands
*/
public interface ArcusClientIF {
/**
* Sets attributes (metadata) associated with each key
* of collections including lists, sets, maps, and B+ trees.
*
* @param key key of a collection (list, set, map, B+ tree)
* @param attrs a collectionAttribute object to set
* @return whether or not the operation was performed
*/
public abstract CollectionFuture asyncSetAttr(String key,
Attributes attrs);
/**
* Gets attributes (metadata) associated with each key
* of collections including lists, sets, maps, and B+ trees.
*
* @param key key of a collection (list, set, map, B+ tree)
* @return a CollectionAttributes object containing attributes
*/
public abstract CollectionFuture asyncGetAttr(
final String key);
/**
* Checks an item membership in a set.
*
* @param the expected class of the value
* @param key key of a set
* @param value value of an item
* @param tc a transcoder to encode the value
* @return whether or not the item exists in the set
*/
public abstract CollectionFuture asyncSopExist(String key,
T value, Transcoder tc);
/**
* Checks an item membership in a set using the default transcoder.
*
* @param key key of a set
* @param value value of an item
* @return whether or not the item exists in the set
*/
public abstract CollectionFuture asyncSopExist(String key,
Object value);
/**
* Set an object in the cache on each key.
*
* Basic usage
* {@code
* ArcusClient c = getClientFromPool();
*
* List keys = new ArrayList();
* keys.add("KEY1");
* keys.add("KEY2");
*
* // The object to store
* Object value = "VALUE";
*
* // Get customized transcoder
* Transcoder myTranscoder = getTranscoder();
*
* // Store a value (async) on each keys for one hour using multiple memcached client.
* c.setBulk(keys, 3600, value, transcoder);
* }
*
* @param the expected class of the value
* @param key the key list which this object should be added
* @param exp the expiration of this object
* @param o the object to store on each keys
* @param tc the transcoder to serialize and unserialize the value
* @return a future that will hold the list of failed
*/
@Deprecated
public abstract Future> asyncSetBulk(
List key, int exp, T o, Transcoder tc);
/**
* Set an object in the cache on each key using specified memcached client
*
* @param key the key list which this object should be added
* @param exp the expiration of this object
* @param o the object to store on each keys
* @return a future that will hold the list of failed
*/
@Deprecated
public abstract Future> asyncSetBulk(
List key, int exp, Object o);
/**
* Set an object in the cache on each key using specified memcached client
*
* @param the expected class of the value
* @param o the map that has keys and values to store
* @param exp the expiration of this object
* @param tc the transcoder to serialize and unserialize the value
* @return a future that will hold the list of failed
*/
@Deprecated
public abstract Future> asyncSetBulk(
Map o, int exp, Transcoder tc);
/**
* Set an object in the cache on each key using specified memcached client
*
* @param o the map that has keys and values to store
* @param exp the expiration of this object
* @return a future that will hold the list of failed
*/
@Deprecated
public abstract Future> asyncSetBulk(
Map o, int exp);
/**
* Store an object in the cache on each key.
*
* Basic usage
* {@code
* ArcusClient c = getClientFromPool();
*
* List keys = new ArrayList();
* keys.add("KEY1");
* keys.add("KEY2");
*
* // The object to store
* Object value = "VALUE";
*
* // Get customized transcoder
* Transcoder myTranscoder = getTranscoder();
*
* // Store a value (async) on each keys for one hour using multiple memcached client.
* c.asyncStoreBulk(StoreType.set, keys, 3600, value, transcoder);
* }
*
* @param the expected class of the value
* @param type the type of store operation to perform.
* @param key the key list which this object should be added
* @param exp the expiration of this object
* @param o the object to store on each keys
* @param tc the transcoder to serialize and unserialize the value
* @return a future that will hold the list of failed
*/
public abstract Future> asyncStoreBulk(
StoreType type, List key, int exp, T o, Transcoder tc);
/**
* Store an object in the cache on each key using specified memcached client
*
* @param type the type of store operation to perform.
* @param key the key list which this object should be added
* @param exp the expiration of this object
* @param o the object to store on each keys
* @return a future that will hold the list of failed
*/
public abstract Future> asyncStoreBulk(
StoreType type, List key, int exp, Object o);
/**
* Store an object in the cache on each key using specified memcached client
*
* @param the expected class of the value
* @param type the type of store operation to perform.
* @param o the map that has keys and values to store
* @param exp the expiration of this object
* @param tc the transcoder to serialize and unserialize the value
* @return a future that will hold the list of failed
*/
public abstract Future> asyncStoreBulk(
StoreType type, Map o, int exp, Transcoder tc);
/**
* Store an object in the cache on each key using specified memcached client
*
* @param type the type of store operation to perform.
* @param o the map that has keys and values to store
* @param exp the expiration of this object
* @return a future that will hold the list of failed
*/
public abstract Future> asyncStoreBulk(
StoreType type, Map o, int exp);
/**
* Delete an object in the cache on each key.
*
* Basic usage
* {@code
* ArcusClient c = getClientFromPool();
*
* List keys = new ArrayList();
* keys.add("KEY1");
* keys.add("KEY2");
*
* // Delete a value (async) on each keys for one hour using multiple memcached client.
* c.asyncDeleteBulk(keys);
* }
*
* @param key the key list which this object should be deleted
* @return a future that will hold the list of failed
*
*/
public abstract Future> asyncDeleteBulk(
List key);
/**
* Delete an object in the cache on each key.
*
* @param key one or more keys to delete
* @return a future that will hold the list of failed
*
*/
public abstract Future> asyncDeleteBulk(
String... key);
/**
* Insert one item into multiple b+trees at once.
*
* @param the expected class of the value
* @param keyList key list of b+tree
* @param bkey key of a b+tree element.
* @param eFlag element flag. Length of element flag is between 1 and 31. if
* this value is null, Arcus don't assign element flag.
* @param value value of element. this value can't be null.
* @param attributesForCreate create a b+tree with this attributes, if given key is not
* exists.
* @param tc transcoder to encode value
* @return a future indicating success
*/
public abstract Future> asyncBopInsertBulk(
List keyList, long bkey, byte[] eFlag, T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert one item into multiple b+trees at once.
*
* @param keyList key list of b+tree
* @param bkey key of a b+tree element.
* @param eFlag element flag. Length of element flag is between 1 and 31. if
* this value is null, Arcus don't assign element flag.
* @param value value of element. this value can't be null.
* @param attributesForCreate create a b+tree with this attributes, if given key is not
* exists.
* @return a future indicating success
*/
public abstract Future> asyncBopInsertBulk(
List keyList, long bkey, byte[] eFlag, Object value,
CollectionAttributes attributesForCreate);
/**
* Insert one item into multiple map at once.
*
* @param the expected class of the value
* @param keyList key list of map
* @param mkey mkey of map.
* @param value value of map
* @param attributesForCreate create a map with this attributes, if given key is not
* exists.
* @param tc transcoder to encode value
* @return a future indicating success
*/
public abstract Future> asyncMopInsertBulk(
List keyList, String mkey, T value, CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert one item into multiple map at once.
*
* @param keyList key list of map
* @param mkey mkey of map.
* @param value value of map
* @param attributesForCreate create a map with this attributes, if given key is not
* exists.
* @return a future indicating success
*/
public abstract Future> asyncMopInsertBulk(
List keyList, String mkey, Object value,
CollectionAttributes attributesForCreate);
/**
* Insert a value into each list
*
*
* Note to the index
* The item will be inserted before the element with the given index except below
* -1:append, 0:prepend
*
*
* @param the expected class of the value
* @param keyList a key list of list
* @param index list index
* (the item will be inserted before the element with the given index)
* @param value a value to insert into each list
* @param attributesForCreate if not true, a list should be created when key does not exist
* @param tc transcoder to encode value
* @return a future that will indicate the failure list of each operation
*/
public abstract Future> asyncLopInsertBulk(
List keyList, int index, T value, CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert a value into each list
* The value will be encoded by the default transcoder (SerializeTranscoder)
*
*
* Note to the index
* The item will be inserted before the element with the given index except below
* -1:append, 0:prepend
*
*
* Basic usage
*
* {@code
* ArcusClient client = getClientFromPool();
*
* List keyList = getKeyListShouldHaveValue();
* String value = "Some-value";
* int index = 0;
* boolean createKeyIfNotExists = true;
*
* Future> future = client.asyncLopInsertBulk(keyList,
* index, value, createKeyIfNotExists);
*
* Map failedList = null;
* try {
* failedList = future.get(1000L, TimeUnit.MILLISECONDS);
* } catch (TimeoutException e) {
* future.cancel(true);
* // Handle error here
* } catch (InterruptedException e) {
* future.cancel(true);
* // Handle error here
* } catch (ExecutionException e) {
* future.cancel(true);
* // Handle error here
* }
* handleFailure(failedList);
* }
*
* @param keyList a key list of the list
* @param index list index (the item will be inserted before the element
* with the given index)
* @param value a value to insert into each list
* @param attributesForCreate if not null, a list should be created when key does not exist
* @return a future that will indicate the failure list of each operation
*/
public abstract Future> asyncLopInsertBulk(
List keyList, int index, Object value, CollectionAttributes attributesForCreate);
/**
* Insert a value into each set
*
* @param the expected class of the value
* @param keyList a key list of the set
* @param value a value to insert into each set
* @param attributesForCreate if not null, a list should be created when key does not exist
* @param tc transcoder to encode value
* @return a future that will indicate the failure list of each operation
*/
public abstract Future> asyncSopInsertBulk(
List keyList, T value,
CollectionAttributes attributesForCreate, Transcoder tc);
/**
* Insert a value into each set
*
* Basic usage
*
* {@code
* ArcusClient client = getClientFromPool();
*
* List keyList = getKeyListShouldHaveValue();
* String value = "Some-value";
* boolean createKeyIfNotExists = true;
*
* Future> future = client.asyncSopInsertBulk(keyList,
* value, createKeyIfNotExists);
*
* Map failedList = null;
* try {
* failedList = future.get(1000L, TimeUnit.MILLISECONDS);
* } catch (TimeoutException e) {
* future.cancel(true);
* // Handle error here
* } catch (InterruptedException e) {
* future.cancel(true);
* // Handle error here
* } catch (ExecutionException e) {
* future.cancel(true);
* // Handle error here
* }
* handleFailure(failedList);
* }
*
* @param keyList a key list of set
* @param value a value to insert into each set
* @param attributesForCreate if not null, a list should be created when key does not exist
* @return a future that will indicate the failure list of each operation
*/
public abstract Future> asyncSopInsertBulk(
List keyList, Object value, CollectionAttributes attributesForCreate);
/**
* Get maximum possible piped bulk insert item count.
*
* @return Get maximum possible piped bulk insert item count.
*/
public abstract int getMaxPipedItemCount();
/**
* Create an empty b+ tree
*
* @param key key of a b+ tree
* @param valueType element data type of the b+ tree
* @param attributes attributes of the b+ tree
* @return a future indicating success, false if there was a key
*/
public CollectionFuture asyncBopCreate(String key,
ElementValueType valueType,
CollectionAttributes attributes);
/**
* Create an empty map
*
* @param key key of a map
* @param type element data type of the map
* @param attributes attributes of the map
* @return a future indicating success, false if there was a key
*/
public CollectionFuture asyncMopCreate(String key,
ElementValueType type,
CollectionAttributes attributes);
/**
* Create an empty set
*
* @param key key of a set
* @param type element data type of the set
* @param attributes attributes of the set
* @return a future indicating success, false if there was a key
*/
public CollectionFuture asyncSopCreate(String key,
ElementValueType type,
CollectionAttributes attributes);
/**
* Create an empty list
*
* @param key key of a list
* @param type element data type of the list
* @param attributes attributes of the list
* @return a future indicating success, false if there was a key
*/
public CollectionFuture asyncLopCreate(String key,
ElementValueType type,
CollectionAttributes attributes);
/**
* Retrieves an item on given bkey in the b+tree.
*
* @param key key of a b+tree
* @param bkey bkey
* @param eFlagFilter element flag filter
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty true to remove the key when all elements are removed. false b+
* tree will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch.
*/
public CollectionFuture>> asyncBopGet(String key,
long bkey,
ElementFlagFilter eFlagFilter,
boolean withDelete,
boolean dropIfEmpty);
/**
* Retrieves count number of items in given bkey range(from..to)
* from offset in the b+tree.
* The returned map from the future should be sorted by the given range.
* {@code
* from >= to : in descending order
* from < to : in ascending order
* }
*
* @param key key of a b+tree
* @param from the first bkey
* @param to the last bkey
* @param eFlagFilter element flag filter
* @param offset 0-based offset
* @param count number of returning values (0 to all)
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture>> asyncBopGet(String key,
long from, long to,
ElementFlagFilter eFlagFilter,
int offset, int count,
boolean withDelete,
boolean dropIfEmpty);
/**
* Retrieves an item on given bkey in the b+tree.
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey bkey
* @param eFlagFilter element flag filter
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch.
*/
public CollectionFuture>> asyncBopGet(String key,
long bkey,
ElementFlagFilter eFlagFilter,
boolean withDelete,
boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves count number of items in given bkey range(from..to)
* from offset in the b+tree.
* The returned map from the future should be sorted by the given range.
* {@code
* from >= to : in descending order
* from < to : in ascending order
* }
*
* @param the expected class of the value
* @param key key of a b+tree
* @param from the first bkey
* @param to the last bkey
* @param eFlagFilter element flag filter
* @param offset 0-based offset
* @param count number of returning values (0 to all)
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture>> asyncBopGet(String key,
long from, long to,
ElementFlagFilter eFlagFilter,
int offset, int count,
boolean withDelete,
boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves all items from the map
*
* @param key key of a map
* @param withDelete true to remove the returned item in the map
* @param dropIfEmpty true to remove the key when all elements are removed.
* false map will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture> 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
* @param withDelete true to remove the returned item in the map
* @param dropIfEmpty true to remove the key when all elements are removed.
* false map will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture> 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
* @param withDelete true to remove the returned item in the map
* @param dropIfEmpty true to remove the key when all elements are removed.
* false map will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch.
*/
public CollectionFuture> asyncMopGet(String key, List mkeyList,
boolean withDelete, boolean dropIfEmpty);
/**
* Retrieves all items from the map
*
* @param the expected class of the value
* @param key key of a map
* @param withDelete true to remove the returned item in the map
* @param dropIfEmpty true to remove the key when all elements are removed.
* false map will remain empty even if all the elements are removed
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture> asyncMopGet(String key,
boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves an item on given mkey in the map.
*
* @param the expected class of the value
* @param key key of a map
* @param mkey mkey of a map
* @param withDelete true to remove the returned item in the map
* @param dropIfEmpty true to remove the key when all elements are removed.
* false map will remain empty even if all the elements are removed
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture> asyncMopGet(String key, String mkey,
boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves items on given mkey list in the map.
*
* @param the expected class of the value
* @param key key of a map
* @param mkeyList mkeyList
* @param withDelete true to remove the returned item in the map
* @param dropIfEmpty true to remove the key when all elements are removed.
* false map will remain empty even if all the elements are removed
* @param tc a transcoder to decode returned values
* @return a future that will hold the return value map of the fetch.
*/
public CollectionFuture> asyncMopGet(String key, List mkeyList,
boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves an item on given index in the list.
*
* @param key key of a list
* @param index list index
* @param withDelete true to remove the returned item in the list
* @param dropIfEmpty true to remove the key when all elements are removed.
* false list will remain empty even if all the elements are removed
* @return a future that will hold the return value list of the fetch
*/
public CollectionFuture> 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
* @param withDelete true to remove the returned items in the list
* @param dropIfEmpty true to remove the key when all elements are removed.
* false list will remain empty even if all the elements are removed
* @return a future that will hold the return value list of the fetch
*/
public CollectionFuture> asyncLopGet(String key,
int from, int to,
boolean withDelete, boolean dropIfEmpty);
/**
* Retrieves an item on given index in the list.
*
* @param the expected class of the value
* @param key key of a list
* @param index list index
* @param withDelete true to remove the returned item in the list
* @param dropIfEmpty true to remove the key when all elements are removed.
* false list will remain empty even if all the elements are removed
* @param tc a tranacoder to decode returned value
* @return a future that will hold the return value list of the fetch
*/
public CollectionFuture> asyncLopGet(String key, int index,
boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves items on given index range(from..to) in the list. (Arcus 1.6 and above)
*
* @param 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 withDelete true to remove the returned items in the list
* @param dropIfEmpty true to remove the key when all elements are removed.
* false list will remain empty even if all the elements are removed
* @param tc a transcoder to decode the returned values
* @return a future that will hold the return value list of the fetch
*/
public CollectionFuture> asyncLopGet(String key,
int from, int to,
boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Retrieves count number of random items in the set.
*
* @param key key of a set
* @param count number of items to fetch
* @param withDelete true to remove the returned item in the set
* @param dropIfEmpty true to remove the key when all elements are removed.
* false set will remain empty even if all the elements are removed
* @return a future that will hold the return value set of the fetch
*/
public CollectionFuture> asyncSopGet(String key, int count,
boolean withDelete, boolean dropIfEmpty);
/**
* Retrieves count number of random items in the set.
*
* @param the expected class of the value
* @param key key of a set
* @param count number of items to fetch
* @param withDelete true to remove the returned item in the set
* @param dropIfEmpty true to remove the key when all elements are removed.
* false set will remain empty even if all the elements are removed
* @param tc a tranacoder to decode returned value
* @return a future that will hold the return value set of the fetch
*/
public CollectionFuture> asyncSopGet(String key, int count,
boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Deletes an item with given bkey in the b+tree. (Arcus 1.6 or above)
*
* @param key key of a b+tree
* @param bkey bkey of an item to delete
* @param eFlagFilter element flag filter
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncBopDelete(String key, long bkey,
ElementFlagFilter eFlagFilter,
boolean dropIfEmpty);
/**
* Deletes count number of items in given bkey range(from..to) in the b+tree (Arcus 1.6 or above)
*
* @param key key of a b+tree
* @param from the first bkey to delete
* @param to the last bkey to delete
* @param eFlagFilter element flag filter
* @param count number of returning values (0 to all)
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncBopDelete(String key,
long from, long to,
ElementFlagFilter eFlagFilter,
int count, boolean dropIfEmpty);
/**
* Deletes count number of items in given bkey range(from..to) in the b+tree (Arcus 1.6 or above)
*
* @param key key of a b+tree
* @param from the first bkey to delete
* @param to the last bkey to delete
* @param eFlagFilter element flag filter
* @param count number of returning values (0 to all)
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncBopDelete(String key,
byte[] from, byte[] to,
ElementFlagFilter eFlagFilter,
int count, boolean dropIfEmpty);
/**
* Deletes count number of items in given bkey range(from..to) in the b+tree (Arcus 1.6 or above)
*
* @param key key of a b+tree
* @param bkey bkey to delete
* @param eFlagFilter element flag filter
* @param dropIfEmpty true to remove the key when all elements are removed.
* false b+ tree will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncBopDelete(String key, byte[] bkey,
ElementFlagFilter eFlagFilter,
boolean dropIfEmpty);
/**
* Deletes an item on given index in the map.
*
* @param key key of a map
* @param dropIfEmpty false to remove the key when all elements are removed.
* true b+ tree will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncMopDelete(String key,
boolean dropIfEmpty);
/**
* Deletes an item on given index in the map.
*
* @param key key of a map
* @param mkey mkey of a map
* @param dropIfEmpty false to remove the key when all elements are removed.
* true b+ tree will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncMopDelete(String key, String mkey,
boolean dropIfEmpty);
/**
* Deletes an item on given index in the list.
*
* @param key key of a list
* @param index list index
* @param dropIfEmpty true to remove the key when all elements are removed.
* false list will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncLopDelete(String key, int index,
boolean dropIfEmpty);
/**
* Deletes 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
* @param dropIfEmpty true to remove the key when all elements are removed.
* false list will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncLopDelete(String key, int from,
int to, boolean dropIfEmpty);
/**
* Deletes an item in the set.
*
* @param key key of a set
* @param value value of an item
* @param dropIfEmpty true to remove the key when all elements are removed.
* false set will remain empty even if all the elements are removed
* @return whether or not the operation was performed
*/
public CollectionFuture asyncSopDelete(String key, Object value,
boolean dropIfEmpty);
/**
* Deletes an item in the set.
*
* @param the expected class of the value
* @param key key of a set
* @param value value of an item
* @param dropIfEmpty true to remove the key when all elements are removed.
* false set will remain empty even if all the elements are removed
* @param tc a transcoder to encode the value
* @return whether or not the operation was performed
*/
public CollectionFuture asyncSopDelete(String key, T value,
boolean dropIfEmpty, Transcoder tc);
/**
* Get count of elements in given bkey range(from..to) and eFlagFilter.
*
* @param key key of a b+tree
* @param from the first bkey
* @param to the last bkey
* @param eFlagFilter element flag filter
* @return a future that will hold the count of exists element
*/
public CollectionFuture asyncBopGetItemCount(String key,
long from, long to,
ElementFlagFilter eFlagFilter);
/**
* Inserts an item into the b+tree.
*
* @param key key of a b+tree
* @param bkey key of a b+tree node
* @param eFlag element flag. Length of element flag is between 1 and 31.
* if this argument is null, Arcus don't assign element flag.
* @param value a value to insert into the b+tree
* @param attributesForCreate attributes of the key
* @return a future indicating success, false if there was no key and
* attributesForCreate is null
*/
public CollectionFuture asyncBopInsert(String key, long bkey,
byte[] eFlag, Object value,
CollectionAttributes attributesForCreate);
/**
* Inserts an item into the map
*
* @param key key of a map
* @param mkey key of a map node
* @param value a value to insert into the map
* @param attributesForCreate attributes of the key
* @return a future indicating success, false if there was no key and
* attributesForCreate is null
*/
public CollectionFuture asyncMopInsert(String key, String mkey,
Object value,
CollectionAttributes attributesForCreate);
/**
* Insert a value into each list
*
*
* Note to the index
* The item will be inserted before the element with the given index except below
* -1:append, 0:prepend
*
*
* @param key key of a list
* @param index list index
* (the item will be inserted before the element with the given index)
* @param value a value to insert into each list
* @param attributesForCreate attributes of the key
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture asyncLopInsert(String key, int index,
Object value,
CollectionAttributes attributesForCreate);
/**
* Inserts an item into the set.
*
* @param key key of a set
* @param value a value to insert into the set
* @param attributesForCreate attributes of the key
* @return a future indicating success, false if there was no key
* and attributesForCreate parameter is null.
*/
public CollectionFuture asyncSopInsert(String key, Object value,
CollectionAttributes attributesForCreate);
/**
* Inserts an item into the b+tree.
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey key of a b+tree node
* @param eFlag element flag. Length of element flag is between 1 and 31.
* if this argument is null, Arcus don't assign element flag.
* @param value a value to insert into the b+tree
* @param attributesForCreate attributes of the key
* @param tc a trancoder to encode the value
* @return a future indicating success, false if there was no key
* and attributesForCreate parameter is null.
*/
public CollectionFuture asyncBopInsert(String key, long bkey,
byte[] eFlag, T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Inserts an item into the map
*
* @param the expected class of the value
* @param key key of a map
* @param mkey key of a map node
* @param value a value to insert into the map
* @param attributesForCreate attributes of the key
* @param tc a trancoder to encode the value
* @return a future indicating success, false if there was no key
* and attributesForCreate parameter is null.
*/
public CollectionFuture asyncMopInsert(String key, String mkey,
T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert a value into each list
*
*
* Note to the index
* The item will be inserted before the element with the given index except below
* -1:append, 0:prepend
*
*
* @param the expected class of the value
* @param key key of a list
* @param index list index
* (the item will be inserted before the element with the given index)
* @param value a value to insert into each list
* @param attributesForCreate attributes of the key
* @param tc a transcoder to encode the value
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture asyncLopInsert(String key, int index,
T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Inserts an item into the set.
*
* @param the expected class of the value
* @param key key of a set
* @param value a value to insert into the set
* @param tc a transcoder to encode the value
* @param attributesForCreate attributes of the key
* @return a future indicating success, false if there was no key
* and attributesForCreate parameter is null
*/
public CollectionFuture asyncSopInsert(String key, T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert values into a b+ tree
*
* @param key a key list of b+ tree
* @param elements mkey and value list of map
* @param attributesForCreate attributes of the key
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncBopPipedInsertBulk(
String key, Map elements, CollectionAttributes attributesForCreate);
/**
* Insert values into a map
*
* @param key a key list of map
* @param elements mkey and value list of map
* @param attributesForCreate attributes of the key
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncMopPipedInsertBulk(
String key, Map elements, CollectionAttributes attributesForCreate);
/**
* Insert values into a list
*
*
* Note to the index
* The item will be inserted before the element with the given index except below
* -1:append, 0:prepend
*
*
* @param key a key of the list
* @param index list index
* (the item will be inserted before the element with the given index)
* @param valueList valuses to insert into the set
* @param attributesForCreate attributes of the key
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncLopPipedInsertBulk(
String key, int index, List valueList, CollectionAttributes attributesForCreate);
/**
* Insert values into a set
*
* @param key key of a set
* @param valueList valuses to insert into the set
* @param attributesForCreate attributes of the key
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncSopPipedInsertBulk(
String key, List valueList, CollectionAttributes attributesForCreate);
/**
* Insert values into a b+ tree
*
* @param the expected class of the value
* @param key a key list of b+ tree
* @param elements bkey and value list of map
* @param attributesForCreate attributes of the key
* @param tc transcoder to encode value
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncBopPipedInsertBulk(
String key, Map elements, CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert values into a map
*
* @param the expected class of the value
* @param key a key list of map
* @param elements mkey and value list of map
* @param attributesForCreate attributes of the key
* @param tc transcoder to encode value
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncMopPipedInsertBulk(
String key, Map elements, CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert values into a list
*
*
* Note to the index
* The item will be inserted before the element with the given index except below
* -1:append, 0:prepend
*
*
* @param the expected class of the value
* @param key a key of the list
* @param index list index
* (the item will be inserted before the element with the given index)
* @param valueList valuses to insert into the set
* @param attributesForCreate attributes of the key
* @param tc transcoder to encode value
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncLopPipedInsertBulk(
String key, int index, List valueList, CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Insert values into a set
*
* @param the expected class of the value
* @param key key of a set
* @param valueList valuses to insert into the set
* @param attributesForCreate attributes of the key
* @param tc transcoder to encode value
* @return a future that will indicate the failure list of each operation
*/
public CollectionFuture> asyncSopPipedInsertBulk(
String key, List valueList, CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Flush all items that starts with given prefix from all servers.
*
* @param prefix prefix of the keys
* @return whether or not the operation was accepted
*/
public OperationFuture flush(final String prefix);
/**
* Flush all items that starts with given prefix from all servers with a delay of application.
*
* @param prefix prefix of the keys
* @param delay the period of time to delay, in seconds
* @return whether or not the operation was accepted
*/
public OperationFuture flush(final String prefix, final int delay);
/**
* Get elements that matched both filter and bkey range criteria from
* multiple b+tree. The result is sorted by order of bkey.
*
* @param keyList b+ tree key list
* @param from bkey index from
* @param to bkey index to
* @param eFlagFilter element flag filter
* @param offset 0-base offset
* @param count number of returning values (0 to all)
* @return a future that will hold the return value list of the fetch.
*/
public SMGetFuture>> asyncBopSortMergeGet(
List keyList, long from, long to, ElementFlagFilter eFlagFilter,
int offset, int count);
/**
* Get elements that matched both filter and bkey range criteria from
* multiple b+tree. The result is sorted by order of bkey.
*
* @param keyList b+ tree key list
* @param from bkey index from
* @param to bkey index to
* @param eFlagFilter element flag filter
* @param count number of returning values (0 to all)
* @param smgetMode smgetMode
* @return a future that will hold the return value list of the fetch.
*/
public SMGetFuture>> asyncBopSortMergeGet(
List keyList, long from, long to, ElementFlagFilter eFlagFilter,
int count, SMGetMode smgetMode);
/**
* Update or insert an element.
*
* Element that matched both key and bkey criteria will updated.
* If element is not exists and attributesForCreate argument is not null.
* Create the tree that has an attribute of 'attributesForCreate' and
* insert the element that has elementFlag and value.
*
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param elementFlag flag of element
* @param value value of element
* @param attributesForCreate create a b+tree with this attributes, if given key of b+tree
* is not exists.
* @return a future indicating success, false if there was no key and
* attributesForCreate argument is null.
*/
public CollectionFuture asyncBopUpsert(String key, long bkey,
byte[] elementFlag, Object value,
CollectionAttributes attributesForCreate);
/**
* Update or insert an element.
*
* Element that matched both key and bkey criteria will updated.
* If element is not exists and attributesForCreate argument is not null.
* Create the tree that has an attribute of 'attributesForCreate' and
* insert the element that has elementFlag and value.
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param elementFlag flag of element
* @param value value of element
* @param attributesForCreate create a b+tree with this attributes, if given key of b+tree
* is not exists.
* @param tc transcoder to encode value
* @return a future indicating success, false if there was no key and
* attributesForCreate argument is null.
*/
public CollectionFuture asyncBopUpsert(String key, long bkey,
byte[] elementFlag, T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Update an element from the b+tree
*
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param eFlagUpdate new flag of element.
* do not update the eflag if this argument is null.
* @param value new value of element.
* do not update the value if this argument is null.
* @return a future indicating success
*/
public CollectionFuture asyncBopUpdate(String key, long bkey,
ElementFlagUpdate eFlagUpdate, Object value);
/**
* Update an element from the b+tree
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param eFlagUpdate new flag of element.
* do not update the eflag if this argument is null.
* @param value new value of element.
* do not update the value if this argument is null.
* @param tc a transcoder to encode the value of element
* @return a future indicating success
*/
public CollectionFuture asyncBopUpdate(String key, long bkey,
ElementFlagUpdate eFlagUpdate, T value,
Transcoder tc);
/**
* Update an element from the map
*
* @param key key of a map
* @param mkey key of a map element
* @param value new value of element.
* @return a future indicating success
*/
public CollectionFuture asyncMopUpdate(String key, String mkey,
Object value);
/**
* Update an element from the map
*
* @param the expected class of the value
* @param key key of a map
* @param mkey key of a map element
* @param value new value of element.
* @param tc a transcoder to encode the value of element
* @return a future indicating success
*/
public CollectionFuture asyncMopUpdate(String key, String mkey,
T value, Transcoder tc);
/**
* Update elements from the b+tree
*
* @param key key of a b+tree
* @param elements list of b+tree elements
* @return a future indicating success
*/
public CollectionFuture> asyncBopPipedUpdateBulk(
String key, List> elements);
/**
* Update elements from the b+tree
*
* @param the expected class of the value
* @param key key of a b+tree
* @param elements list of b+tree elements
* @param tc a transcoder to encode the value of element
* @return a future indicating success
*/
public CollectionFuture> asyncBopPipedUpdateBulk(
String key, List> elements, Transcoder tc);
/**
* Update elements from the map
*
* @param key key of a map
* @param elements Map of map element
* @return a future indicating success
*/
public CollectionFuture> asyncMopPipedUpdateBulk(
String key, Map elements);
/**
* Update elements from the map
*
* @param the expected class of the value
* @param key key of a map
* @param elements Map of map element
* @param tc a transcoder to encode the value of element
* @return a future indicating success
*/
public CollectionFuture> asyncMopPipedUpdateBulk(
String key, Map elements, Transcoder tc);
/**
* Insert an item into the b+tree
*
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param eFlag element flag. Length of element flag is between 1 and 31. if
* this value is null, we don't assign element flag.
* @param value new value of element. this value can't be null.
* @param attributesForCreate create a b+tree with this attributes, if given key is not
* exists.
* @return a future indicating success, false if there was no key and
* attributesForCreate argument is null
*/
public CollectionFuture asyncBopInsert(String key,
byte[] bkey, byte[] eFlag, Object value,
CollectionAttributes attributesForCreate);
/**
* Insert an item into the b+tree
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param eFlag element flag. Length of element flag is between 1 and 31. if
* this value is null, we don't assign element flag.
* @param value new value of element. do not update the value if this argument
* is null. this value can't be null.
* @param attributesForCreate create a b+tree with this attributes, if given key is not
* exists.
* @param tc transcoder to encode value
* @return a future indicating success, false if there was no key and
* attributesForCreate argument is null
*/
public CollectionFuture asyncBopInsert(String key,
byte[] bkey, byte[] eFlag, T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Retrieves count number of items in given bkey range(from..to)
* from offset in the b+tree.
* The returned map from the future should be sorted by the given range.
* {@code
* from >= to : in descending order
* from < to : in ascending order
* }
*
* @param key key of a b+tree
* @param from the first bkey
* @param to the last bkey
* @param eFlagFilter element flag filter
* @param offset 0-based offset
* @param count number of returning values (0 to all)
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty false to remove the key when all elements are removed.
* true b+ tree will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture>> asyncBopGet(
String key, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset,
int count, boolean withDelete, boolean dropIfEmpty);
/**
* Retrieves count number of items in given bkey range(from..to)
* from offset in the b+tree.
* The returned map from the future should be sorted by the given range.
* {@code
* from >= to : in descending order
* from < to : in ascending order
* }
*
* @param the expected class of the value
* @param key key of a b+tree
* @param from the first bkey
* @param to the last bkey
* @param eFlagFilter element flag filter
* @param offset 0-based offset
* @param count number of returning values (0 to all)
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty false to remove the key when all elements are removed.
* true b+ tree will remain empty even if all the elements are removed
* @param tc transcoder to decode value
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture>> asyncBopGet(
String key, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset,
int count, boolean withDelete, boolean dropIfEmpty,
Transcoder tc);
/**
* Update or insert an element.
*
* Element that matched both key and bkey criteria will updated. If element
* is not exists and attributesForCreate argument is not null. Create the
* tree that has an attribute of 'attributesForCreate' and insert the
* element that has elementFlag and value.
*
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param elementFlag flag of element
* @param value value of element
* @param attributesForCreate create a b+tree with this attributes, if given key of b+tree
* is not exists.
* @return a future indicating success, false if there was no key and
* attributesForCreate argument is null.
*/
public CollectionFuture asyncBopUpsert(String key,
byte[] bkey, byte[] elementFlag, Object value,
CollectionAttributes attributesForCreate);
/**
* Update or insert an element.
*
* Element that matched both key and bkey criteria will updated. If element
* is not exists and attributesForCreate argument is not null. Create the
* tree that has an attribute of 'attributesForCreate' and insert the
* element that has elementFlag and value.
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param elementFlag flag of element
* @param value value of element
* @param attributesForCreate create a b+tree with this attributes, if given key of b+tree
* is not exists.
* @param tc transcoder to encode value
* @return a future indicating success, false if there was no key and
* attributesForCreate argument is null.
*/
public CollectionFuture asyncBopUpsert(String key,
byte[] bkey, byte[] elementFlag, T value,
CollectionAttributes attributesForCreate,
Transcoder tc);
/**
* Get count of elements in given bkey range(from..to) and eFlagFilter.
*
* @param key key of a b+tree
* @param from the first bkey
* @param to the last bkey
* @param eFlagFilter element flag filter
* @return a future that will hold the count of exists element
*/
public CollectionFuture asyncBopGetItemCount(String key,
byte[] from, byte[] to,
ElementFlagFilter eFlagFilter);
/**
* Update an element from the b+tree
*
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param eFlagUpdate new flag of element. do not update the eflag if this argument
* is null.
* @param value new value of element. do not update the value if this argument
* is null.
* @return a future indicating success
*/
public CollectionFuture asyncBopUpdate(String key,
byte[] bkey, ElementFlagUpdate eFlagUpdate,
Object value);
/**
* Update an element from the b+tree
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey key of a b+tree element
* @param eFlagUpdate new flag of element. do not update the eflag if this argument
* is null.
* @param value new value of element. do not update the value if this argument
* is null.
* @param tc transcoder to encode value
* @return a future indicating success
*/
public CollectionFuture asyncBopUpdate(String key,
byte[] bkey, ElementFlagUpdate eFlagUpdate,
T value, Transcoder tc);
/**
* Checks multiple items' membership in a set using the default transcoder.
*
* @param key key of set
* @param values value list to check membership
* @return a future indicating the map that represent existence of each
* values
*/
public CollectionFuture> asyncSopPipedExistBulk(
String key, List values);
/**
* Checks multiple items' membership in a set using the default transcoder.
*
* @param the expected class of the value
* @param key key of set
* @param values value list to check membership
* @param tc transcoder to decode each value
* @return a future indicating the map that represent existence of each
* value
*/
public CollectionFuture> asyncSopPipedExistBulk(
String key, List values, Transcoder tc);
/**
* Insert elements into a b+tree
*
* @param key a key list of b+ tree
* @param elements element list which insert into b+tree
* @param attributesForCreate create a b+tree with this attributes, if given key is not
* exists.
* @return a future that will hold the index of iteration sequence which
* failed elements and result code.
*/
public CollectionFuture> asyncBopPipedInsertBulk(
String key, List> elements,
CollectionAttributes attributesForCreate);
/**
* Insert elements into a b+tree
*
* @param the expected class of the value
* @param key a key list of b+ tree
* @param elements element list which insert into b+tree
* @param attributesForCreate create a b+tree with this attributes, if given key is not exists.
* @param tc transcoder to decode value
* @return a future that will hold the index of iteration sequence which
* failed elements and result code.
*/
public CollectionFuture> asyncBopPipedInsertBulk(
String key, List> elements,
CollectionAttributes attributesForCreate, Transcoder tc);
/**
* Retrieves count number of items in given bkey in the b+tree.
*
* @param key key of a b+tree
* @param bkey bkey of an element
* @param eFlagFilter element flag filter
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty false to remove the key when all elements are removed. true b+
* tree will remain empty even if all the elements are removed
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture>> asyncBopGet(
String key, byte[] bkey,
ElementFlagFilter eFlagFilter, boolean withDelete, boolean dropIfEmpty);
/**
* Retrieves count number of items in given bkey in the b+tree.
*
* @param the expected class of the value
* @param key key of a b+tree
* @param bkey bkey of an element
* @param eFlagFilter element flag filter
* @param withDelete true to remove the returned item in the b+tree
* @param dropIfEmpty false to remove the key when all elements are removed. true b+
* tree will remain empty even if all the elements are removed
* @param tc transcoder to decode value
* @return a future that will hold the return value map of the fetch
*/
public CollectionFuture>> asyncBopGet(
String key, byte[] bkey,
ElementFlagFilter eFlagFilter, boolean withDelete, boolean dropIfEmpty, Transcoder tc);
/**
* Get elements that matched both filter and bkey range criteria from
* multiple b+tree. The result is sorted by order of bkey.
*
* @param keyList b+ tree key list
* @param from bkey index from
* @param to bkey index to
* @param eFlagFilter element flag filter
* @param offset 0-base offset
* @param count number of returning values (0 to all)
* @return a future that will hold the return value list of the fetch.
*/
public SMGetFuture>> asyncBopSortMergeGet(
List keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter,
int offset, int count);
/**
* Get elements that matched both filter and bkey range criteria from
* multiple b+tree. The result is sorted by order of bkey.
*
* @param keyList b+ tree key list
* @param from bkey index from
* @param to bkey index to
* @param eFlagFilter element flag filter
* @param count number of returning values (0 to all)
* @param smgetMode smgetMode
* @return a future that will hold the return value list of the fetch.
*/
public SMGetFuture