public class SSequence
extends java.lang.Object
implements java.lang.AutoCloseable
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method.Modifier and Type | Method and Description |
---|---|
void |
close()
Close a sequence.
|
long |
get(STransaction txn,
int delta)
Return the next available element in the sequence and changes the
sequence value by delta.
|
SDatabase |
getDatabase()
Return the SDatabase handle associated with this sequence.
|
SDatabaseEntry |
getKey()
Return the SDatabaseEntry used to open this sequence.
|
default <V> V |
handleRuntimeExceptions(com.sleepycat.client.RemoteServiceCallable<V> remote) |
default <V> V |
remoteCall(com.sleepycat.client.RemoteServiceCallable<V> remote) |
default <V> V |
remoteCallWithIOException(com.sleepycat.client.RemoteServiceCallable<V> remote) |
public SDatabase getDatabase()
public SDatabaseEntry getKey()
public void close() throws SDatabaseException
The sequence handle may not be used again after this method has been called, regardless of the method's success or failure.
close
in interface java.lang.AutoCloseable
SDatabaseException
- if any error occurspublic long get(STransaction txn, int delta) throws SDatabaseException
The txn handle must be null if the sequence handle was opened with a non-zero cache size.
For maximum concurrency, a non-zero cache size should be specified prior
to opening the sequence handle, the txn handle should be null, and
SSequenceConfig.setAutoCommitNoSync(boolean)
should be called to disable
log flushes.
txn
- an explicit transaction may be specified, or null may be
specified to use auto-commitdelta
- the amount by which to increment or decrement the sequenceSDatabaseException
- if any error occurspublic <V> V remoteCallWithIOException(com.sleepycat.client.RemoteServiceCallable<V> remote) throws java.io.IOException
java.io.IOException
public <V> V remoteCall(com.sleepycat.client.RemoteServiceCallable<V> remote)
public <V> V handleRuntimeExceptions(com.sleepycat.client.RemoteServiceCallable<V> remote) throws org.apache.thrift.TException
org.apache.thrift.TException
Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.