Skip to content
Juvix imports

module arch.node.engines.local_time_series_storage_messages;

import prelude open;

Local Time Series Storage Messages

These are the messages that the Local Time Series Storage engine can receive/respond to.

Message interface

Auxiliary Juvix code

syntax alias TSStorageDBQuery := String;

syntax alias TSStorageDBData := String;

syntax alias EpochTimestamp := Nat;

GetDataTSStorageDBRequest

type GetDataTSStorageDBRequest :=
mkGetDataTSStorageDBRequest@{query : TSStorageDBQuery};
Arguments
query
The query to find the requested time series data in the DB.

GetDataTSStorageDBResponse

type GetDataTSStorageDBResponse :=
mkGetDataTSStorageDBResponse@{
query : TSStorageDBQuery;
data : TSStorageDBData;
};
Arguments
query
The query to find the requested time series data in the DB.
data
The requested time series data.

RecordDataTSStorageDBRequest

type RecordDataTSStorageDBRequest :=
mkRecordDataTSStorageDBRequest@{query : TSStorageDBQuery};
Arguments
query
The query that expresses the addition of the time series data into the DB.

RecordDataTSStorageDBResponse

type RecordDataTSStorageDBResponse :=
mkRecordDataTSStorageDBResponse@{
query : TSStorageDBQuery;
success : Bool;
};
Arguments
query
The query that expresses the recording of the time series data into the DB.
success
The success of the operation, indicating if the data was stored successfully or not.

DeleteDataTSStorageDBRequest

type DeleteDataTSStorageDBRequest :=
mkDeleteDataTSStorageDBRequest@{query : TSStorageDBQuery};
Arguments
query
The query that expresses the deletion of the time series data from the DB.

DeleteDataTSStorageDBResponse

type DeleteDataTSStorageDBResponse :=
mkDeleteDataTSStorageDBResponse@{
query : TSStorageDBQuery;
success : Bool;
};
Arguments
query
The query that expresses the deletion of the time series data from the DB.
success
The success of the operation, indicating if the data was deleted successfully or not.

DataChangedTSStorageDB

type DataChangedTSStorageDB :=
mkDataChangedTSStorageDB@{
query : TSStorageDBQuery;
data : TSStorageDBData;
timestamp : EpochTimestamp;
};
Arguments
query
The query that expresses the change of the time series DB.
data
The changed time series data.
timestamp
The wall clock time of the moment the data was changed.

LocalTSStorageMsg

type LocalTSStorageMsg :=
| LocalTSStorageMsgGetRequest GetDataTSStorageDBRequest
| LocalTSStorageMsgGetResponse GetDataTSStorageDBResponse
| LocalTSStorageMsgRecordRequest RecordDataTSStorageDBRequest
| LocalTSStorageMsgRecordResponse RecordDataTSStorageDBResponse
| LocalTSStorageMsgDeleteRequest DeleteDataTSStorageDBRequest
| LocalTSStorageMsgDeleteResponse DeleteDataTSStorageDBResponse
| LocalTSStorageMsgDataChanged DataChangedTSStorageDB;

Sequence Diagrams

GetDataTSStorageDBRequest & GetDataTSStorageDBResponse

sequenceDiagram
    participant AnyEngine
    participant LocalTSStorageDB

    AnyEngine ->> LocalTSStorageDB: GetDataTSStorageDBRequest
    LocalTSStorageDB ->> AnyEngine: GetDataTSStorageDBResponse
Sequence Diagram: Get Data Flow

RecordDataTSStorageDBRequest & RecordDataTSStorageDBResponse

sequenceDiagram
    participant AnyEngine
    participant LocalTSStorageDB

    AnyEngine ->> LocalTSStorageDB: RecordDataTSStorageDBRequest
    LocalTSStorageDB ->> AnyEngine: RecordDataTSStorageDBResponse
Sequence Diagram: Record Data Flow

DeleteDataTSStorageDBRequest & DeleteDataTSStorageDBResponse

sequenceDiagram
    participant AnyEngine
    participant LocalTSStorageDB

    AnyEngine ->> LocalTSStorageDB: DeleteDataTSStorageDBRequest
    LocalTSStorageDB ->> AnyEngine: DeleteDataTSStorageDBResponse
Sequence Diagram: Delete Data Flow