You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MCOL-498. Segment files extension uses fallocate() now to optimize load put on SSD disks.
This commit is contained in:
@@ -279,4 +279,21 @@ int BufferedFile::close()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int BufferedFile::fallocate(int mode, off64_t offset, off64_t length)
|
||||
{
|
||||
int ret = 0;
|
||||
int savedErrno = 0;
|
||||
|
||||
ret = ::fallocate( fileno(m_fp), mode, offset, length );
|
||||
savedErrno = errno;
|
||||
|
||||
if ( ret == -1 && IDBLogger::isEnabled() )
|
||||
{
|
||||
IDBLogger::logNoArg(m_fname, this, "fallocate", errno);
|
||||
}
|
||||
|
||||
errno = savedErrno;
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -50,6 +50,7 @@ public:
|
||||
/* virtual */ off64_t tell();
|
||||
/* virtual */ int flush();
|
||||
/* virtual */ time_t mtime();
|
||||
/* virtual */ int fallocate(int mode, off64_t offset, off64_t length);
|
||||
|
||||
protected:
|
||||
/* virtual */
|
||||
|
@@ -186,6 +186,12 @@ public:
|
||||
*/
|
||||
virtual time_t mtime() = 0;
|
||||
|
||||
/**
|
||||
* The fallocate() method returns the modification time of the file in
|
||||
* seconds. Returns -1 on error.
|
||||
*/
|
||||
virtual int fallocate(int mode, off64_t offset, off64_t length) = 0;
|
||||
|
||||
int colWidth()
|
||||
{
|
||||
return m_fColWidth;
|
||||
|
@@ -329,4 +329,21 @@ int UnbufferedFile::close()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int UnbufferedFile::fallocate(int mode, off64_t offset, off64_t length)
|
||||
{
|
||||
int ret = 0;
|
||||
int savedErrno = 0;
|
||||
|
||||
ret = ::fallocate( m_fd, mode, offset, length );
|
||||
savedErrno = errno;
|
||||
|
||||
if ( ret == -1 && IDBLogger::isEnabled() )
|
||||
{
|
||||
IDBLogger::logNoArg(m_fname, this, "fallocate", errno);
|
||||
}
|
||||
|
||||
errno = savedErrno;
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -47,6 +47,7 @@ public:
|
||||
/* virtual */ off64_t tell();
|
||||
/* virtual */ int flush();
|
||||
/* virtual */ time_t mtime();
|
||||
/* virtual */ int fallocate(int mode, off64_t offset, off64_t length);
|
||||
|
||||
protected:
|
||||
/* virtual */
|
||||
|
@@ -348,4 +348,10 @@ int HdfsFile::close()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int HdfsFile::fallocate(int mode, off64_t offset, off64_t length)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
/* virtual */ off64_t tell();
|
||||
/* virtual */ int flush();
|
||||
/* virtual */ time_t mtime();
|
||||
/* virtual */ int fallocate(int mode, off64_t offset, off64_t length);
|
||||
|
||||
protected:
|
||||
/* virtual */
|
||||
|
@@ -317,4 +317,9 @@ int HdfsRdwrFileBuffer::close()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int HdfsRdwrFileBuffer::fallocate(int mode, off64_t offset, off64_t length)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
/* virtual */ off64_t tell();
|
||||
/* virtual */ int flush();
|
||||
/* virtual */ time_t mtime();
|
||||
/* virtual*/ int fallocate(int mode, off64_t offset, off64_t length);
|
||||
|
||||
protected:
|
||||
/* virtual */
|
||||
|
@@ -507,5 +507,10 @@ int HdfsRdwrMemBuffer::close()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int HdfsRdwrMemBuffer::fallocate(int mode, off64_t offset, off64_t length)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
/* virtual */ off64_t tell();
|
||||
/* virtual */ int flush();
|
||||
/* virtual */ time_t mtime();
|
||||
/* virtual */ int fallocate(int mode, off64_t offset, off64_t length);
|
||||
|
||||
// Returns the total size of all currently allocated HdfsRdwrMemBuffers
|
||||
static size_t getTotalBuff()
|
||||
|
Reference in New Issue
Block a user