You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-17 01:02:23 +03:00
Added a comment documenting the format of the messages
between SM and clients.
This commit is contained in:
@@ -8,16 +8,98 @@ namespace storagemanager
|
|||||||
{
|
{
|
||||||
|
|
||||||
static const uint SM_MSG_START=0xbf65a7e1;
|
static const uint SM_MSG_START=0xbf65a7e1;
|
||||||
|
static const char *socket_name = "\0storagemanager";
|
||||||
|
|
||||||
enum Opcodes {
|
enum Opcodes {
|
||||||
OPEN,
|
OPEN,
|
||||||
READ,
|
READ,
|
||||||
WRITE,
|
WRITE,
|
||||||
STAT,
|
STAT,
|
||||||
UNLINK
|
UNLINK,
|
||||||
|
APPEND,
|
||||||
|
TRUNCATE,
|
||||||
|
LIST_DIRECTORY,
|
||||||
|
PING
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
/*
|
||||||
|
All commands sent to and from StorageManager begin with
|
||||||
|
SM_MSG_START, and a uint32_t for the length of the payload.
|
||||||
|
|
||||||
|
In the payload, all responses from StorageManager begin with
|
||||||
|
a return code, which is the same as the corresponding syscall.
|
||||||
|
If the return code is an error (usually < 0), then a 4-byte
|
||||||
|
value for errno follows. On success, no errno is sent.
|
||||||
|
|
||||||
|
On success, what follows is any output parameters from the call.
|
||||||
|
|
||||||
|
OPEN
|
||||||
|
----
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename|4-byte openmode
|
||||||
|
|
||||||
|
response format:
|
||||||
|
struct stat
|
||||||
|
|
||||||
|
READ
|
||||||
|
----
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename|size_t count|off_t offset
|
||||||
|
|
||||||
|
response format:
|
||||||
|
data (size is stored in the return code)
|
||||||
|
|
||||||
|
WRITE
|
||||||
|
-----
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename|size_t count|off_t offset|data
|
||||||
|
|
||||||
|
response format:
|
||||||
|
|
||||||
|
APPEND
|
||||||
|
------
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename|size_t count|data
|
||||||
|
|
||||||
|
response format:
|
||||||
|
|
||||||
|
UNLINK
|
||||||
|
------
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename
|
||||||
|
|
||||||
|
response format:
|
||||||
|
|
||||||
|
STAT
|
||||||
|
----
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename
|
||||||
|
|
||||||
|
response format:
|
||||||
|
struct stat
|
||||||
|
|
||||||
|
TRUNCATE
|
||||||
|
--------
|
||||||
|
command format:
|
||||||
|
opcode|4-byte filename length|filename|off64_t length
|
||||||
|
|
||||||
|
response format:
|
||||||
|
|
||||||
|
LIST_DIRECTORY
|
||||||
|
--------------
|
||||||
|
command format:
|
||||||
|
opcode|4-byte path length|pathname
|
||||||
|
|
||||||
|
response format:
|
||||||
|
4-byte num elements|
|
||||||
|
(4-byte filename length|filename) * num elements
|
||||||
|
|
||||||
|
PING
|
||||||
|
----
|
||||||
|
command format:
|
||||||
|
opcode
|
||||||
|
|
||||||
|
reponse format:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user