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

Commit 14d2c24

Browse files
authored
Merge branch 'master' into fix/readme-platform-support
2 parents 1201e61 + b7aa304 commit 14d2c24

File tree

11 files changed

+315
-229
lines changed

11 files changed

+315
-229
lines changed

.travis.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,50 @@ matrix:
2828
- g++-4.8
2929
env:
3030
# NAME has no actual use, just to make the travis jobs overview more clear
31-
- NAME="gcc4.8 Debug+Tests+Coveralls"
31+
- NAME="gcc4.8 Debug"
3232
- CXX=g++-4.8
3333
- CC=gcc-4.8
3434
- PELOTON_BUILD_TYPE=Debug
3535
# COVERALLS: we run coveralls only for one compiler
36+
- COVERALLS=Off
37+
38+
- os: linux
39+
sudo: required
40+
dist: trusty
41+
compiler: gcc
42+
addons:
43+
apt:
44+
sources:
45+
- llvm-toolchain-precise-3.7
46+
- ubuntu-toolchain-r-test
47+
packages:
48+
- g++-4.8
49+
env:
50+
# NAME has no actual use, just to make the travis jobs overview more clear
51+
- NAME="gcc4.8 Release"
52+
- CXX=g++-4.8
53+
- CC=gcc-4.8
54+
- PELOTON_BUILD_TYPE=Release
55+
- COVERALLS=Off
56+
57+
# Linux builds for gcc 5
58+
- os: linux
59+
sudo: required
60+
dist: trusty
61+
compiler: gcc
62+
addons:
63+
apt:
64+
sources:
65+
- llvm-toolchain-precise-3.7
66+
- ubuntu-toolchain-r-test
67+
packages:
68+
- g++-5
69+
env:
70+
# NAME has no actual use, just to make the travis jobs overview more clear
71+
- NAME="gcc5 Debug/Tests/AddressSanitizer/Coveralls"
72+
- CXX=g++-5
73+
- CC=gcc-5
74+
- PELOTON_BUILD_TYPE=Debug
3675
- COVERALLS=On
3776
# override script value to run also tests and benchmarks
3877
script:
@@ -67,12 +106,12 @@ matrix:
67106
- llvm-toolchain-precise-3.7
68107
- ubuntu-toolchain-r-test
69108
packages:
70-
- g++-4.8
109+
- g++-5
71110
env:
72111
# NAME has no actual use, just to make the travis jobs overview more clear
73-
- NAME="gcc4.8 Release+Tests"
74-
- CXX=g++-4.8
75-
- CC=gcc-4.8
112+
- NAME="gcc5 Release/Tests/AddressSanitizer"
113+
- CXX=g++-5
114+
- CC=gcc-5
76115
- PELOTON_BUILD_TYPE=Release
77116
- COVERALLS=Off
78117
# override script value to run also tests and benchmarks
@@ -96,45 +135,6 @@ matrix:
96135
# run jdbc tests
97136
- python ../script/validators/jdbc_validator.py
98137

99-
# Linux builds for gcc 5
100-
- os: linux
101-
sudo: required
102-
dist: trusty
103-
compiler: gcc
104-
addons:
105-
apt:
106-
sources:
107-
- llvm-toolchain-precise-3.7
108-
- ubuntu-toolchain-r-test
109-
packages:
110-
- g++-5
111-
env:
112-
# NAME has no actual use, just to make the travis jobs overview more clear
113-
- NAME="gcc5 Debug"
114-
- CXX=g++-5
115-
- CC=gcc-5
116-
- PELOTON_BUILD_TYPE=Debug
117-
- COVERALLS=Off
118-
119-
- os: linux
120-
sudo: required
121-
dist: trusty
122-
compiler: gcc
123-
addons:
124-
apt:
125-
sources:
126-
- llvm-toolchain-precise-3.7
127-
- ubuntu-toolchain-r-test
128-
packages:
129-
- g++-5
130-
env:
131-
# NAME has no actual use, just to make the travis jobs overview more clear
132-
- NAME="gcc5 Release"
133-
- CXX=g++-5
134-
- CC=gcc-5
135-
- PELOTON_BUILD_TYPE=Release
136-
- COVERALLS=Off
137-
138138
install:
139139
# setup environment
140140
- ./script/installation/packages.sh

