if (props.file_creation_time > 0) {
Add(TablePropertiesNames::kFileCreationTime, props.file_creation_time);
}
+ if (!props.db_id.empty()) {
+ Add(TablePropertiesNames::kDbId, props.db_id);
+ }
+ if (!props.db_session_id.empty()) {
+ Add(TablePropertiesNames::kDbSessionId, props.db_session_id);
+ }
+ if (!props.db_host_id.empty()) {
+ Add(TablePropertiesNames::kDbHostId, props.db_host_id);
+ }
if (!props.filter_policy_name.empty()) {
Add(TablePropertiesNames::kFilterPolicy, props.filter_policy_name);
return all_succeeded;
}
-Status ReadProperties(const Slice& handle_value, RandomAccessFileReader* file,
+Status ReadProperties(const ReadOptions& read_options,
+ const Slice& handle_value, RandomAccessFileReader* file,
FilePrefetchBuffer* prefetch_buffer, const Footer& footer,
const ImmutableCFOptions& ioptions,
TableProperties** table_properties, bool verify_checksum,
}
BlockContents block_contents;
- ReadOptions read_options;
- read_options.verify_checksums = verify_checksum;
Status s;
PersistentCacheOptions cache_options;
-
- BlockFetcher block_fetcher(
- file, prefetch_buffer, footer, read_options, handle, &block_contents,
- ioptions, false /* decompress */, false /*maybe_compressed*/,
- BlockType::kProperties, UncompressionDict::GetEmptyDict(), cache_options,
- memory_allocator);
+ ReadOptions ro = read_options;
+ ro.verify_checksums = verify_checksum;
+
+ BlockFetcher block_fetcher(file, prefetch_buffer, footer, ro, handle,
+ &block_contents, ioptions, false /* decompress */,
+ false /*maybe_compressed*/, BlockType::kProperties,
+ UncompressionDict::GetEmptyDict(), cache_options,
+ memory_allocator);
s = block_fetcher.ReadBlockContents();
// property block is never compressed. Need to add uncompress logic if we are
// to compress it..
return s;
}
- Block properties_block(std::move(block_contents),
- kDisableGlobalSequenceNumber);
+ Block properties_block(std::move(block_contents));
DataBlockIter iter;
- properties_block.NewDataIterator(BytewiseComparator(), BytewiseComparator(),
- &iter);
+ properties_block.NewDataIterator(BytewiseComparator(),
+ kDisableGlobalSequenceNumber, &iter);
auto new_table_properties = new TableProperties();
// All pre-defined properties of type uint64_t
continue;
}
*(pos->second) = val;
+ } else if (key == TablePropertiesNames::kDbId) {
+ new_table_properties->db_id = raw_val.ToString();
+ } else if (key == TablePropertiesNames::kDbSessionId) {
+ new_table_properties->db_session_id = raw_val.ToString();
+ } else if (key == TablePropertiesNames::kDbHostId) {
+ new_table_properties->db_host_id = raw_val.ToString();
} else if (key == TablePropertiesNames::kFilterPolicy) {
new_table_properties->filter_policy_name = raw_val.ToString();
} else if (key == TablePropertiesNames::kColumnFamilyName) {
const ImmutableCFOptions& ioptions,
TableProperties** properties,
bool compression_type_missing,
- MemoryAllocator* memory_allocator) {
+ MemoryAllocator* memory_allocator,
+ FilePrefetchBuffer* prefetch_buffer) {
// -- Read metaindex block
Footer footer;
- auto s = ReadFooterFromFile(file, nullptr /* prefetch_buffer */, file_size,
- &footer, table_magic_number);
+ IOOptions opts;
+ auto s = ReadFooterFromFile(opts, file, prefetch_buffer, file_size, &footer,
+ table_magic_number);
if (!s.ok()) {
return s;
}
PersistentCacheOptions cache_options;
BlockFetcher block_fetcher(
- file, nullptr /* prefetch_buffer */, footer, read_options,
- metaindex_handle, &metaindex_contents, ioptions, false /* decompress */,
+ file, prefetch_buffer, footer, read_options, metaindex_handle,
+ &metaindex_contents, ioptions, false /* decompress */,
false /*maybe_compressed*/, BlockType::kMetaIndex,
UncompressionDict::GetEmptyDict(), cache_options, memory_allocator);
s = block_fetcher.ReadBlockContents();
}
// property blocks are never compressed. Need to add uncompress logic if we
// are to compress it.
- Block metaindex_block(std::move(metaindex_contents),
- kDisableGlobalSequenceNumber);
+ Block metaindex_block(std::move(metaindex_contents));
std::unique_ptr<InternalIterator> meta_iter(metaindex_block.NewDataIterator(
- BytewiseComparator(), BytewiseComparator()));
+ BytewiseComparator(), kDisableGlobalSequenceNumber));
// -- Read property block
bool found_properties_block = true;
TableProperties table_properties;
if (found_properties_block == true) {
s = ReadProperties(
- meta_iter->value(), file, nullptr /* prefetch_buffer */, footer,
+ read_options, meta_iter->value(), file, prefetch_buffer, footer,
ioptions, properties, false /* verify_checksum */,
nullptr /* ret_block_hanel */, nullptr /* ret_block_contents */,
compression_type_missing, memory_allocator);
bool /*compression_type_missing*/,
MemoryAllocator* memory_allocator) {
Footer footer;
- auto s = ReadFooterFromFile(file, nullptr /* prefetch_buffer */, file_size,
- &footer, table_magic_number);
+ IOOptions opts;
+ auto s = ReadFooterFromFile(opts, file, nullptr /* prefetch_buffer */,
+ file_size, &footer, table_magic_number);
if (!s.ok()) {
return s;
}
}
// meta blocks are never compressed. Need to add uncompress logic if we are to
// compress it.
- Block metaindex_block(std::move(metaindex_contents),
- kDisableGlobalSequenceNumber);
+ Block metaindex_block(std::move(metaindex_contents));
std::unique_ptr<InternalIterator> meta_iter;
- meta_iter.reset(metaindex_block.NewDataIterator(BytewiseComparator(),
- BytewiseComparator()));
+ meta_iter.reset(metaindex_block.NewDataIterator(
+ BytewiseComparator(), kDisableGlobalSequenceNumber));
return FindMetaBlock(meta_iter.get(), meta_block_name, block_handle);
}
MemoryAllocator* memory_allocator) {
Status status;
Footer footer;
- status = ReadFooterFromFile(file, prefetch_buffer, file_size, &footer,
+ IOOptions opts;
+ status = ReadFooterFromFile(opts, file, prefetch_buffer, file_size, &footer,
table_magic_number);
if (!status.ok()) {
return status;
// compress it.
// Finding metablock
- Block metaindex_block(std::move(metaindex_contents),
- kDisableGlobalSequenceNumber);
+ Block metaindex_block(std::move(metaindex_contents));
std::unique_ptr<InternalIterator> meta_iter;
- meta_iter.reset(metaindex_block.NewDataIterator(BytewiseComparator(),
- BytewiseComparator()));
+ meta_iter.reset(metaindex_block.NewDataIterator(
+ BytewiseComparator(), kDisableGlobalSequenceNumber));
BlockHandle block_handle;
status = FindMetaBlock(meta_iter.get(), meta_block_name, &block_handle);