com.aerospike.client
Class LargeStack

java.lang.Object
  extended by com.aerospike.client.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)
          Initialize large stack operator.
 
Method Summary
 void create(java.lang.String configName)
          Create a stack in a single record bin.
 java.util.Map<?,?> getConfig()
          Return map of stack configuration parameters.
 java.util.List<?> peek(int peekCount)
          Select items from top of stack.
 java.util.List<?> peek(int peekCount, java.lang.String filterName, Value... filterArgs)
          Select items from top of stack.
 void push(java.lang.String configName, Value value)
          Push value onto stack.
 void push(Value value)
          Push value onto stack.
 int size()
          Return size of stack.
 void trim(int trimCount)
          Delete items from the top 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)
Initialize large stack operator.

Parameters:
client - client
policy - generic configuration parameters, pass in null for defaults
key - unique record identifier
binName - bin name
Method Detail

create

public final void create(java.lang.String configName)
                  throws AerospikeException
Create a stack in a single record bin.

Parameters:
configName - Lua function name that initializes stack configuration parameters, pass null for default stack
Throws:
AerospikeException

push

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

Parameters:
configName - Lua function name that initializes stack configuration parameters, pass null for default stack
value - value to push
Throws:
AerospikeException

push

public final void push(Value value)
                throws AerospikeException
Push value onto stack. If the stack does not exist, throw an exception.

Parameters:
value - value to insert
Throws:
AerospikeException

trim

public final void trim(int trimCount)
                throws AerospikeException
Delete items from the top of stack.

Parameters:
trimCount - number of items to pop off stack
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

peek

public final java.util.List<?> peek(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

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