Extend Protocol
This commit is contained in:
parent
0052f8ab60
commit
c26a7c9d75
|
@ -1,14 +1,2 @@
|
||||||
pub fn add(left: u64, right: u64) -> u64 {
|
|
||||||
left + right
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn it_works() {
|
|
||||||
let result = add(2, 2);
|
|
||||||
assert_eq!(result, 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,11 +4,69 @@
|
||||||
|
|
||||||
=> Two seperate ways of communicating: One for neogtioating task queue stuff and one for data (Linked with UUID)
|
=> Two seperate ways of communicating: One for neogtioating task queue stuff and one for data (Linked with UUID)
|
||||||
|
|
||||||
# Data Pull/Push
|
## Conn-Status
|
||||||
|
|
||||||
|
### Login
|
||||||
|
*Request:*
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"transaction_uuid":<transaction_uuid>,
|
||||||
|
"specs": {
|
||||||
|
"threads":<threads:u64>,
|
||||||
|
"clock":<clock:f64>,
|
||||||
|
"mem":<mem:u64>,
|
||||||
|
"net_speed_kib":<net_speed:f64>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*Response:*
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"transaction_uuid":<transaction_uuid>,
|
||||||
|
"status":<ACCEPTED|REJECTED>,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
### Uptime Polling
|
||||||
|
*Request/Response:*
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"transaction_uuid":<transaction_uuid>
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Logout
|
||||||
|
*Request:*
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"transaction_uuid":<transaction_uuid>,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*Response:*
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"transaction_uuid":<transaction_uuid>,
|
||||||
|
"status":<ACK|OK|ERR>
|
||||||
|
}
|
||||||
|
```
|
||||||
|
>If the re-scheduling fails trigger the worker-node to give all HashMap-data to the head-node
|
||||||
## Pull
|
## Pull
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"protocol_id":<protocol_id>,
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
"uuid":<uuid>,
|
"uuid":<uuid>,
|
||||||
"hashmap_id":<hashmap_id>,
|
"hashmap_id":<hashmap_id>,
|
||||||
}
|
}
|
||||||
|
@ -18,6 +76,8 @@
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"protocol_id":<protocol_id>,
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"uuid":<uuid>,
|
||||||
"status":<OK|HASH_ERR|TIMEOUT_ERR>,
|
"status":<OK|HASH_ERR|TIMEOUT_ERR>,
|
||||||
"uuid":<uuid>,
|
"uuid":<uuid>,
|
||||||
"hashmap_id":<hashmap_id>
|
"hashmap_id":<hashmap_id>
|
||||||
|
@ -28,6 +88,8 @@
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"protocol_id":<protocol_id>,
|
"protocol_id":<protocol_id>,
|
||||||
|
"node_id":<node_id>,
|
||||||
|
"uuid":<uuid>,
|
||||||
"uuid":<uuid>,
|
"uuid":<uuid>,
|
||||||
"hashmap_id":<hashmap_id>,
|
"hashmap_id":<hashmap_id>,
|
||||||
"length_decomp": <length_decomp>,
|
"length_decomp": <length_decomp>,
|
||||||
|
@ -58,4 +120,5 @@
|
||||||
|
|
||||||
**Control Flow**
|
**Control Flow**
|
||||||
`protocol_id`: `data_push | data_pull | data_response | hash_push | hash_pull | hash_response`
|
`protocol_id`: `data_push | data_pull | data_response | hash_push | hash_pull | hash_response`
|
||||||
|
`node_id`:unique identifier of nodes. (Hostnames)
|
||||||
`status`: error codes indicating success of transmission
|
`status`: error codes indicating success of transmission
|
Loading…
Reference in a new issue