OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::anonymous_namespace{InternalStorageStatsDataWrapper.cpp} Namespace Reference

Functions

void set_null (import_export::TypedImportBuffer *import_buffer)
 
void populate_import_buffers_for_storage_details (const std::vector< StorageDetails > &storage_details, std::map< std::string, import_export::TypedImportBuffer * > &import_buffers)
 

Function Documentation

void foreign_storage::anonymous_namespace{InternalStorageStatsDataWrapper.cpp}::populate_import_buffers_for_storage_details ( const std::vector< StorageDetails > &  storage_details,
std::map< std::string, import_export::TypedImportBuffer * > &  import_buffers 
)

Definition at line 38 of file InternalStorageStatsDataWrapper.cpp.

References set_null().

Referenced by foreign_storage::InternalStorageStatsDataWrapper::populateChunkBuffersForTable().

40  {
41  for (const auto& storage_detail : storage_details) {
42  if (import_buffers.find("node") != import_buffers.end()) {
43  import_buffers["node"]->addString(storage_detail.node);
44  }
45  if (import_buffers.find("database_id") != import_buffers.end()) {
46  import_buffers["database_id"]->addInt(storage_detail.database_id);
47  }
48  if (import_buffers.find("table_id") != import_buffers.end()) {
49  import_buffers["table_id"]->addInt(storage_detail.table_id);
50  }
51  if (import_buffers.find("epoch") != import_buffers.end()) {
52  import_buffers["epoch"]->addInt(storage_detail.storage_stats.epoch);
53  }
54  if (import_buffers.find("epoch_floor") != import_buffers.end()) {
55  import_buffers["epoch_floor"]->addInt(storage_detail.storage_stats.epoch_floor);
56  }
57  if (import_buffers.find("fragment_count") != import_buffers.end()) {
58  auto import_buffer = import_buffers["fragment_count"];
59  if (storage_detail.storage_stats.fragment_count.has_value()) {
60  import_buffer->addInt(storage_detail.storage_stats.fragment_count.value());
61  } else {
62  set_null(import_buffer);
63  }
64  }
65  if (import_buffers.find("shard_id") != import_buffers.end()) {
66  import_buffers["shard_id"]->addInt(storage_detail.shard_id);
67  }
68  if (import_buffers.find("data_file_count") != import_buffers.end()) {
69  import_buffers["data_file_count"]->addInt(
70  storage_detail.storage_stats.data_file_count);
71  }
72  if (import_buffers.find("metadata_file_count") != import_buffers.end()) {
73  import_buffers["metadata_file_count"]->addInt(
74  storage_detail.storage_stats.metadata_file_count);
75  }
76  if (import_buffers.find("total_data_file_size") != import_buffers.end()) {
77  import_buffers["total_data_file_size"]->addBigint(
78  storage_detail.storage_stats.total_data_file_size);
79  }
80  if (import_buffers.find("total_data_page_count") != import_buffers.end()) {
81  import_buffers["total_data_page_count"]->addBigint(
82  storage_detail.storage_stats.total_data_page_count);
83  }
84  if (import_buffers.find("total_free_data_page_count") != import_buffers.end()) {
85  auto import_buffer = import_buffers["total_free_data_page_count"];
86  if (storage_detail.storage_stats.total_free_data_page_count.has_value()) {
87  import_buffer->addBigint(
88  storage_detail.storage_stats.total_free_data_page_count.value());
89  } else {
90  set_null(import_buffer);
91  }
92  }
93  if (import_buffers.find("total_metadata_file_size") != import_buffers.end()) {
94  import_buffers["total_metadata_file_size"]->addBigint(
95  storage_detail.storage_stats.total_metadata_file_size);
96  }
97  if (import_buffers.find("total_metadata_page_count") != import_buffers.end()) {
98  import_buffers["total_metadata_page_count"]->addBigint(
99  storage_detail.storage_stats.total_metadata_page_count);
100  }
101  if (import_buffers.find("total_free_metadata_page_count") != import_buffers.end()) {
102  auto import_buffer = import_buffers["total_free_metadata_page_count"];
103  if (storage_detail.storage_stats.total_free_metadata_page_count.has_value()) {
104  import_buffer->addBigint(
105  storage_detail.storage_stats.total_free_metadata_page_count.value());
106  } else {
107  set_null(import_buffer);
108  }
109  }
110  if (import_buffers.find("total_dictionary_data_file_size") != import_buffers.end()) {
111  import_buffers["total_dictionary_data_file_size"]->addBigint(
112  storage_detail.total_dictionary_data_file_size);
113  }
114  }
115 }
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::anonymous_namespace{InternalStorageStatsDataWrapper.cpp}::set_null ( import_export::TypedImportBuffer import_buffer)

Definition at line 34 of file InternalStorageStatsDataWrapper.cpp.

References import_export::TypedImportBuffer::add_value(), and import_export::TypedImportBuffer::getColumnDesc().

34  {
35  import_buffer->add_value(import_buffer->getColumnDesc(), "", true, {});
36 }
void add_value(const ColumnDescriptor *cd, const std::string_view val, const bool is_null, const CopyParams &copy_params)
Definition: Importer.cpp:549
const ColumnDescriptor * getColumnDesc() const
Definition: Importer.h:311

+ Here is the call graph for this function: