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

Commit b8d8cf8

Browse files
authored
Merge branch 'master' into join-reordering
2 parents 1f80075 + 8dde4d6 commit b8d8cf8

24 files changed

+121
-120
lines changed

src/common/init.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include <gflags/gflags.h>
1616
#include <google/protobuf/stubs/common.h>
1717

18-
#include "brain/index_tuner.h"
19-
#include "brain/layout_tuner.h"
18+
#include "tuning/index_tuner.h"
19+
#include "tuning/layout_tuner.h"
2020
#include "catalog/catalog.h"
2121
#include "common/statement_cache_manager.h"
2222
#include "common/thread_pool.h"
@@ -43,7 +43,7 @@ void PelotonInit::Initialize() {
4343
// start worker pool
4444
threadpool::MonoQueuePool::GetInstance().Startup();
4545

46-
// start brain thread pool
46+
// start indextuner thread pool
4747
if (settings::SettingsManager::GetBool(settings::SettingId::brain)) {
4848
threadpool::MonoQueuePool::GetBrainInstance().Startup();
4949
}
@@ -62,13 +62,13 @@ void PelotonInit::Initialize() {
6262
if (settings::SettingsManager::GetBool(settings::SettingId::index_tuner)) {
6363
// Set the default visibility flag for all indexes to false
6464
index::IndexMetadata::SetDefaultVisibleFlag(false);
65-
auto &index_tuner = brain::IndexTuner::GetInstance();
65+
auto &index_tuner = tuning::IndexTuner::GetInstance();
6666
index_tuner.Start();
6767
}
6868

6969
// start layout tuner
7070
if (settings::SettingsManager::GetBool(settings::SettingId::layout_tuner)) {
71-
auto &layout_tuner = brain::LayoutTuner::GetInstance();
71+
auto &layout_tuner = tuning::LayoutTuner::GetInstance();
7272
layout_tuner.Start();
7373
}
7474

@@ -94,13 +94,13 @@ void PelotonInit::Initialize() {
9494
void PelotonInit::Shutdown() {
9595
// shut down index tuner
9696
if (settings::SettingsManager::GetBool(settings::SettingId::index_tuner)) {
97-
auto &index_tuner = brain::IndexTuner::GetInstance();
97+
auto &index_tuner = tuning::IndexTuner::GetInstance();
9898
index_tuner.Stop();
9999
}
100100

101101
// shut down layout tuner
102102
if (settings::SettingsManager::GetBool(settings::SettingId::layout_tuner)) {
103-
auto &layout_tuner = brain::LayoutTuner::GetInstance();
103+
auto &layout_tuner = tuning::LayoutTuner::GetInstance();
104104
layout_tuner.Stop();
105105
}
106106

@@ -113,7 +113,7 @@ void PelotonInit::Shutdown() {
113113
// stop worker pool
114114
threadpool::MonoQueuePool::GetInstance().Shutdown();
115115

116-
// stop brain thread pool
116+
// stop indextuner thread pool
117117
if (settings::SettingsManager::GetBool(settings::SettingId::brain)) {
118118
threadpool::MonoQueuePool::GetBrainInstance().Shutdown();
119119
}

src/include/concurrency/transaction_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class TransactionContext : public Printable {
186186
eid_t epoch_id_;
187187

188188
// vector of strings to log at the end of the transaction
189-
// populated only if the brain is running
189+
// populated only if the indextuner is running
190190
std::vector<std::string> query_strings_;
191191

192192
// timestamp when the transaction began

src/include/storage/data_table.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ extern std::vector<peloton::oid_t> sdbench_column_ids;
3333

3434
namespace peloton {
3535

36-
namespace brain {
36+
namespace tuning {
3737
class Sample;
38-
} // namespace brain
38+
} // namespace indextuner
3939

4040
namespace catalog {
4141
class ForeignKey;
@@ -241,9 +241,9 @@ class DataTable : public AbstractTable {
241241
// LAYOUT TUNER
242242
//===--------------------------------------------------------------------===//
243243

244-
void RecordLayoutSample(const brain::Sample &sample);
244+
void RecordLayoutSample(const tuning::Sample &sample);
245245

246-
std::vector<brain::Sample> GetLayoutSamples();
246+
std::vector<tuning::Sample> GetLayoutSamples();
247247

248248
void ClearLayoutSamples();
249249

@@ -255,9 +255,9 @@ class DataTable : public AbstractTable {
255255
// INDEX TUNER
256256
//===--------------------------------------------------------------------===//
257257

258-
void RecordIndexSample(const brain::Sample &sample);
258+
void RecordIndexSample(const tuning::Sample &sample);
259259

260-
std::vector<brain::Sample> GetIndexSamples();
260+
std::vector<tuning::Sample> GetIndexSamples();
261261

262262
void ClearIndexSamples();
263263

@@ -418,13 +418,13 @@ class DataTable : public AbstractTable {
418418
column_map_type default_partition_;
419419

420420
// samples for layout tuning
421-
std::vector<brain::Sample> layout_samples_;
421+
std::vector<tuning::Sample> layout_samples_;
422422

423423
// layout samples mutex
424424
std::mutex layout_samples_mutex_;
425425

426426
// samples for layout tuning
427-
std::vector<brain::Sample> index_samples_;
427+
std::vector<tuning::Sample> index_samples_;
428428

429429
// index samples mutex
430430
std::mutex index_samples_mutex_;

src/include/storage/tile_group_header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class TileGroupHeader : public Printable {
304304

305305
common::synchronization::SpinLatch tile_header_lock;
306306

307-
// Immmutable Flag. Should be set by the brain to be true.
307+
// Immmutable Flag. Should be set by the indextuner to be true.
308308
// By default it will be set to false.
309309
bool immutable;
310310
};

src/include/brain/brain_util.h renamed to src/include/tuning/brain_util.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// brain_util.h
66
//
7-
// Identification: /peloton/src/include/brain/brain_util.h
7+
// Identification: /peloton/src/include/tuning/brain_util.h
88
//
99
// Copyright (c) 2015-2017, Carnegie Mellon University Database Group
1010
//
@@ -19,10 +19,10 @@
1919
#include <vector>
2020
#include <algorithm>
2121

22-
#include "brain/sample.h"
22+
#include "sample.h"
2323

2424
namespace peloton {
25-
namespace brain {
25+
namespace tuning {
2626

2727
/**
2828
* Brain Utility Functions
@@ -34,9 +34,9 @@ class BrainUtil {
3434
* It's a vector because there could be more multiple samples per table.
3535
* TableName -> Sample
3636
*/
37-
static std::unordered_map<std::string, std::vector<brain::Sample>> LoadSamplesFile(
37+
static std::unordered_map<std::string, std::vector<tuning::Sample>> LoadSamplesFile(
3838
const std::string file_path) {
39-
std::unordered_map<std::string, std::vector<brain::Sample>> samples;
39+
std::unordered_map<std::string, std::vector<tuning::Sample>> samples;
4040

4141
// Parse the input file line-by-line
4242
std::ifstream infile(file_path);
@@ -60,7 +60,7 @@ class BrainUtil {
6060
}
6161
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
6262

63-
brain::Sample sample(columns, weight, brain::SampleType::ACCESS);
63+
tuning::Sample sample(columns, weight, tuning::SampleType::ACCESS);
6464
samples[name].push_back(sample);
6565

6666
} // WHILE

src/include/brain/clusterer.h renamed to src/include/tuning/clusterer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// clusterer.h
66
//
7-
// Identification: src/include/brain/clusterer.h
7+
// Identification: src/include/tuning/clusterer.h
88
//
99
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
1010
//
@@ -17,12 +17,12 @@
1717
#include <map>
1818

1919
#include "common/printable.h"
20-
#include "brain/sample.h"
20+
#include "sample.h"
2121
#include "common/printable.h"
2222
#include "common/internal_types.h"
2323

2424
namespace peloton {
25-
namespace brain {
25+
namespace tuning {
2626

2727
#define NEW_SAMPLE_WEIGHT 0.01
2828

@@ -123,5 +123,5 @@ class Clusterer : public Printable {
123123
oid_t sample_column_count_;
124124
};
125125

126-
} // namespace brain
126+
} // namespace indextuner
127127
} // namespace peloton

src/include/brain/index_tuner.h renamed to src/include/tuning/index_tuner.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//
33
// Peloton
44
//
5-
// index_tuner.h
5+
// indextuner.h
66
//
7-
// Identification: src/include/brain/index_tuner.h
7+
// Identification: src/include/tuning/indextuner.h
88
//
99
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
1010
//
@@ -29,7 +29,7 @@ namespace storage {
2929
class DataTable;
3030
}
3131

32-
namespace brain {
32+
namespace tuning {
3333

3434
/**
3535
* Load statistics for Index Tuner from a file
@@ -224,7 +224,7 @@ class IndexTuner {
224224
*
225225
* @return The workload write ratio.
226226
*/
227-
double ComputeWorkloadWriteRatio(const std::vector<brain::Sample> &samples);
227+
double ComputeWorkloadWriteRatio(const std::vector<tuning::Sample> &samples);
228228

229229
void DropIndexes(storage::DataTable *table);
230230

@@ -293,5 +293,5 @@ class IndexTuner {
293293
bool visibility_mode_ = false;
294294
};
295295

296-
} // namespace brain
296+
} // namespace indextuner
297297
} // namespace peloton

src/include/brain/layout_tuner.h renamed to src/include/tuning/layout_tuner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// layout_tuner.h
66
//
7-
// Identification: src/include/brain/layout_tuner.h
7+
// Identification: src/include/tuning/layout_tuner.h
88
//
99
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
1010
//
@@ -17,7 +17,7 @@
1717
#include <thread>
1818
#include <vector>
1919

20-
#include "brain/clusterer.h"
20+
#include "clusterer.h"
2121
#include "common/internal_types.h"
2222
#include "common/timer.h"
2323

@@ -27,7 +27,7 @@ namespace storage {
2727
class DataTable;
2828
}
2929

30-
namespace brain {
30+
namespace tuning {
3131

3232
//===--------------------------------------------------------------------===//
3333
// Layout Tuner
@@ -144,5 +144,5 @@ class LayoutTuner {
144144

145145
};
146146

147-
} // namespace brain
147+
} // namespace indextuner
148148
} // namespace peloton

src/include/brain/sample.h renamed to src/include/tuning/sample.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// sample.h
66
//
7-
// Identification: src/include/brain/sample.h
7+
// Identification: src/include/tuning/sample.h
88
//
99
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
1010
//
@@ -19,7 +19,7 @@
1919
#include "common/internal_types.h"
2020

2121
namespace peloton {
22-
namespace brain {
22+
namespace tuning {
2323

2424
#define DEFAULT_SAMPLE_WEIGHT 1.0
2525
#define DEFAULT_COLUMN_VALUE 0.5
@@ -170,14 +170,14 @@ class Sample : public Printable {
170170

171171
};
172172

173-
} // namespace brain
173+
} // namespace indextuner
174174
} // namespace peloton
175175

176176
namespace std {
177177

178178
template <>
179-
struct hash<peloton::brain::Sample> {
180-
size_t operator()(const peloton::brain::Sample &sample) const {
179+
struct hash<peloton::tuning::Sample> {
180+
size_t operator()(const peloton::tuning::Sample &sample) const {
181181
// Compute individual hash values using XOR and bit shifting:
182182
long hash = 31;
183183
auto columns = sample.GetColumnsAccessed();

src/main/peloton/peloton.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
DECLARE_bool(help);
2323

2424
int main(int argc, char *argv[]) {
25+
2526
// Parse the command line flags
2627
::google::ParseCommandLineNonHelpFlags(&argc, &argv, true);
2728

0 commit comments

Comments
 (0)