Package io.atomix.primitive.service
Class AbstractPrimitiveService<C>
java.lang.Object
io.atomix.primitive.service.AbstractPrimitiveService<C>
- All Implemented Interfaces:
PrimitiveService
public abstract class AbstractPrimitiveService<C> extends Object implements PrimitiveService
Raft service.
-
Method Summary
Modifier and Type Method Description byte[]apply(Commit<byte[]> commit)Applies a commit to the state machine.voidclose(SessionId sessionId)Closes the session with the given identifier.voidexpire(SessionId sessionId)Expires the session with the given identifier.voidinit(ServiceContext context)Initializes the state machine.voidregister(Session session)Registers a primitive session.io.atomix.utils.serializer.Serializerserializer()Returns the primitive service serializer.voidtick(io.atomix.utils.time.WallClockTimestamp timestamp)Increments the Raft service time to the given timestamp.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.atomix.primitive.service.PrimitiveService
backup, close, restore
-
Method Details
-
serializer
public io.atomix.utils.serializer.Serializer serializer()Description copied from interface:PrimitiveServiceReturns the primitive service serializer.- Specified by:
serializerin interfacePrimitiveService- Returns:
- the primitive service serializer
-
init
Description copied from interface:PrimitiveServiceInitializes the state machine.- Specified by:
initin interfacePrimitiveService- Parameters:
context- The state machine context.
-
tick
public final void tick(io.atomix.utils.time.WallClockTimestamp timestamp)Description copied from interface:PrimitiveServiceIncrements the Raft service time to the given timestamp.- Specified by:
tickin interfacePrimitiveService- Parameters:
timestamp- the service timestamp
-
apply
Description copied from interface:PrimitiveServiceApplies a commit to the state machine.- Specified by:
applyin interfacePrimitiveService- Parameters:
commit- the commit to apply- Returns:
- the commit result
-
register
Description copied from interface:PrimitiveServiceRegisters a primitive session.- Specified by:
registerin interfacePrimitiveService- Parameters:
session- the session to register
-
expire
Description copied from interface:PrimitiveServiceExpires the session with the given identifier.- Specified by:
expirein interfacePrimitiveService- Parameters:
sessionId- the session identifier
-
close
Description copied from interface:PrimitiveServiceCloses the session with the given identifier.- Specified by:
closein interfacePrimitiveService- Parameters:
sessionId- the session identifier
-