public class TokenRequest extends Object implements ICorfuPayload<TokenRequest>
There are four token request scenarios, designated by the relevant constants :
0. TokenRequest::TK_QUERY
: Query of the current log tail and of specific stream-tails.
1. TokenRequest::TK_RAW
: Ask for raw (global) log token(s).
This extends the global log tail by the requested # of tokens.
2. TokenRequest::TK_MULTI_STREAM
: Ask for token(s) on multiple streams.
This extends both the global log tail, and each of the specified stream tails,
by the requested # of tokens.
3. TokenRequest::TK_TX
:
First, check transaction resolution. If transaction can commit, then behave
like TokenRequest::TK_MULTI_STREAM
.
ICorfuPayload.PayloadConstructor<T>
Modifier and Type | Field and Description |
---|---|
static byte |
TK_MULTI_STREAM |
static byte |
TK_QUERY |
static byte |
TK_RAW |
static byte |
TK_TX |
constructorMap, lookup
Constructor and Description |
---|
TokenRequest(io.netty.buffer.ByteBuf buf)
Deserialization Constructor from Bytebuf to TokenRequest.
|
TokenRequest(Long numTokens,
List<UUID> streams)
Constructor for generating TokenRequest.
|
TokenRequest(Long numTokens,
List<UUID> streams,
TxResolutionInfo conflictInfo)
Constructor for generating TokenRequest.
|
Modifier and Type | Method and Description |
---|---|
void |
doSerialize(io.netty.buffer.ByteBuf buf) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enumMapFromBuffer, fromBuffer, fromBuffer, listFromBuffer, mapFromBuffer, rangeFromBuffer, rangeSetFromBuffer, serialize, setFromBuffer
public static final byte TK_QUERY
public static final byte TK_RAW
public static final byte TK_MULTI_STREAM
public static final byte TK_TX
public TokenRequest(Long numTokens, List<UUID> streams, TxResolutionInfo conflictInfo)
numTokens
- number of tokens to requeststreams
- streams UUIDs required in the token requestconflictInfo
- transaction resolution informationpublic TokenRequest(Long numTokens, List<UUID> streams)
numTokens
- number of tokens to requeststreams
- streams UUIDs required in the token requestpublic TokenRequest(io.netty.buffer.ByteBuf buf)
buf
- The buffer to deserializepublic void doSerialize(io.netty.buffer.ByteBuf buf)
doSerialize
in interface ICorfuPayload<TokenRequest>
Copyright © 2019 CorfuDB. All rights reserved.