com.aerospike.client.large
Class LargeSet

java.lang.Object
  extended by com.aerospike.client.large.LargeSet

public final class LargeSet
extends java.lang.Object

Create and manage a set within a single bin.


Constructor Summary
LargeSet(AerospikeClient client, Policy policy, Key key, java.lang.String binName, java.lang.String userModule)
          Initialize large set operator.
 
Method Summary
 void add(Value... values)
          Add values to the set.
 void add(Value value)
          Add a value to the set.
 void destroy()
          Delete bin containing the set.
 boolean exists(Value value)
          Check existence of value in the set.
 java.util.List<?> filter(java.lang.String filterName, Value... filterArgs)
          Select values from set and apply specified Lua filter.
 java.lang.Object get(Value value)
          Select value from set.
 int getCapacity()
          Return maximum number of entries in the set.
 java.util.Map<?,?> getConfig()
          Return map of set configuration parameters.
 void remove(Value value)
          Delete value from set.
 java.util.List<?> scan()
          Return list of all objects in the set.
 void setCapacity(int capacity)
          Set maximum number of entries in the set.
 int size()
          Return size of set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LargeSet

public LargeSet(AerospikeClient client,
                Policy policy,
                Key key,
                java.lang.String binName,
                java.lang.String userModule)
Initialize large set operator.

Parameters:
client - client
policy - generic configuration parameters, pass in null for defaults
key - unique record identifier
binName - bin name
userModule - Lua function name that initializes list configuration parameters, pass null for default set
Method Detail

add

public final void add(Value value)
               throws AerospikeException
Add a value to the set. If the set does not exist, create it using specified userModule configuration.

Parameters:
value - value to add
Throws:
AerospikeException

add

public final void add(Value... values)
               throws AerospikeException
Add values to the set. If the set does not exist, create it using specified userModule configuration.

Parameters:
values - values to add
Throws:
AerospikeException

remove

public final void remove(Value value)
                  throws AerospikeException
Delete value from set.

Parameters:
value - value to delete
Throws:
AerospikeException

get

public final java.lang.Object get(Value value)
                           throws AerospikeException
Select value from set.

Parameters:
value - value to select
Returns:
found value
Throws:
AerospikeException

exists

public final boolean exists(Value value)
                     throws AerospikeException
Check existence of value in the set.

Parameters:
value - value to check
Returns:
true if found, otherwise false
Throws:
AerospikeException

scan

public final java.util.List<?> scan()
                             throws AerospikeException
Return list of all objects in the set.

Throws:
AerospikeException

filter

public final java.util.List<?> filter(java.lang.String filterName,
                                      Value... filterArgs)
                               throws AerospikeException
Select values from set and apply specified Lua filter.

Parameters:
filterName - Lua function name which applies filter to returned list
filterArgs - arguments to Lua function name
Returns:
list of entries selected
Throws:
AerospikeException

destroy

public final void destroy()
                   throws AerospikeException
Delete bin containing the set.

Throws:
AerospikeException

size

public final int size()
               throws AerospikeException
Return size of set.

Throws:
AerospikeException

getConfig

public final java.util.Map<?,?> getConfig()
                                   throws AerospikeException
Return map of set configuration parameters.

Throws:
AerospikeException

setCapacity

public final void setCapacity(int capacity)
                       throws AerospikeException
Set maximum number of entries in the set.

Parameters:
capacity - max entries in set
Throws:
AerospikeException

getCapacity

public final int getCapacity()
                      throws AerospikeException
Return maximum number of entries in the set.

Throws:
AerospikeException