YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
public: /* Information about temporary files used in external merge sort */ struct merge_file_info {
File m_fd = -1; /* file descriptor */
ulong m_num_sort_buffers = 0; /* number of sort buffers in temp file */
};
/* Buffer for sorting in main memory. */ struct merge_buf_info { /* heap memory allocated for main memory sort/merge */
std::unique_ptr<uchar[]> m_block; const ulonglong
m_block_len; /* amount of data bytes allocated for block above */
ulonglong m_curr_offset; /* offset of the record pointer for the block */
ulonglong m_disk_start_offset; /* where the chunk starts on disk */
ulonglong m_disk_curr_offset; /* current offset on disk */
ulonglong m_total_size; /* total # of data bytes in chunk */
explicit merge_buf_info(const ulonglong merge_block_size)
: m_block(nullptr),
m_block_len(merge_block_size),
m_curr_offset(0),
m_disk_start_offset(0),
m_disk_curr_offset(0),
m_total_size(merge_block_size) { /* Will throw an exception if it runs out of memory here */
m_block = std::unique_ptr<uchar[]>(new uchar[merge_block_size]);
/* Initialize entire buffer to 0 to avoid valgrind errors */
memset(m_block.get(), 0, merge_block_size);
}
};
/* Represents an entry in the heap during merge phase of external sort */ struct merge_heap_entry {
std::shared_ptr<merge_buf_info> m_chunk_info; /* pointer to buffer info */
uchar *m_block; /* pointer to heap memory where record is stored */ const rocksdb::Comparator *const m_comparator;
rocksdb::Slice m_key; /* current key pointed to by block ptr */
rocksdb::Slice m_val;
/* Represents a record in unsorted buffer */ struct merge_record {
uchar *m_block; /* points to offset of key in sort buffer */ const rocksdb::Comparator *const m_comparator;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.