src/storage/source/PartitionedFile.cc
size_t PartitionedFile::loadPage(FilePartitionID partitionId,
                                 unsigned int pageSeqInPartition,
                                 char* pageInCache,
                                 size_t length) {
    if (usingDirect == true) {
        return loadPageDirect(partitionId, pageSeqInPartition, pageInCache, length);
    }
    FILE* curFile = this->dataFiles.at(partitionId);
    if (curFile == nullptr) {
        return 0;
    }
    if (pageSeqInPartition < this->getMetaData()->getPartition(partitionId)->getNumPages()) {
        seekPage(curFile, pageSeqInPartition);
        return fread(pageInCache, sizeof(char), length, curFile);
    } else {
        return (size_t)-1;
    }
}
/**
 * To load the page from a given sequence/ordering number of the page
 * in the partition that is specified by partitionId.
 * This function will be invoked by PageCache instance,
 * length is the size of shared memory allocated for this load.
 * The PageCache instance should make sure that length == pageSize.
 * Otherwise, if length > pageSize, some space will be wasted, and
 * if length < pageSize, some data on the page may not get loaded.
 *
 * Return loaded size;
 */
To load the page from a given sequence/ordering number of the page
in the partition that is specified by partitionId.
This function will be invoked by PageCache instance,
length is the size of shared memory allocated for this load.
The PageCache instance should make sure that length == pageSize.
Otherwise, if length > pageSize, some space will be wasted, and
if length < pageSize, some data on the page may not get loaded.

Return loaded size.
To load the page from a given sequence / ordering number of the page in the partition that is specified by partitionId . This function will be invoked by PageCache instance length is the size of shared memory allocated for this load . The PageCache instance should make sure that length == pageSize . Otherwise if length > pageSize some space will be wasted and if length < pageSize some data on the page may not get loaded . Return loaded size .
size_t PartitionedFile::loadPage(FilePartitionID partitionId,
                                 unsigned int pageSeqInPartition,
                                 char* pageInCache,
                                 size_t length) {
    if (usingDirect == true) {
        return loadPageDirect(partitionId, pageSeqInPartition, pageInCache, length);
    }
    FILE* curFile = this->dataFiles.at(partitionId);
    if (curFile == nullptr) {
        return 0;
    }
    if (pageSeqInPartition < this->getMetaData()->getPartition(partitionId)->getNumPages()) {
        seekPage(curFile, pageSeqInPartition);
        return fread(pageInCache, sizeof(char), length, curFile);
    } else {
        return (size_t)-1;
    }
}
size_t PartitionedFile :: loadPage ( FilePartitionID partitionId , unsigned int pageSeqInPartition , char * pageInCache , size_t length ) { if ( usingDirect == true ) { return loadPageDirect ( partitionId , pageSeqInPartition , pageInCache , length ) ; } FILE * curFile = this -> dataFiles . at ( partitionId ) ; if ( curFile == nullptr ) { return 0 ; } if ( pageSeqInPartition < this -> getMetaData ( ) -> getPartition ( partitionId ) -> getNumPages ( ) ) { seekPage ( curFile , pageSeqInPartition ) ; return fread ( pageInCache , sizeof ( char ) , length , curFile ) ; } else { return ( size_t ) -1 ; } }
To load the page from a given sequence/ordering number of the page
 in the partition that is specified by partitionId.
To load the page from a given sequence / ordering number of the page in the partition that is specified by partitionId .