1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-17 01:02:23 +03:00

Made the write/append tasks work in 1MB chunks.

Made the read task send a proper error response.
This commit is contained in:
Patrick LeBlanc
2019-01-30 13:00:48 -06:00
parent a24a28fa34
commit 9a3eae4a27
4 changed files with 52 additions and 39 deletions

View File

@@ -48,21 +48,22 @@ void ReadTask::run()
outbuf32[0] = SM_MSG_START;
outbuf32[1] = cmd->count;
// do the reading and writing in chunks
// todo: do the reading and writing in chunks
ioc->willRead(cmd->filename, cmd->offset, cmd->count);
int count = 0, err;
while (count < cmd->count)
{
err = ioc->read(cmd->filename, &outbuf[SM_HEADER_LEN + count], cmd->offset + count, cmd->count - count);
if (err < 0)
{
handleError("ReadTask read data", errno);
return;
}
else if (err == 0)
{
handleError("ReadTask EOF", errno);
return;
if (err <= 0) {
if (count > 0)
outbuf32[1] = count;
else {
outbuf.resize(16);
outbuf32[1] = 8;
outbuf32[2] = err;
outbuf32[3] = errno;
}
break;
}
count += err;
}