You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by sp...@apache.org on 2016/12/11 17:46:11 UTC
[48/51] [abbrv] [partial] incubator-quickstep git commit: remove c++
files
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/GENERATOR_FUNCTIONS.md
----------------------------------------------------------------------
diff --git a/GENERATOR_FUNCTIONS.md b/GENERATOR_FUNCTIONS.md
deleted file mode 100644
index 78b4079..0000000
--- a/GENERATOR_FUNCTIONS.md
+++ /dev/null
@@ -1,89 +0,0 @@
-#Generator functions
-
-##What are generator functions?
-Generator functions are functions that can return a sequence of values rather than a single value. In [many programming languages](https://en.wikipedia.org/wiki/Generator_%28computer_programming%29), they look like functions but behave like iterators.
-
-In Quickstep, a generator function takes a list of constant arguments at query compile time, and populates a relation at query run time. One example is the `generate_series` function, which in the simplest case takes two integer arguments `(start, end)` and generates a single-column table with values `start, start+1, ..., end`.
-
-##Use generator functions
-Usage of a generator function is similar to that of a normal function except that it is placed inside a SQL query's `FROM` clause.
-
-For example:
-```
-SELECT *
-FROM generate_series(1, 5);
-```
-And the output will be:
-```
-+---------------+
-|generate_series|
-+---------------+
-| 1|
-| 2|
-| 3|
-| 4|
-| 5|
-+---------------+
-```
-Here `generate_series(1, 5)` stands for a relation with 5 rows.
-
-A more complex example is:
-```
-SELECT i, j, i*j
-FROM generate_series(1, 3) AS gs1(i),
- generate_series(1, 3) AS gs2(j)
-WHERE i <= j;
-```
-It is a theta-join between two generated relations. The output will be:
-```
-+-----------+-----------+-----------+
-|i |j |(i*j) |
-+-----------+-----------+-----------+
-| 1| 1| 1|
-| 1| 2| 2|
-| 1| 3| 3|
-| 2| 2| 4|
-| 2| 3| 6|
-| 3| 3| 9|
-+-----------+-----------+-----------+
-```
-
-##Overview of the design that supports the feature
-1. Given a SQL query, at first each generator function call is parsed as an abstract syntax tree node carrying the function's name and arguments information.
-
- - *See `ParseGeneratorTableReference` as the abstract syntax tree node for generator functions.*
-
-2. Then, in `Resolver`, the generator function is resolved and its arguments are validated. If this process is successful, we obtain a function handle that contains the actual implementation of this function. A logic plan node is then created to hold the function handle and to represent the relation that this function will generate.
-
- - *See `GeneratorFunctionFactory` as the factory class that resolves a function from its name.*
- - *See `GeneratorFunction` as the abstract function class that checks the validity of arguments and creates the function handle.*
- - *See `GeneratorFunctionHandle` as the function handle class that provides the actual implementation of a particular generator function.*
- - *See `logical::TableGenerator` as the logical plan node class that represents the relation that a generator function will create.*
-
-3. The logical plan node `logical::TableGenerator` is then transformed into a physical plan node `physical::TableGenerator`.
- - *See `physical::TableGenerator` as the physical plan node class that represents the relation that a generator function will create.*
-
-4. At the final stage of query planning, the physical plan node is transformed into a relational operator.
- - *See `TableGeneratorOperator` as the relational operator class that represents a operator that will produce run-time work orders.*
-
-5. At the time of query execution, the function handle's `populateColumns()` method is invoked to actually generate a relation.
- - *See `TableGeneratorWorkOrder` as the work order class that actually invokes the generator function to populate a relation at run time.*
-
-##Implement a new generator function
-There are just three steps to implement a new generator function.
-
-1. Subclass **`GeneratorFunctionHandle`** and implement all virtual methods.
- - *See `GenerateSeriesHandle` as an example.*
-
-2. Subclass **`GeneratorFunction`** and implement all virtual methods. Also define a static `Instance()` method in the subclass to return a singleton instance reference.
- - *See `GenerateSeries` as an example.*
-
-3. Register the **`GeneratorFunction`** subclass into **`GeneratorFunctionFactory`** by adding into `GeneratorFunctionFactory`'s constructor a new line:
-```
-GeneratorFunctionFactory::GeneratorFunctionFactory() {
- ...
- // Register all generator functions here.
- REGISTER_GENERATOR_FUNCTION_(YourGeneratorFunctionSubclass);
- ...
-}
-```
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 3ead237..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,44 +0,0 @@
-Apache Quickstep (incubating)
-Copyright 2016 The Apache Software Foundation.
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-Portions Copyright (c) 2011-2015, Quickstep Technologies, LLC.
-Portions Copyright (c) 2015-2016, Pivotal Software, Inc.
-
-[Copyright for third_party/benchmark]
-Portions Copyright (c) Arne Beer <ar...@twobeer.de>
-Portions Copyright (c) Christopher Seymour <ch...@hotmail.com>
-Portions Copyright (c) David Coeurjolly <da...@liris.cnrs.fr>
-Portions Copyright (c) Dominic Hamon <dm...@stripysock.com>
-Portions Copyright (c) Eugene Zhuk <eu...@gmail.com>
-Portions Copyright (c) Evgeny Safronov <di...@gmail.com>
-Portions Copyright (c) Felix Homann <li...@showlabor.de>
-Portions Copyright (c) Google Inc.
-Portions Copyright (c) JianXiong Zhou <zh...@gmail.com>
-Portions Copyright (c) Lei Xu <ed...@gmail.com>
-Portions Copyright (c) Matt Clarkson <ma...@gmail.com>
-Portions Copyright (c) Oleksandr Sochka <sa...@gmail.com>
-Portions Copyright (c) Paul Redmond <pa...@gmail.com>
-Portions Copyright (c) Shuo Chen <ch...@chenshuo.com>
-Portions Copyright (c) Yusuke Suzuki <ut...@gmail.com>
-
-[Copyright for third_party/cpplint]
-Portions Copyright (c) 2009 Google Inc
-
-[Copyright for third_party/farmhash]
-Copyright (c) 2014 Google, Inc.
-
-[Copyright for third_party/gflags]
-Copyright (c) 2006, Google Inc.
-
-[Copyright for third_party/glog]
-Copyright (c) 2008, Google Inc.
-
-[Copyright for third_party/gpertools]
-Copyright (c) 2005, Google Inc.
-
-[Copyright for third_party/linenoise]
-Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com>
-Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com>
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/WORKING_WITH_AN_IDE.md
----------------------------------------------------------------------
diff --git a/WORKING_WITH_AN_IDE.md b/WORKING_WITH_AN_IDE.md
deleted file mode 100644
index 017a174..0000000
--- a/WORKING_WITH_AN_IDE.md
+++ /dev/null
@@ -1,178 +0,0 @@
-#Developing Quickstep with IDEs
-
-##Who should read this document?
-Any developer who prefers to work with IDEs instead of a terminal and
-vi, emacs, or the like. In other words, this document aims to make it easier
-for developers of Quickstep to work with IDEs. Over time, there will be
-information about working with other IDEs, but to start out, here are
-instructions for working with XCode on OSX.
-
-##Developing Quickstep with Xcode on OSX
-The instructions here were first written and verified on OSX El Capitan,
-v.10.11.2, using Xcode v.7.2.
-
-###1: Install Xcode and command line tools
-First, you will need to download and install Xcode and the associated command
-line tools. There are multiple ways to do this, including going to
-https://developer.apple.com/xcode/ and downloading both Xcode and the command
-line tools from there. Another way that works well if you do not have Xcode
-already installed is to simply open up the Terminal app and enter:
-
-```
-cc
-```
-
-This command should trigger a sequence of downloads to get you both Xcode
-and the assocaited command line tools.
-
-###2: Install cmake
-Unfortunately, the command line tools do not package `cmake`, which is needed
-to build Quickstep. You can install cmake using brew as follows:
-
-Visit http://brew.sh to determine the instructions to install brew. It will look
-something like:
-
-```
-ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-```
-
-Once you have brew installed, simply use brew to install cmake from the
-Terminal app by typing:
-
-```
-brew install cmake
-```
-
-###3: Build Quicktep
-Checkout the Quickstep code from git, and also checkout the associated submodules.
-If you have not read it already, this would be good time to read the file
-[BUILDING.md](BUILDING.md), but do not run the cmake command mentioned there. Instead, go
-into the build directory of the Quickstep code that you checked out
-(i.e. the directory `quickstep/build`) and run the following command
-in your Terminal app:
-
-
-```
-cmake -D CMAKE_BUILD_TYPE=Debug -D USE_LINENOISE=0 -G "Xcode" ..
-```
-
-This will take a minute but will build the Xcode project file. You can start
-Xcode by typing in:
-
-```
-open QUICKSTEP.xcodeproj
-```
-
-Xcode should start and the first thing you should see is a pop-up box that asks
-if you want to `Manually Manage Schemes` or `Automatically Create Schemes`.
-Pick the latter and let Xcode genreate the schemes, which will essentially
-generate a build target for each target in the cmake files. There are a lot of
-these, but that is ok -- you can pick just the target you want to build easily.
-
-Xcode will take a while to index the files. When it is done, you should see at
-the top of your screen a button with the text: `ALL_BUILD > My Mac`
-
-Click on that button, and a long list of targets will show up. Pick
-`quickstep_cli_shell` as the target -- this creates the main quickstep program.
-(Above, you can also pick other targets if you are working on a different more
-focused part of the code).
-
-To build the source, select from the top menu bar `Product -> Build` or simply
-hit Command-B. Xcode should spin into action and build the sources. It will take
-a while, but the nice thing is that Xcode automatically will try to parallelize
-the build. So, you should be done with building in few minutes.
-
-You should end up with a directory `quickstep/build/Debug`, where the binary is
-created. You will need to go into this directory and issue the command:
-
-```
-cp -R ../qsstor .
-```
-
-The above command ensures that you now have the appropriate directory structure
-and a starting catalog file to start Quickstep. The default database is called
-simply "default" and no relations in it upfront.
-
-There are other ways of specifying where Quickstep stores the data and catalog.
-In particular there is a `-storage_path` option that could be an alternative
-way of specifying the storage path and avoiding the copy above. You can find
-these and other command line options by typing:
-
-```
-./quickstep_cli_shell -help
-```
-
-
-###4: Debug Quickstep
-Now you can debug as you would any normal process in Xcode. Note the
-linenoise option in the cmake command above is important if you are going
-to run quickstep from Xcode (by hitting the "play" button). If you are
-curious why we have that option, see
-https://github.com/antirez/linenoise/issues/85. Quickstep uses the linenoise
-package, and Xcode's embedded terminal has limited functionality. With the
-cmake option above, we turn off using linenoise.
-
-Sometimes you may want to run quickstep from the command line and still
-debug with Xcode. For that scenario, you do the following:
-a) In Xcode, go to `Debug -> Attach to Processs` and type in
-`quickstep_cli_shell`. If you want to set a breakpoint, you can do
-that here. Open the file in which you want to insert a breakpoint,
-go to the line in the code where you want to set a breakpoint,
-and hit `Debug -> Breakpoints -> Add Breakpoint at Current Line` or
-simply press `Command-\`.
-
-b) Then go to the Terminal app, and go to the Debug directory using:
-
-```
-cd quickstep/build/Debug
-```
-
-c) Start quickstep using something like `./quickstep_cli.shell` or
-`./quickstep_cli_shell < query.sql` where `query.sql` contains the SQL commands
-you want to run/debug. Xcode will automatically attach the quickstep process
-when it starts up. It you had set a breakpoint and the program executes that
-code, then Xcode (lldb) will stop at the breakpoint. Or, if there is a crash,
-you can examine the stack in Xcode.
-
-###5: Unit Tests
-Individual unit tests show up as target schemas, so you can simply select them
-and run the unit test of interest.
-
-Running all the unit tests is complicated, and simply picking the `RUN_TESTS`
-does not work. So, this is a known limitation at this point. You can, however,
-follow the instructions for a [BUILDING.md](command-line build) with cmake and
-then run `ctest` to run the full suite of unit tests.
-
-###6: Other known issues
-
-####Modifying CMake Files
-If you change any of the cmake files (such as any of the CMakeLists.txt
-files), then you will have to [redo step 3](#3-build-quicktep) above to
-create a new Xcode project file.
-
-####Running Python Validation Scripts
-Quickstep developers have a few python scripts that are used to mechanically
-check code. These scripts are written in Python 2 and are not compatible with
-Python 3, so they use `python2` as the interpreter in their shebangs. While
-OSX does include some version of Python 2, it does not have a symlink for
-`python2`, so the scripts will fail to run out of the box. An easy fix is just
-to create a symlink yourself:
-
-```
-sudo ln -s /usr/bin/python2.7 /usr/local/bin/python2
-```
-
-(Note that if you have an older version of Mac OS X, you may need to replace
-`python2.7` in the above command with `python2.6`, or whatever the most recent
-2.X version is on your machine.)
-
-After putting the symlink in place, you should be able to run
-`./third_party/cpplint/lint_everything.py` (which applies a modified version of
-Google cpplint to all C++ sources) and `./validate_cmakelists.py` (which checks
-that dependencies in CMakeLists.txt files exactly match included headers in C++
-sources) from the root quickstep source directory to check your code. There is
-a third validation script `./cyclic_dependency.py` that checks that there are
-no cyclic linking dependencies, but this script also requires that the python
-networkx package is installed
-([https://networkx.github.io/documentation/latest/install.html](see
-instructions here)).
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/build/profile_build.sh
----------------------------------------------------------------------
diff --git a/build/profile_build.sh b/build/profile_build.sh
deleted file mode 100755
index 7d56265..0000000
--- a/build/profile_build.sh
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/bash
-# This script may be useful for developers to profile the build process itself.
-#
-# This shell script runs CMake and make, dumping all output into a log file.
-# It also logs the CPU usage and memory information during the build.
-# All log messages are timestamped to enable profiling.
-#
-# Dependencies:
-# - ts
-# sudo apt-get install -y libtime-duration-perl moreutils
-# - vmstat and mpstat
-# sudo apt-get install -y sysstat
-#
-# Usage: ./profile_build.sh
-# Set the CMake and make command you want to use below.
-# If CMakeLists.txt is detected, the script exits because in-source-tree build
-# is not supported.
-# If CMakeCache.txt is detected, the script skips cmake and runs make only.
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-set -e
-
-CMAKE_COMMAND="cmake \
--D BUILD_SHARED_LIBS=On \
--D USE_TCMALLOC=0 \
--D CMAKE_BUILD_TYPE=Debug \
-.. "
-MAKE_COMMAND="make VERBOSE=1"
-LOG_FILENAME=build.log
-
-# Continuously dump memory usage and cpu load info to files for later analysis
-function start_stat_collectors {
- rm -f stats_*.txt
- vmstat -SM 3 | ts "%.s (%H:%M:%S)" > stats_mem.txt 3>&1 &
- PID_vmstat=$!
- mpstat 3 | ts "%.s (%H:%M:%S)" > stats_cpu.txt 2>&1 &
- PID_mpstat=$!
-}
-
-function kill_stat_collectors {
- kill $PID_vmstat
- kill $PID_mpstat
- exit
-}
-
-function check_directory {
- if [[ -f CMakeLists.txt ]]; then
- echo "Running the build in the source tree is not supported."
- exit 1
- fi
-}
-
-function log_repo_version_info {
- git log master... >> $LOG_FILENAME
- git diff master >> $LOG_FILENAME
-}
-
-function run_cmake {
- if [[ ! -f CMakeCache.txt ]]; then
- echo "$CMAKE_COMMAND" | tee -a $LOG_FILENAME
- $CMAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a $LOG_FILENAME
- else
- echo "CMakeCache.txt detected. Not running CMake again."
- fi
-}
-
-function run_make {
- echo "$MAKE_COMMAND" | tee -a $LOG_FILENAME
- $MAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a $LOG_FILENAME
-}
-
-function print_stats {
- avg_mem=`grep -v r stats_mem.txt | tr -s ' ' | awk -F " " '{s+= $6; c++} END {print s/c/1024}'`
- echo -e "\n\n"
- echo "Average memory used was $avg_mem GB" | tee -a $LOG_FILENAME
-
- time_taken=`expr $END_TIME - $START_TIME`
- mins=`expr $time_taken / 60`
- secs=`expr $time_taken % 60`
- echo "Time taken was ${mins}m ${secs}s" | tee -a $LOG_FILENAME
-}
-
-check_directory
-echo "Starting build in " `pwd` >> $LOG_FILENAME
-start_stat_collectors
-trap kill_stat_collectors SIGHUP SIGINT SIGTERM
-
-START_TIME=`date +"%s"`
-run_cmake
-run_make
-END_TIME=`date +"%s"`
-kill_stat_collectors
-print_stats
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/build/vagrant/README.md
----------------------------------------------------------------------
diff --git a/build/vagrant/README.md b/build/vagrant/README.md
deleted file mode 100644
index c962dda..0000000
--- a/build/vagrant/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-Vagrant Development Environments for Quickstep
-==============================================
-
-Vagrant is a tool for setting up development environments in a VM. It
-automatically takes care of fetching a base OS image, installing additional
-software, and setting it up so you can easily ssh into a VM and get to work.
-It also handles sharing directories (like source repos) between the host and
-the VM so that you can, for instance, edit code using your preferred editor on
-your machine as usual, and compile inside the Vagrant-managed VM without having
-to do any additional steps to sync code. Cool!
-
-The main reason to use Vagrant on a project like Quickstep is to have
-well-known OS environments to build and test code in during development. For
-instance, if you are developing on a Mac but are working on features related to
-libnuma on Linux, you can use the Debian Vagrant box which gives you a full
-Linux OS and toolchain with libnuma included.
-
-Getting Started
----------------
-
-1. Download and install VirtualBox: https://www.virtualbox.org/wiki/Downloads
- VirtualBox is used as the hypervisor for Vagrant VMs (technically, Vagrant
- can use several different providers, but it's easiest to get up and
- running with VirtualBox).
-2. Download and install Vagrant: https://www.vagrantup.com/downloads.html
- Just install the Vagrant software itself. You do not need to go through
- any of the guides to set up a Vagrant box (we already have several
- pre-made for you, see "Quickstep Boxes" below).
-3. Bring up a Vagrant box. Just cd into the directory for the box and type
- `vagrant up`. Several boxes are provided for Quickstep development (see
- "Quickstep Boxes" below). The `debian-jessie-amd64` box is a good default
- choice. Running `vagrant up` may take a few minutes the first time you
- bring up a box, because vagrant has to first download a base OS image,
- then run scripts to install additional software in it. You can expect the
- boot process to go much faster after the first time.
-4. Type `vagrant ssh` to ssh into your VM. The Vagrant boxes for quickstep
- should have all the dev tools you need (compilers, cmake, protobufs, flex,
- bison, and debuggers). The quickstep source repo will be shared and
- mounted at /quickstep in the VM.
-5. When you are finished using the VM, exit from your ssh session and type
- `vagrant halt` to shut it down. This will gracefully shut down the VM and
- keep the full VM image around so that you can boot back into it quickly
- the next time you run `vagrant up`. If you want to completely eliminate
- the VM from your host and clean up everything, you can type
- `vagrant destroy`. You can still recreate the box by doing `vagrant up`,
- but it will start from scratch and take a few minutes.
-
-Configuring VMs
----------------
-
-The Vagrantfiles for our boxes are set up to give 4 CPU cores and 8 GB of RAM
-to the VM. If your host machine is under or over-powered relative to that (and
-keep in mind that your host OS needs some RAM, too), you can edit the
-Vagrantfile to change the resources given to the VM. Look for a code section
-like the following:
-
- config.vm.provider "virtualbox" do |vb|
- vb.memory = 8192
- vb.cpus = 4
- end
-
-`vb.memory` indicates the VM RAM in megabytes, `vb.cpus` indicates the number
-of CPU cores. Adjust to your liking.
-
-Quickstep Boxes
----------------
-
-### Debian Jessie
-
-The debian-jessie-amd64 directory contains a vagrant box for Debian GNU/Linux 8
-"Jessie". It has GCC 4.9, Clang 3.5, GDB, LLDB, CMake, protobufs, flex, bison,
-and git installed.
-
-### FreeBSD 10.2
-
-The freebsd-10.2-amd64 directory contains a vagrant box for FreeBSD
-10.2-STABLE. It has Clang 3.4 (the default system compiler) and Clang 3.7
-(installed under `/usr/local/bin/clang37`), as well as LLDB, CMake, protobufs,
-flex, bison, and git installed.
-
-The FreeBSD box uses NFS to share files with the host. This means you need
-administrator (i.e. sudoer) permissions on the host to export the shared
-directories. Vagrant will automate setting this up for you, but it may ask
-for a password at some point when you run `vagrant up`.
-
-Note that the FreeBSD image auto-updates itself on boot before the SSH server
-comes up, so do not be alarmed if you get a bunch of "remote connection
-disconnect" warnings when you run `vagrant up`, it should eventually succeed.
-
-### Ubuntu Precise
-
-The ubuntu-precise-amd64 directory contains a vagrant box for Ubuntu 12.04 LTS
-"Precise". This is the same distro as is used in Travis Linux workers for our
-continuous integration setup, and the installed development packages should be
-the same as on Travis. This box is intended mainly for debugging problems with
-Travis. For regular Linux development, it's recommended to use the Debian
-Jessie box instead, as it has a more recent and complete set of tools.
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/build/vagrant/debian-jessie-amd64/Vagrantfile
----------------------------------------------------------------------
diff --git a/build/vagrant/debian-jessie-amd64/Vagrantfile b/build/vagrant/debian-jessie-amd64/Vagrantfile
deleted file mode 100644
index 255fbff..0000000
--- a/build/vagrant/debian-jessie-amd64/Vagrantfile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Basic Vagrant config (API version 2)
-Vagrant.configure(2) do |config|
- # Base box: Debian 8 "Jessie" for x86-64
- config.vm.box = "debian/jessie64"
-
- # Give a reasonable amount of cpu and memory to the VM
- config.vm.provider "virtualbox" do |vb|
- vb.memory = 8192
- vb.cpus = 4
- end
-
- # Share the project source dir with the VM
- config.vm.synced_folder "../../..", "/quickstep"
-
- # Install necessary development packages
- config.vm.provision "shell", inline: <<-SHELL
- sudo apt-get update
- sudo apt-get install -y \
- build-essential g++ clang libc++-dev gdb lldb cmake git \
- protobuf-compiler libprotobuf-dev flex bison libnuma-dev iwyu
- SHELL
-end
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/build/vagrant/freebsd-10.2-amd64/Vagrantfile
----------------------------------------------------------------------
diff --git a/build/vagrant/freebsd-10.2-amd64/Vagrantfile b/build/vagrant/freebsd-10.2-amd64/Vagrantfile
deleted file mode 100644
index cce52ab..0000000
--- a/build/vagrant/freebsd-10.2-amd64/Vagrantfile
+++ /dev/null
@@ -1,45 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Basic Vagrant config (API version 2)
-Vagrant.configure(2) do |config|
- # Base box: FreeBSD 10.2 for x86-64
- config.vm.guest = :freebsd
- config.vm.box = "freebsd/FreeBSD-10.2-STABLE"
-
- # Need some extra config to play nice with FreeBSD as guest OS.
- config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
- config.ssh.shell = "sh"
- config.vm.base_mac = "080027D14C66"
-
- # Give a reasonable amount of cpu and memory to the VM
- config.vm.provider "virtualbox" do |vb|
- vb.memory = 8192
- vb.cpus = 4
- end
-
- # Share the project source dir with the VM. We need to use NFS to mount a
- # shared directory in a FreeBSD guest.
- config.vm.network "private_network", ip: "10.0.1.10"
- config.vm.synced_folder "../../..", "/quickstep", type: "nfs"
-
- # Install necessary development packages
- config.vm.provision "shell", inline: <<-SHELL
- pkg upgrade -y
- pkg install -y clang37 lldb37 cmake git protobuf flex bison
- SHELL
-end
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/build/vagrant/ubuntu-precise-amd64/Vagrantfile
----------------------------------------------------------------------
diff --git a/build/vagrant/ubuntu-precise-amd64/Vagrantfile b/build/vagrant/ubuntu-precise-amd64/Vagrantfile
deleted file mode 100644
index 863c9db..0000000
--- a/build/vagrant/ubuntu-precise-amd64/Vagrantfile
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Basic Vagrant config (API version 2)
-Vagrant.configure(2) do |config|
- # Base box: Ubuntu 12.04 LTS "Precise" for x86-64
- config.vm.box = "hashicorp/precise64"
-
- # Give a reasonable amount of cpu and memory to the VM
- config.vm.provider "virtualbox" do |vb|
- vb.memory = 8192
- vb.cpus = 4
- end
-
- # Share the project source dir with the VM
- config.vm.synced_folder "../../..", "/quickstep"
-
- # Install development packages just like in our Travis config.
- config.vm.provision "shell", inline: <<-SHELL
- sudo apt-get update
- sudo apt-get install -y python-software-properties
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
- sudo add-apt-repository -y 'deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.7 main'
- sudo apt-get update
- sudo apt-get install -y \
- build-essential gcc-4.9 g++-4.9 clang-3.7 gdb cmake git \
- protobuf-compiler libprotobuf-dev flex bison libnuma-dev
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.7 20
- sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.7 20
- SHELL
-end
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/catalog/CMakeLists.txt b/catalog/CMakeLists.txt
deleted file mode 100644
index dd4ef99..0000000
--- a/catalog/CMakeLists.txt
+++ /dev/null
@@ -1,249 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-if(LIBNUMA_FOUND)
- set(QUICKSTEP_HAVE_LIBNUMA TRUE)
-endif()
-
-configure_file (
- "${CMAKE_CURRENT_SOURCE_DIR}/CatalogConfig.h.in"
- "${CMAKE_CURRENT_BINARY_DIR}/CatalogConfig.h"
-)
-
-QS_PROTOBUF_GENERATE_CPP(catalog_Catalog_proto_srcs catalog_Catalog_proto_hdrs Catalog.proto)
-
-# Declare micro-libs:
-add_library(quickstep_catalog_Catalog Catalog.cpp Catalog.hpp)
-add_library(quickstep_catalog_Catalog_proto ${catalog_Catalog_proto_srcs})
-add_library(quickstep_catalog_CatalogAttribute CatalogAttribute.cpp CatalogAttribute.hpp)
-add_library(quickstep_catalog_CatalogDatabase CatalogDatabase.cpp CatalogDatabase.hpp)
-add_library(quickstep_catalog_CatalogDatabaseCache CatalogDatabaseCache.cpp CatalogDatabaseCache.hpp)
-add_library(quickstep_catalog_CatalogDatabaseLite ../empty_src.cpp CatalogDatabaseLite.hpp)
-add_library(quickstep_catalog_CatalogErrors ../empty_src.cpp CatalogErrors.hpp)
-add_library(quickstep_catalog_CatalogRelation CatalogRelation.cpp CatalogRelation.hpp)
-add_library(quickstep_catalog_CatalogRelationSchema
- CatalogRelationSchema.cpp
- CatalogRelationSchema.hpp)
-add_library(quickstep_catalog_CatalogRelationStatistics
- CatalogRelationStatistics.cpp
- CatalogRelationStatistics.hpp)
-add_library(quickstep_catalog_CatalogTypedefs ../empty_src.cpp CatalogTypedefs.hpp)
-add_library(quickstep_catalog_IndexScheme IndexScheme.cpp IndexScheme.hpp)
-if(QUICKSTEP_HAVE_LIBNUMA)
- add_library(quickstep_catalog_NUMAPlacementScheme NUMAPlacementScheme.cpp NUMAPlacementScheme.hpp)
-endif()
-add_library(quickstep_catalog_PartitionScheme PartitionScheme.cpp PartitionScheme.hpp)
-add_library(quickstep_catalog_PartitionSchemeHeader PartitionSchemeHeader.cpp PartitionSchemeHeader.hpp)
-
-# Link dependencies:
-target_link_libraries(quickstep_catalog_Catalog
- glog
- quickstep_catalog_CatalogDatabase
- quickstep_catalog_CatalogErrors
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_utility_Macros
- quickstep_utility_PtrVector)
-target_link_libraries(quickstep_catalog_Catalog_proto
- quickstep_storage_StorageBlockLayout_proto
- quickstep_types_Type_proto
- quickstep_types_TypedValue_proto
- ${PROTOBUF_LIBRARY})
-target_link_libraries(quickstep_catalog_CatalogAttribute
- glog
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_types_Type
- quickstep_types_TypeFactory
- quickstep_types_Type_proto
- quickstep_utility_Macros)
-target_link_libraries(quickstep_catalog_CatalogDatabase
- glog
- quickstep_catalog_CatalogDatabaseLite
- quickstep_catalog_CatalogErrors
- quickstep_catalog_CatalogRelation
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_storage_StorageConstants
- quickstep_threading_Mutex
- quickstep_threading_SharedMutex
- quickstep_threading_SpinSharedMutex
- quickstep_utility_Macros
- quickstep_utility_PtrVector
- quickstep_utility_StringUtil)
-target_link_libraries(quickstep_catalog_CatalogDatabaseCache
- glog
- quickstep_catalog_CatalogDatabaseLite
- quickstep_catalog_CatalogRelationSchema
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_storage_StorageConstants
- quickstep_threading_Mutex
- quickstep_threading_SharedMutex
- quickstep_threading_SpinSharedMutex
- quickstep_utility_Macros)
-target_link_libraries(quickstep_catalog_CatalogDatabaseLite
- quickstep_catalog_CatalogTypedefs
- quickstep_utility_Macros)
-target_link_libraries(quickstep_catalog_CatalogRelation
- glog
- quickstep_catalog_CatalogAttribute
- quickstep_catalog_CatalogRelationSchema
- quickstep_catalog_CatalogRelationStatistics
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_catalog_IndexScheme
- quickstep_catalog_PartitionScheme
- quickstep_storage_StorageBlockInfo
- quickstep_storage_StorageBlockLayout
- quickstep_storage_StorageBlockLayout_proto
- quickstep_storage_StorageConstants
- quickstep_threading_Mutex
- quickstep_threading_SharedMutex
- quickstep_threading_SpinSharedMutex
- quickstep_utility_Macros
- quickstep_utility_PtrVector)
-target_link_libraries(quickstep_catalog_CatalogRelationStatistics
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_utility_Macros)
-target_link_libraries(quickstep_catalog_IndexScheme
- glog
- quickstep_catalog_Catalog_proto
- quickstep_storage_IndexSubBlockDescriptionFactory
- quickstep_storage_StorageBlockLayout_proto
- quickstep_utility_Macros)
-
-if(QUICKSTEP_HAVE_LIBNUMA)
-target_link_libraries(quickstep_catalog_CatalogRelation
- quickstep_catalog_NUMAPlacementScheme)
-endif()
-target_link_libraries(quickstep_catalog_CatalogRelationSchema
- glog
- quickstep_catalog_CatalogAttribute
- quickstep_catalog_CatalogErrors
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_types_Type
- quickstep_utility_Macros
- quickstep_utility_PtrVector
- quickstep_utility_StringUtil)
-if(QUICKSTEP_HAVE_LIBNUMA)
-target_link_libraries(quickstep_catalog_NUMAPlacementScheme
- glog
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_storage_StorageBlockInfo
- quickstep_utility_Macros
- ${LIBNUMA_LIBRARY})
-endif()
-target_link_libraries(quickstep_catalog_PartitionScheme
- glog
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_catalog_PartitionSchemeHeader
- quickstep_storage_StorageBlockInfo
- quickstep_threading_Mutex
- quickstep_threading_SharedMutex
- quickstep_threading_SpinSharedMutex
- quickstep_utility_Macros)
-target_link_libraries(quickstep_catalog_PartitionSchemeHeader
- glog
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_types_TypedValue
- quickstep_types_TypedValue_proto
- quickstep_types_operations_comparisons_Comparison
- quickstep_types_operations_comparisons_LessComparison
- quickstep_utility_Macros)
-
-# Module all-in-one library:
-add_library(quickstep_catalog ../empty_src.cpp CatalogModule.hpp)
-target_link_libraries(quickstep_catalog
- quickstep_catalog_Catalog
- quickstep_catalog_Catalog_proto
- quickstep_catalog_CatalogAttribute
- quickstep_catalog_CatalogDatabase
- quickstep_catalog_CatalogDatabaseCache
- quickstep_catalog_CatalogDatabaseLite
- quickstep_catalog_CatalogErrors
- quickstep_catalog_CatalogRelation
- quickstep_catalog_CatalogRelationSchema
- quickstep_catalog_CatalogRelationStatistics
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_IndexScheme
- quickstep_catalog_PartitionScheme
- quickstep_catalog_PartitionSchemeHeader)
-if(QUICKSTEP_HAVE_LIBNUMA)
-target_link_libraries(quickstep_catalog
- quickstep_catalog_NUMAPlacementScheme)
-endif()
-
-# Tests:
-add_executable(Catalog_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/Catalog_unittest.cpp")
-target_link_libraries(Catalog_unittest
- gtest
- gtest_main
- quickstep_catalog_Catalog
- quickstep_catalog_CatalogAttribute
- quickstep_catalog_CatalogDatabase
- quickstep_catalog_CatalogDatabaseCache
- quickstep_catalog_CatalogRelation
- quickstep_catalog_CatalogRelationSchema
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_Catalog_proto
- quickstep_catalog_IndexScheme
- quickstep_storage_StorageBlock
- quickstep_storage_StorageBlockInfo
- quickstep_storage_StorageBlockLayout
- quickstep_storage_StorageBlockLayout_proto
- quickstep_storage_SubBlockTypeRegistryMacros
- quickstep_types_Type
- quickstep_types_TypeFactory
- quickstep_types_TypeID
- quickstep_utility_Macros
- quickstep_utility_PtrVector)
-add_test(Catalog_unittest Catalog_unittest)
-
-if(QUICKSTEP_HAVE_LIBNUMA)
-add_executable(NUMAPlacementScheme_unittest
- "${CMAKE_CURRENT_SOURCE_DIR}/tests/NUMAPlacementScheme_unittest.cpp")
-target_link_libraries(NUMAPlacementScheme_unittest
- gtest
- gtest_main
- quickstep_catalog_NUMAPlacementScheme
- quickstep_catalog_PartitionSchemeHeader
- quickstep_storage_StorageBlockInfo
- ${LIBS})
-add_test(NUMAPlacementScheme_unittest NUMAPlacementScheme_unittest)
-endif()
-
-add_executable(PartitionScheme_unittest
- "${CMAKE_CURRENT_SOURCE_DIR}/tests/PartitionScheme_unittest.cpp")
-target_link_libraries(PartitionScheme_unittest
- gtest
- gtest_main
- quickstep_catalog_CatalogTypedefs
- quickstep_catalog_PartitionScheme
- quickstep_catalog_PartitionSchemeHeader
- quickstep_storage_StorageBlockInfo
- quickstep_types_TypeFactory
- quickstep_types_TypeID
- quickstep_types_TypedValue
- quickstep_types_operations_comparisons_Comparison
- quickstep_types_operations_comparisons_EqualComparison)
-add_test(PartitionScheme_unittest PartitionScheme_unittest)
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/Catalog.cpp
----------------------------------------------------------------------
diff --git a/catalog/Catalog.cpp b/catalog/Catalog.cpp
deleted file mode 100644
index 369d529..0000000
--- a/catalog/Catalog.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-#include "catalog/Catalog.hpp"
-
-#include <cstddef>
-#include <cstring>
-#include <string>
-#include <unordered_map>
-
-#include "catalog/Catalog.pb.h"
-#include "catalog/CatalogDatabase.hpp"
-#include "catalog/CatalogErrors.hpp"
-#include "utility/PtrVector.hpp"
-
-#include "glog/logging.h"
-
-using std::size_t;
-using std::strcmp;
-using std::string;
-
-namespace quickstep {
-
-bool Catalog::ProtoIsValid(const serialization::Catalog &proto) {
- for (int i = 0; i < proto.databases_size(); ++i) {
- if (!CatalogDatabase::ProtoIsValid(proto.databases(i))) {
- return false;
- }
- }
- return true;
-}
-
-Catalog::Catalog(const serialization::Catalog &proto) {
- DCHECK(ProtoIsValid(proto))
- << "Attempted to create Catalog from an invalid proto description:\n"
- << proto.DebugString();
-
- for (int i = 0; i < proto.databases_size(); ++i) {
- if (proto.databases(i).IsInitialized()) {
- addDatabase(new CatalogDatabase(proto.databases(i)));
- } else {
- db_vec_.push_back(NULL);
- }
- }
-}
-
-const CatalogDatabase& Catalog::getDatabaseByName(const string &db_name) const {
- std::unordered_map<std::string, CatalogDatabase*>::const_iterator it = db_map_.find(db_name);
- if (it == db_map_.end()) {
- throw DatabaseNameNotFound(db_name);
- } else {
- return *(it->second);
- }
-}
-
-CatalogDatabase* Catalog::getDatabaseByNameMutable(const string &db_name) {
- std::unordered_map<std::string, CatalogDatabase*>::const_iterator it = db_map_.find(db_name);
- if (it == db_map_.end()) {
- throw DatabaseNameNotFound(db_name);
- } else {
- return it->second;
- }
-}
-
-database_id Catalog::addDatabase(CatalogDatabase *new_db) {
- const string &db_name = new_db->getName();
- if (hasDatabaseWithName(db_name)) {
- throw DatabaseNameCollision(db_name);
- } else if (db_vec_.size() > static_cast<size_t>(kCatalogMaxID)) {
- throw CatalogIDOverflow("database");
- } else {
- db_map_[db_name] = new_db;
- db_vec_.push_back(new_db);
- new_db->setParent(this);
- new_db->setID(static_cast<database_id>(db_vec_.size() - 1));
- return (new_db->getID());
- }
-}
-
-serialization::Catalog Catalog::getProto() const {
- serialization::Catalog proto;
-
- for (PtrVector<CatalogDatabase, true>::const_iterator it = db_vec_.begin();
- it != db_vec_.end();
- ++it) {
- if (it.isNull()) {
- proto.add_databases();
- } else {
- proto.add_databases()->CopyFrom(it->getProto());
- }
- }
-
- return proto;
-}
-} // namespace quickstep
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/Catalog.hpp
----------------------------------------------------------------------
diff --git a/catalog/Catalog.hpp b/catalog/Catalog.hpp
deleted file mode 100644
index daaec8c..0000000
--- a/catalog/Catalog.hpp
+++ /dev/null
@@ -1,299 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-#ifndef QUICKSTEP_CATALOG_CATALOG_HPP_
-#define QUICKSTEP_CATALOG_CATALOG_HPP_
-
-#include <exception>
-#include <string>
-#include <unordered_map>
-
-#include "catalog/Catalog.pb.h"
-#include "catalog/CatalogDatabase.hpp"
-#include "catalog/CatalogTypedefs.hpp"
-#include "utility/Macros.hpp"
-#include "utility/PtrVector.hpp"
-
-namespace quickstep {
-
-/** \addtogroup Catalog
- * @{
- */
-
-/**
- * @brief Exception thrown for a database name collision.
- **/
-class DatabaseNameCollision : public std::exception {
- public:
- /**
- * @brief Constructor.
- *
- * @param db_name The name of the database for which there was a collision.
- **/
- explicit DatabaseNameCollision(const std::string &db_name)
- : message_("DatabaseNameCollision: catalog already has a database ") {
- message_.append(db_name);
- }
-
- ~DatabaseNameCollision() throw() {
- }
-
- virtual const char* what() const throw() {
- return message_.c_str();
- }
-
- private:
- std::string message_;
-};
-
-
-/**
- * @brief Exception thrown when a database with the specified name can't be
- * found.
- **/
-class DatabaseNameNotFound : public std::exception {
- public:
- /**
- * @brief Constructor.
- *
- * @param dbName The database name which could not be found.
- **/
- explicit DatabaseNameNotFound(const std::string &db_name)
- : message_("DatabaseNameNotFound: catalog has no database named ") {
- message_.append(db_name);
- }
-
- ~DatabaseNameNotFound() throw() {
- }
-
- virtual const char* what() const throw() {
- return message_.c_str();
- }
-
- private:
- std::string message_;
-};
-
-
-/**
- * @brief Exception thrown when a database with the specified ID can't be
- * found.
- **/
-class DatabaseIdNotFound : public std::exception {
- public:
- /**
- * @brief Constructor.
- *
- * @param id The id which could not be found.
- **/
- explicit DatabaseIdNotFound(const database_id id)
- : message_("DatabaseIdNotFound: catalog has no database with ID ") {
- message_.append(std::to_string(id));
- }
-
- ~DatabaseIdNotFound() throw() {
- }
-
- virtual const char* what() const throw() {
- return message_.c_str();
- }
-
- private:
- std::string message_;
-};
-
-
-/**
- * @brief The entire database catalog.
- **/
-class Catalog {
- public:
- typedef std::unordered_map<std::string, CatalogDatabase*>::size_type size_type;
- typedef PtrVector<CatalogDatabase, true>::const_skip_iterator const_iterator;
-
- /**
- * @brief Construct an empty catalog.
- **/
- Catalog() {
- }
-
- /**
- * @brief Reconstruct a catalog from its serialized Protocol Buffer form.
- *
- * @param proto The Protocol Buffer serialization of a catalog,
- * previously produced by getProto().
- **/
- explicit Catalog(const serialization::Catalog &proto);
-
- /**
- * @brief Destructor which recursively destroys children.
- **/
- ~Catalog() {
- }
-
- /**
- * @brief Check whether a database with the given name exists.
- *
- * @param db_name The name to check for.
- * @return Whether the database exists.
- **/
- bool hasDatabaseWithName(const std::string &db_name) const {
- return (db_map_.find(db_name) != db_map_.end());
- }
-
- /**
- * @brief Check whether a database with the given id exists.
- *
- * @param id The id to check for.
- * @return Whether the database exists.
- **/
- bool hasDatabaseWithId(const database_id id) const {
- return (idInRange(id) && !db_vec_.elementIsNull(id));
- }
-
- /**
- * @brief Get a database by name.
- *
- * @param db_name The name to search for.
- * @exception DatabaseNameNotFound No database with the given name exists.
- * @return The database with the given name.
- **/
- const CatalogDatabase& getDatabaseByName(const std::string &db_name) const;
-
- /**
- * @brief Get a mutable pointer to a database by name.
- *
- * @param db_name The name to search for.
- * @exception DatabaseNameNotFound No database with the given name exists.
- * @return The database with the given name.
- **/
- CatalogDatabase* getDatabaseByNameMutable(const std::string &db_name);
-
- /**
- * @brief Get a database by ID.
- *
- * @param id The id to search for.
- * @exception DatabaseIdNotFound No database with the given ID exists.
- * @return The database with the given ID.
- **/
- const CatalogDatabase& getDatabaseById(const database_id id) const {
- if (hasDatabaseWithId(id)) {
- return db_vec_[id];
- } else {
- throw DatabaseIdNotFound(id);
- }
- }
-
- /**
- * @brief Get a mutable pointer to a database by ID.
- *
- * @param id The id to search for.
- * @exception DatabaseIdNotFound No database with the given ID exists.
- * @return The database with the given ID.
- **/
- CatalogDatabase* getDatabaseByIdMutable(const database_id id) {
- if (hasDatabaseWithId(id)) {
- return &(db_vec_[id]);
- } else {
- throw DatabaseIdNotFound(id);
- }
- }
-
- /**
- * @brief Add a new database to the catalog. If the database already has an
- * ID and/or parent, it will be overwritten.
- *
- * @param new_db The database to be added.
- * @exception DatabaseNameCollision A database with the same name as new_db
- * is already present in the catalog.
- * @return The id assigned to the database.
- **/
- database_id addDatabase(CatalogDatabase *new_db);
-
- /**
- * @brief Serialize the catalog as Protocol Buffer.
- *
- * @return The Protocol Buffer representation of the catalog.
- **/
- serialization::Catalog getProto() const;
-
- /**
- * @brief Get the number of child databases.
- *
- * @return The number of child databases.
- **/
- size_type size() const {
- return db_map_.size();
- }
-
- /**
- * @brief Get an iterator at the beginning of the child databases.
- *
- * @return An iterator on the first child database.
- **/
- const_iterator begin() const {
- return db_vec_.begin_skip();
- }
-
- /**
- * @brief Get an iterator at one-past-the-end of the child databases.
- *
- * @return An iterator one-past-the-end of the child databases.
- **/
- const_iterator end() const {
- return db_vec_.end_skip();
- }
-
- private:
- /**
- * @brief Check whether a database_id is within the range of IDs contained
- * in this Catalog.
- *
- * @param id The id to check.
- * @return true if id is in range, false otherwise.
- **/
- bool idInRange(const database_id id) const {
- return ((id >= 0)
- && (static_cast<PtrVector<CatalogDatabase>::size_type>(id) < db_vec_.size()));
- }
-
- /**
- * @brief Check whether a serialization::Catalog is fully-formed and
- * all parts are valid.
- *
- * @param proto A serialized Protocol Buffer representation of a Catalog,
- * originally generated by getProto().
- * @return Whether proto is fully-formed and valid.
- **/
- static bool ProtoIsValid(const serialization::Catalog &proto);
-
- // A vector of databases, and NULL if it has dropped from the catalog.
- PtrVector<CatalogDatabase, true> db_vec_;
-
- // A map from a database name to a pointer to the database.
- std::unordered_map<std::string, CatalogDatabase*> db_map_;
-
- DISALLOW_COPY_AND_ASSIGN(Catalog);
-};
-
-/** @} */
-
-} // namespace quickstep
-
-#endif // QUICKSTEP_CATALOG_CATALOG_HPP_
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/Catalog.proto
----------------------------------------------------------------------
diff --git a/catalog/Catalog.proto b/catalog/Catalog.proto
deleted file mode 100644
index 90ce37e..0000000
--- a/catalog/Catalog.proto
+++ /dev/null
@@ -1,124 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-syntax = "proto2";
-
-package quickstep.serialization;
-
-import "storage/StorageBlockLayout.proto";
-import "types/Type.proto";
-import "types/TypedValue.proto";
-
-message CatalogAttribute {
- required string name = 1;
- required Type type = 2;
- optional string display_name = 3;
-}
-
-// TODO(zuyu): Move PartitionScheme to a dedicate proto file.
-message PartitionSchemeHeader {
- enum PartitionType {
- HASH = 0;
- RANGE = 1;
- }
-
- required PartitionType partition_type = 1;
-
- required uint64 num_partitions = 2;
- required uint32 partition_attribute_id = 3;
-
- // The convention for extension numbering is that extensions for a particular
- // PartitionType should begin from (partition_type + 1) * 16.
- extensions 16 to max;
-}
-
-message RangePartitionSchemeHeader {
- extend PartitionSchemeHeader {
- // All required.
- repeated TypedValue partition_range_boundaries = 32;
- }
-}
-
-message Partition {
- repeated fixed64 blocks = 1 [packed=true];
-}
-
-message PartitionScheme {
- required PartitionSchemeHeader header = 1;
- repeated Partition partitions = 2;
-}
-
-message NUMAPlacementScheme {
- required uint32 num_numa_nodes = 1;
-
- message BlockToNUMANodeEntry {
- required fixed64 block_id = 1;
- required int32 numa_node = 2;
- }
- repeated BlockToNUMANodeEntry block_to_numa_node_map = 2;
-}
-
-message IndexScheme {
- message IndexEntry {
- required string index_name = 1;
- required IndexSubBlockDescription index_description = 2;
- }
- repeated IndexEntry index_entries = 1;
-}
-
-message CatalogRelationStatistics {
- optional fixed64 num_tuples = 1;
-
- message NumDistinctValuesEntry {
- required int32 attr_id = 1;
- required fixed64 num_distinct_values = 2;
- }
- repeated NumDistinctValuesEntry num_distinct_values_map = 2;
-}
-
-message CatalogRelationSchema {
- required int32 relation_id = 1;
- required string name = 2;
- required bool temporary = 3;
-
- repeated CatalogAttribute attributes = 4;
-
- extensions 16 to max;
-}
-
-message CatalogRelation {
- extend CatalogRelationSchema {
- // Required.
- optional StorageBlockLayoutDescription default_layout = 16;
-
- repeated fixed64 blocks = 17 [packed=true];
- optional IndexScheme index_scheme = 18;
- optional PartitionScheme partition_scheme = 19;
- optional NUMAPlacementScheme placement_scheme = 20;
- optional CatalogRelationStatistics statistics = 21;
- }
-}
-
-message CatalogDatabase {
- required string name = 1;
- repeated CatalogRelationSchema relations = 2;
- repeated int32 null_relations = 3;
-}
-
-message Catalog {
- repeated CatalogDatabase databases = 1;
-}
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/CatalogAttribute.cpp
----------------------------------------------------------------------
diff --git a/catalog/CatalogAttribute.cpp b/catalog/CatalogAttribute.cpp
deleted file mode 100644
index e9630d6..0000000
--- a/catalog/CatalogAttribute.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-#include "catalog/CatalogAttribute.hpp"
-
-#include <cstring>
-#include <string>
-
-#include "catalog/Catalog.pb.h"
-#include "types/Type.hpp"
-#include "types/Type.pb.h"
-#include "types/TypeFactory.hpp"
-
-#include "glog/logging.h"
-
-using std::strcmp;
-using std::string;
-
-namespace quickstep {
-
-bool CatalogAttribute::ProtoIsValid(const serialization::CatalogAttribute &proto) {
- // Check that proto is fully initialized and the type is a valid type.
- return proto.IsInitialized() && TypeFactory::ProtoIsValid(proto.type());
-}
-
-CatalogAttribute::CatalogAttribute(const serialization::CatalogAttribute &proto)
- : parent_(nullptr),
- id_(-1),
- name_(proto.name()),
- type_(&(TypeFactory::ReconstructFromProto(proto.type()))) {
- DCHECK(ProtoIsValid(proto))
- << "Attempted to create CatalogAttribute from an invalid proto description:\n"
- << proto.DebugString();
-
- if (proto.has_display_name()) {
- display_name_ = proto.display_name();
- }
-}
-
-serialization::CatalogAttribute CatalogAttribute::getProto() const {
- serialization::CatalogAttribute proto;
-
- proto.set_name(name_);
- proto.mutable_type()->CopyFrom(type_->getProto());
-
- if (!display_name_.empty()) {
- proto.set_display_name(display_name_);
- }
-
- return proto;
-}
-
-} // namespace quickstep
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/CatalogAttribute.hpp
----------------------------------------------------------------------
diff --git a/catalog/CatalogAttribute.hpp b/catalog/CatalogAttribute.hpp
deleted file mode 100644
index 7f7fafb..0000000
--- a/catalog/CatalogAttribute.hpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-#ifndef QUICKSTEP_CATALOG_CATALOG_ATTRIBUTE_HPP_
-#define QUICKSTEP_CATALOG_CATALOG_ATTRIBUTE_HPP_
-
-#include <string>
-
-#include "catalog/Catalog.pb.h"
-#include "catalog/CatalogTypedefs.hpp"
-#include "utility/Macros.hpp"
-
-namespace quickstep {
-
-class CatalogRelationSchema;
-class Type;
-
-/** \addtogroup Catalog
- * @{
- */
-
-/**
- * @brief An attribute in a relation.
- **/
-class CatalogAttribute {
- public:
- /**
- * @brief Create a new attribute.
- *
- * @param parent The relation this attribute belongs to.
- * @param name This attribute's name.
- * @param type This attribute's complete data type.
- * @param id This attribute's ID (defaults to -1, which means invalid/unset).
- * @param display_name A different name to display when printing values of
- * this attribute out. Defaults to name.
- **/
- CatalogAttribute(CatalogRelationSchema *parent,
- const std::string &name,
- const Type &type,
- const attribute_id id = -1,
- const std::string &display_name = "")
- : parent_(parent), id_(id), name_(name), display_name_(display_name), type_(&type) {
- }
-
- /**
- * @brief Reconstruct an attribute from its serialized Protocol Buffer form.
- *
- * @param proto The Protocol Buffer serialization of an attribute,
- * previously produced by getProto().
- **/
- explicit CatalogAttribute(const serialization::CatalogAttribute &proto);
-
- /**
- * @brief Get the parent relation.
- *
- * @return Parent relation.
- **/
- const CatalogRelationSchema& getParent() const {
- return *parent_;
- }
-
- /**
- * @brief Get a mutable pointer to the parent relation.
- *
- * @return Parent relation.
- **/
- CatalogRelationSchema* getParentMutable() {
- return parent_;
- }
-
- /**
- * @brief Get this attribute's ID.
- *
- * @return This attribute's ID.
- **/
- attribute_id getID() const {
- return id_;
- }
-
- /**
- * @brief Get this attribute's name.
- *
- * @return This attribute's name.
- **/
- const std::string& getName() const {
- return name_;
- }
-
- /**
- * @brief Get this attribute's display name (the name which would be printed
- * to the screen).
- *
- * @return This attribute's display name.
- **/
- const std::string& getDisplayName() const {
- if (display_name_.empty()) {
- return name_;
- } else {
- return display_name_;
- }
- }
-
- /**
- * @brief Set this attribute's display name (the name which would be printed
- * to the screen).
- */
- void setDisplayName(const std::string &new_display_name) {
- display_name_ = new_display_name;
- }
-
- /**
- * @brief Get this attribute's type.
- *
- * @return This attribute's type.
- **/
- const Type& getType() const {
- return *type_;
- }
-
- /**
- * @brief Serialize the attribute as Protocol Buffer.
- *
- * @return The Protocol Buffer representation of the attribute.
- **/
- serialization::CatalogAttribute getProto() const;
-
- /**
- * @brief Check whether a serialization::CatalogAttribute is fully-formed and
- * all parts are valid.
- *
- * @param proto A serialized Protocol Buffer representation of a CatalogAttribute,
- * originally generated by getProto().
- * @return Whether proto is fully-formed and valid.
- **/
- static bool ProtoIsValid(const serialization::CatalogAttribute &proto);
-
- private:
- /**
- * @brief Set the parent CatalogRelationSchema for this attribute. Used by
- * CatalogRelationSchema (a friend of this class) when adding a new
- * attribute.
- *
- * @param parent The new parent for this CatalogAttribute.
- **/
- void setParent(CatalogRelationSchema *parent) {
- parent_ = parent;
- }
-
- /**
- * @brief Set the ID of this attribute. Used by CatalogRelationSchema (a
- * friend of this class) when adding a new attribute.
- *
- * @param id The new ID for this CatalogAttribute.
- **/
- void setID(const attribute_id id) {
- id_ = id;
- }
-
- CatalogRelationSchema *parent_;
-
- // The attribute id in CatalogRelationSchema.
- attribute_id id_;
-
- // The internal attribute name.
- const std::string name_;
-
- // The external attribute name used to print on screen, if non-empty.
- std::string display_name_;
-
- // The attribute's underlying type.
- const Type *type_;
-
- friend class CatalogRelationSchema;
-
- DISALLOW_COPY_AND_ASSIGN(CatalogAttribute);
-};
-
-/** @} */
-
-} // namespace quickstep
-
-#endif // QUICKSTEP_CATALOG_CATALOG_ATTRIBUTE_HPP_
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/CatalogConfig.h.in
----------------------------------------------------------------------
diff --git a/catalog/CatalogConfig.h.in b/catalog/CatalogConfig.h.in
deleted file mode 100644
index dd68577..0000000
--- a/catalog/CatalogConfig.h.in
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-#cmakedefine QUICKSTEP_HAVE_LIBNUMA
-
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/catalog/CatalogDatabase.cpp
----------------------------------------------------------------------
diff --git a/catalog/CatalogDatabase.cpp b/catalog/CatalogDatabase.cpp
deleted file mode 100644
index c95196c..0000000
--- a/catalog/CatalogDatabase.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-#include "catalog/CatalogDatabase.hpp"
-
-#include <cstddef>
-#include <cstring>
-#include <string>
-#include <unordered_map>
-#include <utility>
-
-#include "catalog/Catalog.pb.h"
-#include "catalog/CatalogErrors.hpp"
-#include "catalog/CatalogRelation.hpp"
-#include "threading/Mutex.hpp"
-#include "threading/SpinSharedMutex.hpp"
-#include "utility/PtrVector.hpp"
-#include "utility/StringUtil.hpp"
-
-#include "glog/logging.h"
-
-using std::size_t;
-using std::strcmp;
-using std::string;
-
-namespace quickstep {
-
-bool CatalogDatabase::ProtoIsValid(const serialization::CatalogDatabase &proto) {
- // Check that proto is fully initialized.
- if (!proto.IsInitialized()) {
- return false;
- }
-
- for (int i = 0; i < proto.relations_size(); ++i) {
- if (!CatalogRelation::ProtoIsValid(proto.relations(i))) {
- return false;
- }
- }
-
- return true;
-}
-
-CatalogDatabase::CatalogDatabase(const serialization::CatalogDatabase &proto)
- : parent_(nullptr),
- name_(proto.name()),
- status_(Status::kConsistent) {
- DCHECK(ProtoIsValid(proto))
- << "Attempted to create CatalogDatabase from an invalid proto description:\n"
- << proto.DebugString();
-
- for (int index_relations = 0, index_null_relations = 0;
- index_relations < proto.null_relations_size() + proto.relations_size();
- ++index_relations) {
- if (index_null_relations < proto.null_relations_size() &&
- index_relations == proto.null_relations(index_null_relations)) {
- rel_vec_.push_back(NULL);
- ++index_null_relations;
- } else {
- addRelation(new CatalogRelation(proto.relations(index_relations - index_null_relations)));
- }
- }
-}
-
-const CatalogRelation* CatalogDatabase::getRelationByName(const string &rel_name) const {
- SpinSharedMutexSharedLock<false> lock(relations_mutex_);
- std::unordered_map<string, CatalogRelation*>::const_iterator it = rel_map_.find(ToLower(rel_name));
- if (it == rel_map_.end()) {
- return nullptr;
- } else {
- return it->second;
- }
-}
-
-CatalogRelation* CatalogDatabase::getRelationByNameMutable(const string &rel_name) {
- SpinSharedMutexSharedLock<false> lock(relations_mutex_);
- std::unordered_map<string, CatalogRelation*>::iterator it = rel_map_.find(ToLower(rel_name));
- if (it == rel_map_.end()) {
- return nullptr;
- } else {
- return it->second;
- }
-}
-
-relation_id CatalogDatabase::addRelation(CatalogRelation *new_rel) {
- const string lower_rel_name = ToLower(new_rel->getName());
- {
- SpinSharedMutexExclusiveLock<false> lock(relations_mutex_);
- if (hasRelationWithNameUnsafe(lower_rel_name)) {
- throw RelationNameCollision(name_, new_rel->getName());
- } else if (rel_vec_.size() > static_cast<size_t>(kCatalogMaxID)) {
- throw CatalogIDOverflow("relation");
- } else {
- rel_map_[lower_rel_name] = new_rel;
- rel_vec_.push_back(new_rel);
- new_rel->setParent(this);
- new_rel->setID(static_cast<relation_id>(rel_vec_.size() - 1));
- return (new_rel->getID());
- }
- }
-}
-
-void CatalogDatabase::dropRelationByName(const std::string &rel_name) {
- SpinSharedMutexExclusiveLock<false> lock(relations_mutex_);
- std::unordered_map<string, CatalogRelation*>::iterator it = rel_map_.find(ToLower(rel_name));
- if (it == rel_map_.end()) {
- throw RelationNameNotFound(name_, rel_name);
- } else {
- rel_vec_.deleteElement(it->second->getID());
- rel_map_.erase(it);
- }
-}
-
-void CatalogDatabase::dropRelationById(const relation_id id) {
- SpinSharedMutexExclusiveLock<false> lock(relations_mutex_);
- if (hasRelationWithIdUnsafe(id)) {
- rel_map_.erase(ToLower(rel_vec_[id].getName()));
- rel_vec_.deleteElement(id);
- } else {
- throw RelationIdNotFound(name_, id);
- }
-}
-
-serialization::CatalogDatabase CatalogDatabase::getProto() const {
- serialization::CatalogDatabase proto;
- proto.set_name(name_);
-
- int i = 0;
- for (PtrVector<CatalogRelation, true>::const_iterator it = rel_vec_.begin(); it != rel_vec_.end(); ++it, ++i) {
- if (it.isNull()) {
- proto.add_null_relations(i);
- } else {
- proto.add_relations()->CopyFrom(it->getProto());
- }
- }
- return proto;
-}
-
-} // namespace quickstep