public interface PrimitiveService
Commit,
ServiceContext,
ServiceExecutor| Modifier and Type | Method and Description |
|---|---|
byte[] |
apply(Commit<byte[]> commit)
Applies a commit to the state machine.
|
void |
backup(BackupOutput output)
Backs up the service state to the given buffer.
|
default void |
close()
Closes the state machine.
|
void |
close(SessionId sessionId)
Closes the session with the given identifier.
|
void |
expire(SessionId sessionId)
Expires the session with the given identifier.
|
void |
init(ServiceContext context)
Initializes the state machine.
|
void |
register(Session session)
Registers a primitive session.
|
void |
restore(BackupInput input)
Restores the service state from the given buffer.
|
Serializer |
serializer()
Returns the primitive service serializer.
|
void |
tick(WallClockTimestamp timestamp)
Increments the Raft service time to the given timestamp.
|
void init(ServiceContext context)
context - The state machine context.NullPointerException - if context is nullvoid tick(WallClockTimestamp timestamp)
timestamp - the service timestampSerializer serializer()
void backup(BackupOutput output)
output - the buffer to which to back up the service statevoid restore(BackupInput input)
input - the buffer from which to restore the service statebyte[] apply(Commit<byte[]> commit)
commit - the commit to applyvoid register(Session session)
session - the session to registervoid expire(SessionId sessionId)
sessionId - the session identifiervoid close(SessionId sessionId)
sessionId - the session identifierdefault void close()
Copyright © 2013–2018. All rights reserved.