src/storage/source/PartitionedFile.cc
int PartitionedFile::updateMeta() {
    if (this->seekNumFlushedPagesInMeta() < 0) {
        return -1;
    }
    unsigned int numFlushedPages = this->getMetaData()->getNumFlushedPages();
    if (this->writeData(this->metaFile, &numFlushedPages, sizeof(unsigned int)) < 0) {
        return -1;
    }
    unsigned int numPartitions = this->dataPartitionPaths.size();
    unsigned int i;
    for (i = 0; i < numPartitions; i++) {
        this->seekNumFlushedPagesInPartitionMeta(i);
        numFlushedPages = this->getMetaData()->getPartition(i)->getNumPages();
        if (this->writeData(this->metaFile, &(numFlushedPages), sizeof(unsigned int)) < 0) {
            return -1;
        }
    }
    fflush(this->metaFile);
    return 0;
}
/**
 * Below function is buggy, please use writeMeta() instead.
 *
 *
 * Update the meta partition based on counters.
 * This can be used after a batch of flushing.
 * The difference between writeMeta() and updateMeta() is that the latter function will only update
 * a few fields.
 */
Below function is buggy, please use writeMeta() instead.
Update the meta partition based on counters.
This can be used after a batch of flushing.
The difference between writeMeta() and updateMeta() is that the latter function will only update
a few fields.
Below function is buggy please use writeMeta () instead . Update the meta partition based on counters . This can be used after a batch of flushing . The difference between writeMeta () and updateMeta () is that the latter function will only update a few fields .
int PartitionedFile::updateMeta() {
    if (this->seekNumFlushedPagesInMeta() < 0) {
        return -1;
    }
    unsigned int numFlushedPages = this->getMetaData()->getNumFlushedPages();
    if (this->writeData(this->metaFile, &numFlushedPages, sizeof(unsigned int)) < 0) {
        return -1;
    }
    unsigned int numPartitions = this->dataPartitionPaths.size();
    unsigned int i;
    for (i = 0; i < numPartitions; i++) {
        this->seekNumFlushedPagesInPartitionMeta(i);
        numFlushedPages = this->getMetaData()->getPartition(i)->getNumPages();
        if (this->writeData(this->metaFile, &(numFlushedPages), sizeof(unsigned int)) < 0) {
            return -1;
        }
    }
    fflush(this->metaFile);
    return 0;
}
int PartitionedFile :: updateMeta ( ) { if ( this -> seekNumFlushedPagesInMeta ( ) < 0 ) { return -1 ; } unsigned int numFlushedPages = this -> getMetaData ( ) -> getNumFlushedPages ( ) ; if ( this -> writeData ( this -> metaFile , & numFlushedPages , sizeof ( unsigned int ) ) < 0 ) { return -1 ; } unsigned int numPartitions = this -> dataPartitionPaths . size ( ) ; unsigned int i ; for ( i = 0 ; i < numPartitions ; i ++ ) { this -> seekNumFlushedPagesInPartitionMeta ( i ) ; numFlushedPages = this -> getMetaData ( ) -> getPartition ( i ) -> getNumPages ( ) ; if ( this -> writeData ( this -> metaFile , & ( numFlushedPages ) , sizeof ( unsigned int ) ) < 0 ) { return -1 ; } } fflush ( this -> metaFile ) ; return 0 ; }
Below function is buggy, please use writeMeta() instead.
Below function is buggy please use writeMeta () instead .