/* */ #include "FileAllocationEntry.h" #define BUFSIZE 16*1024 void FileAllocationEntry::allocateChunk() { int32_t bufSize = BUFSIZE; char buf[BUFSIZE]; memset(buf, 0, bufSize); _requestGroup->getSegmentMan()->diskWriter->writeData(buf, bufSize, _offset); _offset += bufSize; int64_t totalLength = _requestGroup->getSegmentMan()->totalSize; if(totalLength < _offset) { _requestGroup->getSegmentMan()->diskWriter->truncate(totalLength); _offset = totalLength; } }