benedekh / WeLoveClouds

Repository for submissions on the CloudDB course.
0 stars 1 forks source link

KVAdminMessage (ECS <-> KVServer communication) #76

Closed benedekh closed 7 years ago

benedekh commented 7 years ago

In addition to the query functionality (put, get), the server has to provide the following control functionality to the ECS. Since all these operations have to be invoked by the ECS remotely you have to define a suitable admin message format to pass the commands along with the parameters.

command semantics
initKVServer(metadata, cacheSize, displacementStrategy) Initialize the KVServer with the meta-data, it’s local cache size, and the cache displacement strategy, and block it for client requests, i.e., all client requests are rejected with an SERVER_STOPPED error message; ECS requests have to be processed.
start() Starts the KVServer, all client requests and all ECS requests are processed.
stop() Stops the KVServer, all client requests are rejected and only ECS requests are processed.
shutDown() Exits the KVServer application.
lockWrite() Lock the KVServer for write operations.
unLockWrite() Unlock the KVServer for write operations.
moveData (range, server) Transfer a subset (range) of the KVServer’s data to another KVServer (reallocation before removing this server or adding a new KVServer to the ring); send a notification to the ECS, if data transfer is completed.
update(metadata) Update the meta-data repository of this server.

Note: in my interpretation these operations are received via network from ECS. The ECS starts the KVServer itself by a java -jar ms3-server.jar <port> <debug_level> command, and the server is ready but only accepts ECS connections. For an accidental client connection it responds SERVER_STOPPED, because it was not initialized yet. (Just to clarify why we need the initKVServer command.)