src/storage/source/PartitionedFile.cc
size_t PartitionedFile::loadPageFromCurPos(FilePartitionID partitionId,
                                           unsigned int pageSeqInPartition,
                                           char* pageInCache,
                                           size_t length) {
    FILE* curFile = this->dataFiles.at(partitionId);
    if (curFile == nullptr) {
        return 0;
    }
    if (pageSeqInPartition < this->getMetaData()->getPartition(partitionId)->getNumPages()) {
        return fread(pageInCache, sizeof(char), length, curFile);
    } else {
        return (size_t)(-1);
    }
}
/**
 * Similar with above method.
 * The difference is this method will not seek, it just load sequentially,
 * so the caller needs to make sure current position is correct.
 */
Similar with above method.
The difference is this method will not seek, it just load sequentially,
so the caller needs to make sure current position is correct.
Similar with above method . The difference is this method will not seek it just load sequentially so the caller needs to make sure current position is correct .
size_t PartitionedFile::loadPageFromCurPos(FilePartitionID partitionId,
                                           unsigned int pageSeqInPartition,
                                           char* pageInCache,
                                           size_t length) {
    FILE* curFile = this->dataFiles.at(partitionId);
    if (curFile == nullptr) {
        return 0;
    }
    if (pageSeqInPartition < this->getMetaData()->getPartition(partitionId)->getNumPages()) {
        return fread(pageInCache, sizeof(char), length, curFile);
    } else {
        return (size_t)(-1);
    }
}
size_t PartitionedFile :: loadPageFromCurPos ( FilePartitionID partitionId , unsigned int pageSeqInPartition , char * pageInCache , size_t length ) { FILE * curFile = this -> dataFiles . at ( partitionId ) ; if ( curFile == nullptr ) { return 0 ; } if ( pageSeqInPartition < this -> getMetaData ( ) -> getPartition ( partitionId ) -> getNumPages ( ) ) { return fread ( pageInCache , sizeof ( char ) , length , curFile ) ; } else { return ( size_t ) ( -1 ) ; } }
Similar with above method.
Similar with above method .