OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableMetadata.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 #include <string>
19 #include "TableDescriptor.h"
20 struct TableMetadata {
21  int32_t table_id;
22  std::string table_name;
23  int32_t owner_id;
24  std::string owner_name;
26  int32_t num_columns;
27  bool is_sharded;
28  int32_t num_shards;
29  int64_t max_rows;
30  int32_t fragment_size;
32  int32_t min_epoch;
33  int32_t max_epoch;
34  int32_t min_epoch_floor;
35  int32_t max_epoch_floor;
36  int64_t num_bytes;
37  int64_t num_files;
38  int64_t num_pages;
40  : table_id(td->tableId)
41  , table_name(td->tableName)
42  , owner_id(td->userId)
43  , is_temp_table(td->persistenceLevel != Data_Namespace::MemoryLevel::DISK_LEVEL)
44  , num_columns(td->nColumns)
45  , is_sharded(td->nShards > 0)
46  , num_shards(td->nShards)
47  , max_rows(td->maxRows)
48  , fragment_size(td->maxFragRows)
49  , max_rollback_epochs(td->maxRollbackEpochs) {}
50 };
int32_t fragment_size
Definition: TableMetadata.h:30
int32_t num_columns
Definition: TableMetadata.h:26
int32_t min_epoch_floor
Definition: TableMetadata.h:34
int32_t max_epoch_floor
Definition: TableMetadata.h:35
std::string owner_name
Definition: TableMetadata.h:24
std::string table_name
Definition: TableMetadata.h:22
int32_t max_rollback_epochs
Definition: TableMetadata.h:31
int32_t min_epoch
Definition: TableMetadata.h:32
int64_t max_rows
Definition: TableMetadata.h:29
int64_t num_files
Definition: TableMetadata.h:37
int64_t num_bytes
Definition: TableMetadata.h:36
int32_t table_id
Definition: TableMetadata.h:21
int32_t max_epoch
Definition: TableMetadata.h:33
int32_t num_shards
Definition: TableMetadata.h:28
int64_t num_pages
Definition: TableMetadata.h:38
TableMetadata(const TableDescriptor *td)
Definition: TableMetadata.h:39
int32_t owner_id
Definition: TableMetadata.h:23