com.aerospike.client.large
Class LargeStack

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

public final class LargeStack
extends java.lang.Object

Create and manage a stack within a single bin. A stack is last in/first out (LIFO).


Constructor Summary
LargeStack(AerospikeClient client, Policy policy, Key key, java.lang.String binName, java.lang.String userModule)
          Initialize large stack operator.
 
Method Summary
 void destroy()
          Delete bin containing the stack.
 java.util.List<?> filter(int peekCount, java.lang.String filterName, Value... filterArgs)
          Select items from top of stack.
 int getCapacity()
          Return maximum number of entries for the stack.
 java.util.Map<?,?> getConfig()
          Return map of stack configuration parameters.
 java.util.List<?> peek(int peekCount)
          Select items from top of stack.
 void push(Value... values)
          Push values onto stack.
 void push(Value value)
          Push value onto stack.
 java.util.List<?> scan()
          Return list of all objects on the stack.
 void setCapacity(int capacity)
          Set maximum number of entries for the stack.
 int size()
          Return size of stack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LargeStack

public LargeStack(AerospikeClient client,
                  Policy policy,
                  Key key,
                  java.lang.String binName,
                  java.lang.String userModule)
Initialize large stack 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

push

public final void push(Value value)
                throws AerospikeException
Push value onto stack. If the stack does not exist, create it using specified userModule configuration.

Parameters:
value - value to push
Throws:
AerospikeException

push

public final void push(Value... values)
                throws AerospikeException
Push values onto stack. If the stack does not exist, create it using specified userModule configuration.

Parameters:
values - values to push
Throws:
AerospikeException

peek

public final java.util.List<?> peek(int peekCount)
                             throws AerospikeException
Select items from top of stack.

Parameters:
peekCount - number of items to select.
Returns:
list of items selected
Throws:
AerospikeException

scan

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

Throws:
AerospikeException

filter

public final java.util.List<?> filter(int peekCount,
                                      java.lang.String filterName,
                                      Value... filterArgs)
                               throws AerospikeException
Select items from top of stack.

Parameters:
peekCount - number of items to select.
filterName - Lua function name which applies filter to returned list
filterArgs - arguments to Lua function name
Returns:
list of items selected
Throws:
AerospikeException

destroy

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

Throws:
AerospikeException

size

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

Throws:
AerospikeException

getConfig

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

Throws:
AerospikeException

setCapacity

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

Parameters:
capacity - max entries in set
Throws:
AerospikeException

getCapacity

public final int getCapacity()
                      throws AerospikeException
Return maximum number of entries for the stack.

Throws:
AerospikeException