| 限定符和类型 | 字段和说明 |
|---|---|
static long |
INVALID_LOG_INDEX
Invalid log index -1.
|
| 构造器和说明 |
|---|
ReadIndexClosure() |
ReadIndexClosure(long timeoutMs)
Create a read-index closure with a timeout parameter.
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getIndex()
The committed log index when starts readIndex request. return -1 if fails.
|
byte[] |
getRequestContext()
Returns the request context.
|
void |
run(Status status)
Called when task is done.
|
abstract void |
run(Status status,
long index,
byte[] reqCtx)
Called when ReadIndex can be executed.
|
void |
setResult(long index,
byte[] reqCtx)
Set callback result, called by jraft.
|
public static final long INVALID_LOG_INDEX
public ReadIndexClosure()
public ReadIndexClosure(long timeoutMs)
timeoutMs - timeout millispublic abstract void run(Status status, long index, byte[] reqCtx)
status - the readIndex status.index - the committed index when starts readIndex.reqCtx - the request context passed by Node.readIndex(byte[], ReadIndexClosure).Node.readIndex(byte[], ReadIndexClosure)public void setResult(long index,
byte[] reqCtx)
index - the committed index.reqCtx - the request context passed by Node.readIndex(byte[], ReadIndexClosure).public long getIndex()
public byte[] getRequestContext()
Copyright © 2021. All rights reserved.