script/installation/packages.sh

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ function install_protobuf3.4.0() {
6767
# Utility function for installing tensorflow components of python/C++
6868
function install_tf() {
6969
TFCApiFile=$1
70-
TFBinaryURL=$2
70+
TF_VERSION=$2
7171
LinkerConfigCmd=$3
7272
TARGET_DIRECTORY="/usr/local"
7373
# Install Tensorflow Python Binary
74-
sudo -E pip3 install --upgrade ${TFBinaryURL}
74+
sudo -E pip3 install --upgrade pip
75+
sudo -E pip3 install --upgrade tensorflow==${TF_VERSION}
7576

7677
# Install C-API
7778
TFCApiURL="https://storage.googleapis.com/tensorflow/libtensorflow/${TFCApiFile}"
@@ -88,7 +89,6 @@ function install_tf() {
8889
## ------------------------------------------------
8990
if [ "$DISTRO" = "UBUNTU" ]; then
9091
MAJOR_VER=$(echo "$DISTRO_VER" | cut -d '.' -f 1)
91-
9292
# Fix for LLVM-3.7 on Ubuntu 14 + 17
9393
if [ "$MAJOR_VER" == "14" -o "$MAJOR_VER" == "17" ]; then
9494
if [ "$MAJOR_VER" == "14" ]; then
@@ -120,19 +120,16 @@ if [ "$DISTRO" = "UBUNTU" ]; then
120120
if [ "$MAJOR_VER" == "14" ]; then
121121
PKG_CMAKE="cmake3"
122122
FORCE_Y="--force-yes"
123-
TF_VERSION="1.4.0"
124-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp34-cp34m-linux_x86_64.whl"
123+
TF_VERSION="1.4.0"
125124
fi
126125
if [ "$MAJOR_VER" == "16" ]; then
127-
TF_VERSION="1.5.0"
128-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp35-cp35m-linux_x86_64.whl"
126+
TF_VERSION="1.5.0"
129127
fi
130128
# Fix for llvm on Ubuntu 17.x
131129
if [ "$MAJOR_VER" == "17" ]; then
132130
PKG_LLVM="llvm-3.9"
133131
PKG_CLANG="clang-3.8"
134-
TF_VERSION="1.5.0"
135-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp35-cp35m-linux_x86_64.whl"
132+
TF_VERSION="1.5.0"
136133
fi
137134
TFCApiFile="libtensorflow-${TF_TYPE}-linux-x86_64-${TF_VERSION}.tar.gz"
138135
LinkerConfigCmd="sudo ldconfig"
@@ -168,7 +165,7 @@ if [ "$DISTRO" = "UBUNTU" ]; then
168165
# Install version of protobuf needed by C-API
169166
install_protobuf3.4.0 "ubuntu"
170167
# Install tensorflow
171-
install_tf "$TFCApiFile" "$TFBinaryURL" "$LinkerConfigCmd"
168+
install_tf "$TFCApiFile" "$TF_VERSION" "$LinkerConfigCmd"
172169

173170
## ------------------------------------------------
174171
## DEBIAN
@@ -208,7 +205,6 @@ elif [[ "$DISTRO" == *"FEDORA"* ]]; then
208205
esac
209206
TF_VERSION="1.5.0"
210207
TFCApiFile="libtensorflow-${TF_TYPE}-linux-x86_64-${TF_VERSION}.tar.gz"
211-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp36-cp36m-linux_x86_64.whl"
212208
LinkerConfigCmd="sudo ldconfig"
213209
sudo dnf -q install -y \
214210
git \
@@ -244,7 +240,7 @@ elif [[ "$DISTRO" == *"FEDORA"* ]]; then
244240
# Install version of protobuf needed by C-API
245241
install_protobuf3.4.0 "fedora"
246242
# Install tensorflow
247-
install_tf "$TFCApiFile" "$TFBinaryURL" "$LinkerConfigCmd"
243+
install_tf "$TFCApiFile" "$TF_VERSION" "$LinkerConfigCmd"
248244

249245
## ------------------------------------------------
250246
## REDHAT
@@ -325,7 +321,6 @@ elif [ "$DISTRO" = "DARWIN" ]; then
325321
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
326322
fi
327323
TF_VERSION="1.4.0"
328-
TFBinaryURL="https://storage.googleapis.com/tensorflow/mac/${TF_TYPE}/tensorflow-${TF_VERSION}-py3-none-any.whl"
329324
TFCApiFile="libtensorflow-${TF_TYPE}-darwin-x86_64-${TF_VERSION}.tar.gz"
330325
LinkerConfigCmd="sudo update_dyld_shared_cache"
331326
brew install git
@@ -349,7 +344,7 @@ elif [ "$DISTRO" = "DARWIN" ]; then
349344
brew upgrade python
350345
# Brew installs correct version of Protobuf(3.5.1 >= 3.4.0)
351346
# So we can directly install tensorflow
352-
install_tf "$TFCApiFile" "$TFBinaryURL" "$LinkerConfigCmd"
347+
install_tf "$TFCApiFile" "$TF_VERSION" "$LinkerConfigCmd"
353348

354349
## ------------------------------------------------
355350
## UNKNOWN

src/catalog/manager.cpp

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,39 @@ Manager &Manager::GetInstance() {
3636

3737
void Manager::AddTileGroup(const oid_t oid,
3838
std::shared_ptr<storage::TileGroup> location) {
39-
4039
// add/update the catalog reference to the tile group
41-
tile_group_locator_.Update(oid, location);
40+
tile_group_locator_[oid] = location;
4241
}
4342

4443
void Manager::DropTileGroup(const oid_t oid) {
45-
4644
// drop the catalog reference to the tile group
47-
tile_group_locator_.Erase(oid, empty_tile_group_);
45+
tile_group_locator_[oid] = empty_tile_group_;
4846
}
4947

5048
std::shared_ptr<storage::TileGroup> Manager::GetTileGroup(const oid_t oid) {
51-
std::shared_ptr<storage::TileGroup> location;
52-
53-
location = tile_group_locator_.Find(oid);
54-
55-
return location;
49+
auto iter = tile_group_locator_.find(oid);
50+
if (iter == tile_group_locator_.end()) {
51+
return empty_tile_group_;
52+
}
53+
return iter->second;
5654
}
5755

5856
// used for logging test
59-
void Manager::ClearTileGroup() {
60-
61-
tile_group_locator_.Clear(empty_tile_group_);
62-
}
63-
64-
65-
void Manager::AddIndirectionArray(const oid_t oid,
66-
std::shared_ptr<storage::IndirectionArray> location) {
57+
void Manager::ClearTileGroup() { tile_group_locator_.clear(); }
6758

59+
void Manager::AddIndirectionArray(
60+
const oid_t oid, std::shared_ptr<storage::IndirectionArray> location) {
6861
// add/update the catalog reference to the indirection array
69-
indirection_array_locator_.Update(oid, location);
62+
auto ret = indirection_array_locator_[oid] = location;
7063
}
7164

7265
void Manager::DropIndirectionArray(const oid_t oid) {
73-
7466
// drop the catalog reference to the tile group
75-
indirection_array_locator_.Erase(oid, empty_indirection_array_);
67+
indirection_array_locator_[oid] = empty_indirection_array_;
7668
}
7769

78-
7970
// used for logging test
80-
void Manager::ClearIndirectionArray() {
81-
82-
indirection_array_locator_.Clear(empty_indirection_array_);
83-
}
71+
void Manager::ClearIndirectionArray() { indirection_array_locator_.clear(); }
8472

8573
} // namespace catalog
8674
} // namespace peloton

src/codegen/operator/update_translator.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ UpdateTranslator::UpdateTranslator(const planner::UpdatePlan &update_plan,
4141
UpdaterProxy::GetType(GetCodeGen()));
4242
}
4343

44-
bool IsTarget(const TargetList &target_list, uint32_t index) {
45-
for (const auto &target : target_list) {
46-
if (target.first == index) {
47-
return true;
44+
oid_t GetTargetIndex(const TargetList &target_list, uint32_t index) {
45+
oid_t target_size = target_list.size();
46+
for (oid_t i = 0; i < target_size; i++) {
47+
if (target_list[i].first == index) {
48+
return i;
4849
}
4950
}
50-
return false;
51+
return INVALID_OID;
5152
}
5253

5354
void UpdateTranslator::InitializeState() {
@@ -93,13 +94,13 @@ void UpdateTranslator::Consume(ConsumerContext &, RowBatch::Row &row) const {
9394

9495
// Collect all the column values
9596
std::vector<codegen::Value> values;
96-
for (uint32_t i = 0, target_id = 0; i < column_num; i++) {
97+
for (uint32_t i = 0; i < column_num; i++) {
9798
codegen::Value val;
98-
if (IsTarget(target_list, i)) {
99+
uint32_t target_index = GetTargetIndex(target_list, i);
100+
if (target_index != INVALID_OID) {
99101
// Set the value for the update
100-
const auto &derived_attribute = target_list[target_id].second;
102+
const auto &derived_attribute = target_list[target_index].second;
101103
val = row.DeriveValue(codegen, *derived_attribute.expr);
102-
target_id++;
103104
} else {
104105
val = row.DeriveValue(codegen, ais[i]);
105106
}

0 commit comments

Comments
 (0)