Package bftsmart.demo.microbenchmarks
Class ThroughputLatencyServer
- java.lang.Object
-
- bftsmart.tom.server.defaultservices.DefaultRecoverable
-
- bftsmart.demo.microbenchmarks.ThroughputLatencyServer
-
- All Implemented Interfaces:
BatchExecutable,Executable,Recoverable
public final class ThroughputLatencyServer extends DefaultRecoverable
Simple server that just acknowledge the reception of a request.
-
-
Constructor Summary
Constructors Constructor Description ThroughputLatencyServer(int id, int interval, int replySize, int stateSize, boolean context, int signed, int write)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[][]appExecuteBatch(byte[][] commands, MessageContext[] msgCtxs, boolean fromConsensus)Execute a batch of ordered requestsbyte[]appExecuteUnordered(byte[] command, MessageContext msgCtx)Execute an unordered requestbyte[]execute(byte[] command, MessageContext msgCtx)byte[]getSnapshot()Returns a serialized snapshot of the application statevoidinstallSnapshot(byte[] state)Given a snapshot received from the state transfer protocol, install itstatic voidmain(java.lang.String[] args)-
Methods inherited from class bftsmart.tom.server.defaultservices.DefaultRecoverable
executeBatch, executeUnordered, getState, getStateManager, noOp, Op, setClientsManager, setReplicaContext, setState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface bftsmart.tom.server.BatchExecutable
executeBatch
-
Methods inherited from interface bftsmart.tom.server.Executable
executeUnordered, getTOMMessage
-
-
-
-
Method Detail
-
appExecuteBatch
public byte[][] appExecuteBatch(byte[][] commands, MessageContext[] msgCtxs, boolean fromConsensus)Description copied from class:DefaultRecoverableExecute a batch of ordered requests- Specified by:
appExecuteBatchin classDefaultRecoverable- Parameters:
commands- The batch of requestsmsgCtxs- The context associated to each requestfromConsensus- true if the request arrived from a consensus execution, false if it arrives from the state transfer protocol- Returns:
- the respective replies for each request
-
appExecuteUnordered
public byte[] appExecuteUnordered(byte[] command, MessageContext msgCtx)Description copied from class:DefaultRecoverableExecute an unordered request- Specified by:
appExecuteUnorderedin classDefaultRecoverable- Parameters:
command- The unordered requestmsgCtx- The context associated to the request- Returns:
- the reply for the request issued by the client
-
execute
public byte[] execute(byte[] command, MessageContext msgCtx)
-
main
public static void main(java.lang.String[] args)
-
installSnapshot
public void installSnapshot(byte[] state)
Description copied from class:DefaultRecoverableGiven a snapshot received from the state transfer protocol, install it- Specified by:
installSnapshotin classDefaultRecoverable- Parameters:
state- The serialized snapshot
-
getSnapshot
public byte[] getSnapshot()
Description copied from class:DefaultRecoverableReturns a serialized snapshot of the application state- Specified by:
getSnapshotin classDefaultRecoverable- Returns:
- A serialized snapshot of the application state
-
-