1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-18 13:54:11 +03:00

Integrated IOCoordinator with the posix tasks.

This commit is contained in:
Patrick LeBlanc
2019-01-30 10:24:37 -06:00
parent f10bcc0774
commit 9a7f793c7f
8 changed files with 102 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
#include "OpenTask.h"
#include "IOCoordinator.h"
#include "messageFormat.h"
#include <sys/stat.h>
#include <errno.h>
@@ -8,6 +9,8 @@
using namespace std;
extern storagemanager::IOCoordinator *ioc;
namespace storagemanager
{
@@ -44,13 +47,16 @@ void OpenTask::run()
cmd_overlay *cmd = (cmd_overlay *) buf;
// IOC->open(cmd->filename, cmd->openmode, &buf[SM_HEADER_LEN])
int err = ioc->open(cmd->filename, cmd->openmode, (struct stat *) &buf[SM_HEADER_LEN]);
if (err)
{
handleError("OpenTask open", errno);
return;
}
// stand-in dummy response
uint32_t *buf32 = (uint32_t *) buf;
buf32[0] = SM_MSG_START;
buf32[1] = sizeof(struct stat);
memset(&buf[SM_HEADER_LEN], 0, sizeof(struct stat));
success = write(buf, sizeof(struct stat) + SM_HEADER_LEN);
if (!success)
handleError("OpenTask write", errno);