Package bftsmart.demo.ycsb
Class YCSBServer
- java.lang.Object
-
- bftsmart.tom.server.defaultservices.DefaultRecoverable
-
- bftsmart.demo.ycsb.YCSBServer
-
- All Implemented Interfaces:
BatchExecutable
,Executable
,Recoverable
public class YCSBServer extends DefaultRecoverable
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[][]
appExecuteBatch(byte[][] commands, MessageContext[] msgCtx, boolean fromConsensus)
Execute a batch of ordered requestsbyte[]
appExecuteUnordered(byte[] theCommand, MessageContext theContext)
Execute an unordered requestbyte[]
getSnapshot()
Returns a serialized snapshot of the application statevoid
installSnapshot(byte[] state)
Given a snapshot received from the state transfer protocol, install itstatic void
main(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
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
appExecuteBatch
public byte[][] appExecuteBatch(byte[][] commands, MessageContext[] msgCtx, boolean fromConsensus)
Description copied from class:DefaultRecoverable
Execute a batch of ordered requests- Specified by:
appExecuteBatch
in classDefaultRecoverable
- Parameters:
commands
- The batch of requestsmsgCtx
- 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[] theCommand, MessageContext theContext)
Description copied from class:DefaultRecoverable
Execute an unordered request- Specified by:
appExecuteUnordered
in classDefaultRecoverable
- Parameters:
theCommand
- The unordered requesttheContext
- The context associated to the request- Returns:
- the reply for the request issued by the client
-
installSnapshot
public void installSnapshot(byte[] state)
Description copied from class:DefaultRecoverable
Given a snapshot received from the state transfer protocol, install it- Specified by:
installSnapshot
in classDefaultRecoverable
- Parameters:
state
- The serialized snapshot
-
getSnapshot
public byte[] getSnapshot()
Description copied from class:DefaultRecoverable
Returns a serialized snapshot of the application state- Specified by:
getSnapshot
in classDefaultRecoverable
- Returns:
- A serialized snapshot of the application state
-
-