Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 80a3b6f

Browse files
Addressed Prashanth's initial comments
1 parent eba81dd commit 80a3b6f

File tree

11 files changed

+21
-41
lines changed

11 files changed

+21
-41
lines changed

src/catalog/layout_catalog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//
33
// Peloton
44
//
5-
// layout_catalog.h
5+
// layout_catalog.cpp
66
//
7-
// Identification: src/include/catalog/layout_catalog.cpp
7+
// Identification: src/catalog/layout_catalog.cpp
88
//
9-
// Copyright (c) 2015-18, Carnegie Mellon University Database Group
9+
// Copyright (c) 2015-2018, Carnegie Mellon University Database Group
1010
//
1111
//===----------------------------------------------------------------------===//
1212

src/codegen/updater.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ char *Updater::GetDataPtr(uint32_t tile_group_id, uint32_t tuple_offset) {
4646

4747
// Get the tile offset assuming that it is still a row store
4848
// Hence the Tile offset is 0.
49-
auto layout = tile_group->GetLayout();
49+
UNUSED_ATTRIBUTE const auto &layout = tile_group->GetLayout();
5050
PELOTON_ASSERT(layout.IsRowStore());
5151
tile_ = tile_group->GetTileReference(0);
5252
return tile_->GetTupleLocation(tuple_offset);

src/include/catalog/layout_catalog.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
//===----------------------------------------------------------------------===//
14-
// pg_layout
15-
//
16-
// Schema: (column offset: column_name)
17-
// 0: table_oid (pkey)
18-
// 1: layout_oid (pkey)
19-
// 2: num_columns (number of columns in the layout)
20-
// 3: column_map (map column_oid to <tile_offset, tile_column_oid>)
21-
//
22-
// Indexes: (index offset: indexed columns)
23-
// 0: table_oid & layout_oid (unique & primary key)
24-
// 1: table_oid (non-unique)
25-
//
26-
//===----------------------------------------------------------------------===//
27-
2813
#pragma once
2914

3015
#include "catalog/abstract_catalog.h"

src/include/catalog/table_catalog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace peloton {
3939

4040
namespace storage {
4141
class Layout;
42-
}
42+
} // namespace storage
4343

4444
namespace catalog {
4545

src/include/codegen/runtime_functions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717

1818
namespace peloton {
1919

20-
namespace catalog {
21-
class Schema;
22-
}
23-
2420
namespace storage {
2521
class DataTable;
2622
class TileGroup;

src/include/codegen/tile_group.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class TileGroup {
137137

138138
inline const TileGroup &GetTileGroup() const { return tile_group_; }
139139

140-
inline const ColumnLayout &GetLayout(uint32_t col_idx) const {
140+
const ColumnLayout &GetLayout(uint32_t col_idx) const {
141141
return layout_[col_idx];
142142
}
143143

src/include/common/internal_types.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,11 +1406,6 @@ typedef std::unordered_set<expression::AbstractExpression *,
14061406
*/
14071407
typedef std::map<oid_t, std::pair<oid_t, oid_t>> column_map_type;
14081408

1409-
/* tile_map_type used to store the mapping between a tile and its columns
1410-
* <tile index> to vector{<original column index, tile column offset>}
1411-
*/
1412-
typedef std::map<oid_t, std::vector<std::pair<oid_t, oid_t>>> tile_map_type;
1413-
14141409
//===--------------------------------------------------------------------===//
14151410
// Wire protocol typedefs
14161411
//===--------------------------------------------------------------------===//

src/include/storage/data_table.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ class DataTable : public AbstractTable {
249249

250250
void ClearLayoutSamples();
251251

252-
inline void SetDefaultLayout(std::shared_ptr<const Layout> new_layout) {
252+
void SetDefaultLayout(std::shared_ptr<const Layout> new_layout) {
253253
PELOTON_ASSERT(new_layout->GetColumnCount() == schema->GetColumnCount());
254254
default_layout_ = new_layout;
255255
}
256256

257-
inline void ResetDefaultLayout(LayoutType type = LayoutType::ROW) {
257+
void ResetDefaultLayout(LayoutType type = LayoutType::ROW) {
258258
PELOTON_ASSERT((type == LayoutType::ROW) || (type == LayoutType::COLUMN));
259259
default_layout_ = std::shared_ptr<const Layout>(
260260
new const Layout(schema->GetColumnCount(), type));
@@ -438,8 +438,8 @@ class DataTable : public AbstractTable {
438438
bool dirty_ = false;
439439

440440
// Last used layout_oid. Used while creating new layouts
441-
// Initialized to COLUMN_STORE_OID since its the highest predfeined value.
442-
std::atomic<oid_t> current_layout_oid_ = ATOMIC_VAR_INIT(COLUMN_STORE_OID);
441+
// Initialized to COLUMN_STORE_OID since its the highest predefined value.
442+
std::atomic<oid_t> current_layout_oid_;
443443

444444
//===--------------------------------------------------------------------===//
445445
// TUNING MEMBERS

src/include/storage/layout.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// Identification: src/include/storage/layout.h
88
//
9-
// Copyright (c) 2015-18, Carnegie Mellon University Database Group
9+
// Copyright (c) 2015-2018, Carnegie Mellon University Database Group
1010
//
1111
//===----------------------------------------------------------------------===//
1212

@@ -27,10 +27,15 @@ namespace peloton {
2727

2828
namespace catalog {
2929
class Schema;
30-
}
30+
} // namespace catalog
3131

3232
namespace storage {
3333

34+
/** @brief used to store the mapping between a tile and its columns
35+
* <tile index> to vector{<original column index, tile column offset>}
36+
*/
37+
typedef std::map<oid_t, std::vector<std::pair<oid_t, oid_t>>> tile_map_type;
38+
3439
/**
3540
* @brief Class to store the physical layout of a TileGroup.
3641
*/
@@ -62,12 +67,10 @@ class Layout : public Printable {
6267
Layout(const column_map_type &column_map, oid_t layout_oid);
6368

6469
/** @brief Check whether this layout is a row store. */
65-
inline bool IsRowStore() const { return (layout_type_ == LayoutType::ROW); }
70+
bool IsRowStore() const { return (layout_type_ == LayoutType::ROW); }
6671

6772
/** @brief Check whether this layout is a column store. */
68-
inline bool IsColumnStore() const {
69-
return (layout_type_ == LayoutType::COLUMN);
70-
}
73+
bool IsColumnStore() const { return (layout_type_ == LayoutType::COLUMN); }
7174

7275
/** @brief Return the layout_oid_ of this object. */
7376
oid_t GetOid() const { return layout_oid_; }

src/storage/data_table.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ DataTable::DataTable(catalog::Schema *schema, const std::string &table_name,
6767
database_oid(database_oid),
6868
table_name(table_name),
6969
tuples_per_tilegroup_(tuples_per_tilegroup),
70+
current_layout_oid_(ATOMIC_VAR_INIT(COLUMN_STORE_OID)),
7071
adapt_table_(adapt_table),
7172
trigger_list_(new trigger::TriggerList()) {
7273
if (is_catalog == true) {

0 commit comments

Comments
 (0)