├── .clang-format ├── .dockerignore ├── .editorconfig ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE ├── README.md ├── cmake ├── CapnProtoMacros.cmake ├── CompilerInfo.cmake ├── ConfigGen.cmake ├── Dependencies.cmake ├── External │ ├── capnproto.cmake │ ├── gflags.cmake │ └── glog.cmake ├── Misc.cmake ├── Modules │ ├── Coveralls.cmake │ ├── CoverallsClear.cmake │ ├── CoverallsGenerateGcov.cmake │ ├── FindEigen3.cmake │ ├── FindGFlags.cmake │ ├── FindGlog.cmake │ ├── FindJeMalloc.cmake │ ├── FindJsoncpp.cmake │ ├── FindLibevent.cmake │ ├── FindLibffi.cmake │ ├── FindLibunwind.cmake │ ├── FindPOSTGRES.cmake │ ├── FindPQXX.cmake │ ├── FindSQLite3.cmake │ ├── FindTBB.cmake │ ├── MemoryCheck.cmake │ ├── Sanitizer.cmake │ ├── ThreadSanitizer.cmake │ ├── doxygen.cmake │ └── tsan.suppressions ├── ProtoBuf.cmake ├── Summary.cmake ├── Targets.cmake ├── Templates │ ├── Doxyfile.in │ ├── PelotonConfig.cmake.in │ ├── PelotonConfigVersion.cmake.in │ └── peloton_config.h.in ├── Utils.cmake └── lint.cmake ├── data ├── intermediate_openssl.cnf └── openssl.cnf ├── doc ├── README.md ├── codegen_cache.md ├── doxygen.cfg ├── memcached.txt └── template.md ├── script ├── coding_style.md ├── demo │ ├── README.md │ ├── add-index.sh │ ├── init-demo.sh │ ├── oltpbench.py │ ├── start-demo.sh │ └── throughput-demo.py ├── docker │ ├── centos7 │ │ ├── Dockerfile │ │ └── Dockerfile-jenkins │ ├── debian-stretch │ │ ├── Dockerfile │ │ └── Dockerfile-jenkins │ ├── fedora26 │ │ ├── Dockerfile │ │ └── Dockerfile-jenkins │ ├── fedora27 │ │ ├── Dockerfile │ │ └── Dockerfile-jenkins │ ├── ubuntu-trusty │ │ ├── Dockerfile │ │ └── Dockerfile-jenkins │ └── ubuntu-xenial │ │ ├── Dockerfile │ │ └── Dockerfile-jenkins ├── formatting │ ├── formatter.py │ └── iwyu.md ├── git-hooks │ ├── README.md │ └── pre-commit ├── github │ ├── github-pr-status.py │ └── github-stats.py ├── helpers.py ├── installation │ ├── .gitignore │ ├── Vagrantfile │ ├── create_certificates.sh │ ├── packages.sh │ └── vagrant-customize.sh ├── oltpbenchmark │ ├── benchmark.py │ ├── peloton_ycsb_config.xml │ ├── test_peloton.sh-OLD │ └── testbed │ │ ├── .gitignore │ │ ├── ReadMe.md │ │ ├── gather_tpcc.sh │ │ ├── gather_ycsb.sh │ │ ├── measure-performance-tpcc.py │ │ ├── measure-performance-ycsb.py │ │ ├── tpcc_template.xml │ │ └── ycsb_template.xml ├── porting │ ├── change_type.py │ ├── macro.py │ ├── push.py │ └── warning-fixer.py ├── testing │ ├── ddl │ │ ├── northwind.postgre.sql │ │ ├── tinyint.sql │ │ ├── tpcc-ddl.sql │ │ ├── tpcc-postgres-ddl.sql │ │ ├── tpce-ddl.sql │ │ └── ycsb-ddl.sql │ ├── dml │ │ ├── aggregate.sql │ │ ├── basic.sql │ │ ├── basic1.sql │ │ ├── basic2.sql │ │ ├── basic_gc.sql │ │ ├── case_unaryminus_coalesce_nullif.sql │ │ ├── date.sql │ │ ├── extract.out │ │ ├── extract.sql │ │ ├── joins.sql │ │ ├── multi_column_index.sql │ │ ├── mutate.sql │ │ ├── string.sql │ │ ├── string_functions.sql │ │ └── update.sql │ ├── jdbc │ │ ├── .gitignore │ │ ├── README.md │ │ ├── load_rootcrt_ssl.sh │ │ ├── src │ │ │ ├── PelotonBasicTest.java │ │ │ ├── PelotonErrorTest.java │ │ │ ├── PelotonTypeTest.java │ │ │ ├── SSLTest.java │ │ │ └── StocklevelTest.java │ │ └── test_jdbc.sh │ ├── join │ │ ├── hash_join.sql │ │ ├── merge_join.sql │ │ ├── nested_loop_join.sql │ │ ├── nested_loop_join1.sql │ │ ├── nested_loop_join2.sql │ │ ├── nested_loop_join3.sql │ │ └── output.txt │ ├── junit │ │ ├── .gitignore │ │ ├── InsertPSTest.java │ │ ├── InsertTPCCTest.java │ │ ├── InsertTest.java │ │ ├── PLTestBase.java │ │ ├── Readme.txt │ │ ├── UpdateTest.java │ │ ├── build.xml │ │ ├── lib │ │ │ ├── hamcrest-core-1.3.jar │ │ │ ├── junit-4.12.jar │ │ │ ├── junit-platform-console-standalone-1.1.0.jar │ │ │ └── postgresql-9.4.1209.jre6.jar │ │ └── run_junit.py │ ├── logging │ │ ├── create_table.sql │ │ ├── insert.sql │ │ ├── logging_test.sh │ │ ├── run_ycsb.sh │ │ └── select.sql │ ├── memcached │ │ └── sql │ │ │ └── mc_basic.sql │ ├── nops │ │ ├── README.md │ │ ├── gather_nop.sh │ │ ├── nops.py │ │ ├── src │ │ │ └── PelotonTest.java │ │ └── test_nop.sh │ ├── psql │ │ ├── psql_ref_out.txt │ │ └── psql_test.sh │ ├── sqlite_trace │ │ ├── .gitignore │ │ ├── README.md │ │ ├── clear.sh │ │ ├── config.py │ │ ├── keyword_filter │ │ ├── run.sh │ │ ├── trace-replay.py │ │ └── trace_files │ └── udf │ │ ├── load_c_udf.sql │ │ ├── load_plpgsql_udf.sql │ │ ├── test_c_udf.out │ │ ├── test_c_udf.sql │ │ ├── test_plpgsql_udf.out │ │ └── test_plpgsql_udf.sql └── validators │ ├── jdbc_validator.py │ ├── source_validator.py │ └── stat_validator.py ├── src ├── .editorconfig ├── CMakeLists.txt ├── binder │ ├── bind_node_visitor.cpp │ └── binder_context.cpp ├── brain │ ├── cluster.cpp │ ├── kd_tree.cpp │ ├── modelgen │ │ ├── LSTM.py │ │ └── augmented_nn.py │ ├── query_clusterer.cpp │ ├── query_logger.cpp │ ├── selectivity │ │ ├── augmented_nn.cpp │ │ └── selectivity_defaults.cpp │ ├── util │ │ ├── eigen_util.cpp │ │ ├── model_util.cpp │ │ └── tf_session_entity │ │ │ ├── tf_session_entity.cpp │ │ │ ├── tf_session_entity_input.cpp │ │ │ ├── tf_session_entity_io.cpp │ │ │ └── tf_session_entity_output.cpp │ └── workload │ │ ├── base_tf.cpp │ │ ├── ensemble_model.cpp │ │ ├── kernel_model.cpp │ │ ├── linear_model.cpp │ │ ├── lstm.cpp │ │ └── workload_defaults.cpp ├── catalog │ ├── abstract_catalog.cpp │ ├── catalog.cpp │ ├── catalog_cache.cpp │ ├── column.cpp │ ├── column_catalog.cpp │ ├── column_stats_catalog.cpp │ ├── constraint.cpp │ ├── constraint_catalog.cpp │ ├── database_catalog.cpp │ ├── database_metrics_catalog.cpp │ ├── index_catalog.cpp │ ├── index_metrics_catalog.cpp │ ├── language_catalog.cpp │ ├── layout_catalog.cpp │ ├── manager.cpp │ ├── proc_catalog.cpp │ ├── query_history_catalog.cpp │ ├── query_metrics_catalog.cpp │ ├── schema.cpp │ ├── schema_catalog.cpp │ ├── settings_catalog.cpp │ ├── system_catalogs.cpp │ ├── table_catalog.cpp │ ├── table_metrics_catalog.cpp │ ├── trigger_catalog.cpp │ └── zone_map_catalog.cpp ├── codegen │ ├── aggregation.cpp │ ├── bloom_filter_accessor.cpp │ ├── buffer_accessor.cpp │ ├── buffering_consumer.cpp │ ├── code_context.cpp │ ├── codegen.cpp │ ├── compact_storage.cpp │ ├── compilation_context.cpp │ ├── consumer_context.cpp │ ├── counting_consumer.cpp │ ├── deleter.cpp │ ├── execution_consumer.cpp │ ├── expression │ │ ├── arithmetic_translator.cpp │ │ ├── case_translator.cpp │ │ ├── comparison_translator.cpp │ │ ├── conjunction_translator.cpp │ │ ├── constant_translator.cpp │ │ ├── expression_translator.cpp │ │ ├── function_translator.cpp │ │ ├── negation_translator.cpp │ │ ├── null_check_translator.cpp │ │ ├── parameter_translator.cpp │ │ └── tuple_value_translator.cpp │ ├── function_builder.cpp │ ├── hash.cpp │ ├── hash_table.cpp │ ├── inserter.cpp │ ├── interpreter │ │ ├── bytecode_builder.cpp │ │ ├── bytecode_function.cpp │ │ └── bytecode_interpreter.cpp │ ├── lang │ │ ├── if.cpp │ │ ├── loop.cpp │ │ └── vectorized_loop.cpp │ ├── oa_hash_table.cpp │ ├── operator │ │ ├── block_nested_loop_join_translator.cpp │ │ ├── csv_scan_translator.cpp │ │ ├── delete_translator.cpp │ │ ├── global_group_by_translator.cpp │ │ ├── hash_group_by_translator.cpp │ │ ├── hash_join_translator.cpp │ │ ├── hash_translator.cpp │ │ ├── insert_translator.cpp │ │ ├── limit_translator.cpp │ │ ├── operator_translator.cpp │ │ ├── order_by_translator.cpp │ │ ├── projection_translator.cpp │ │ ├── table_scan_translator.cpp │ │ └── update_translator.cpp │ ├── parameter_cache.cpp │ ├── pipeline.cpp │ ├── proxy │ │ ├── bloom_filter_proxy.cpp │ │ ├── buffer_proxy.cpp │ │ ├── csv_scanner_proxy.cpp │ │ ├── data_table_proxy.cpp │ │ ├── date_functions_proxy.cpp │ │ ├── deleter_proxy.cpp │ │ ├── executor_context_proxy.cpp │ │ ├── hash_table_proxy.cpp │ │ ├── inserter_proxy.cpp │ │ ├── numeric_functions_proxy.cpp │ │ ├── oa_hash_table_proxy.cpp │ │ ├── pool_proxy.cpp │ │ ├── query_parameters_proxy.cpp │ │ ├── runtime_functions_proxy.cpp │ │ ├── sorter_proxy.cpp │ │ ├── storage_manager_proxy.cpp │ │ ├── string_functions_proxy.cpp │ │ ├── target_proxy.cpp │ │ ├── tile_group_proxy.cpp │ │ ├── timestamp_functions_proxy.cpp │ │ ├── transaction_context_proxy.cpp │ │ ├── transaction_runtime_proxy.cpp │ │ ├── tuple_proxy.cpp │ │ ├── updater_proxy.cpp │ │ ├── value_proxy.cpp │ │ ├── values_runtime_proxy.cpp │ │ ├── varlen_proxy.cpp │ │ └── zone_map_proxy.cpp │ ├── query.cpp │ ├── query_cache.cpp │ ├── query_compiler.cpp │ ├── query_state.cpp │ ├── row_batch.cpp │ ├── runtime_functions.cpp │ ├── sorter.cpp │ ├── table.cpp │ ├── table_storage.cpp │ ├── tile_group.cpp │ ├── transaction_runtime.cpp │ ├── translator_factory.cpp │ ├── type │ │ ├── array_type.cpp │ │ ├── bigint_type.cpp │ │ ├── boolean_type.cpp │ │ ├── date_type.cpp │ │ ├── decimal_type.cpp │ │ ├── integer_type.cpp │ │ ├── smallint_type.cpp │ │ ├── sql_type.cpp │ │ ├── timestamp_type.cpp │ │ ├── tinyint_type.cpp │ │ ├── type.cpp │ │ ├── type_system.cpp │ │ ├── varbinary_type.cpp │ │ └── varchar_type.cpp │ ├── updateable_storage.cpp │ ├── updater.cpp │ ├── util │ │ ├── bloom_filter.cpp │ │ ├── buffer.cpp │ │ ├── csv_scanner.cpp │ │ ├── hash_table.cpp │ │ ├── oa_hash_table.cpp │ │ └── sorter.cpp │ ├── value.cpp │ ├── values_runtime.cpp │ └── vector.cpp ├── common │ ├── allocator.cpp │ ├── cache.cpp │ ├── container │ │ ├── circular_buffer.cpp │ │ ├── cuckoo_map.cpp │ │ └── lock_free_array.cpp │ ├── exception.cpp │ ├── init.cpp │ ├── internal_types.cpp │ ├── item_pointer.cpp │ ├── notifiable_task.cpp │ ├── portal.cpp │ ├── printable.cpp │ ├── sql_node_visitor.cpp │ ├── stack_trace.cpp │ ├── statement.cpp │ ├── statement_cache.cpp │ ├── statement_cache_manager.cpp │ └── utility.cpp ├── concurrency │ ├── decentralized_epoch_manager.cpp │ ├── epoch_manager_factory.cpp │ ├── local_epoch.cpp │ ├── timestamp_ordering_transaction_manager.cpp │ ├── transaction_context.cpp │ ├── transaction_manager.cpp │ └── transaction_manager_factory.cpp ├── executor │ ├── README.md │ ├── abstract_executor.cpp │ ├── abstract_join_executor.cpp │ ├── abstract_scan_executor.cpp │ ├── aggregate_executor.cpp │ ├── aggregator.cpp │ ├── analyze_executor.cpp │ ├── append_executor.cpp │ ├── copy_executor.cpp │ ├── create_executor.cpp │ ├── create_function_executor.cpp │ ├── delete_executor.cpp │ ├── drop_executor.cpp │ ├── executor_context.cpp │ ├── hash_executor.cpp │ ├── hash_join_executor.cpp │ ├── hash_set_op_executor.cpp │ ├── hybrid_scan_executor.cpp │ ├── index_scan_executor.cpp │ ├── insert_executor.cpp │ ├── limit_executor.cpp │ ├── logical_tile.cpp │ ├── logical_tile_factory.cpp │ ├── materialization_executor.cpp │ ├── merge_join_executor.cpp │ ├── nested_loop_join_executor.cpp │ ├── order_by_executor.cpp │ ├── plan_executor.cpp │ ├── populate_index_executor.cpp │ ├── projection_executor.cpp │ ├── seq_scan_executor.cpp │ └── update_executor.cpp ├── expression │ ├── abstract_expression.cpp │ ├── aggregate_expression.cpp │ ├── case_expression.cpp │ ├── comparison_expression.cpp │ ├── conjunction_expression.cpp │ ├── constant_value_expression.cpp │ ├── function_expression.cpp │ ├── operator_expression.cpp │ ├── parameter_value_expression.cpp │ ├── star_expression.cpp │ └── tuple_value_expression.cpp ├── function │ ├── date_functions.cpp │ ├── functions.cpp │ ├── numeric_functions.cpp │ ├── old_engine_string_functions.cpp │ ├── string_functions.cpp │ └── timestamp_functions.cpp ├── gc │ ├── gc_manager.cpp │ ├── gc_manager_factory.cpp │ └── transaction_level_gc_manager.cpp ├── include │ ├── binder │ │ ├── bind_node_visitor.h │ │ └── binder_context.h │ ├── brain │ │ ├── brain.h │ │ ├── cluster.h │ │ ├── kd_tree.h │ │ ├── query_clusterer.h │ │ ├── query_logger.h │ │ ├── selectivity │ │ │ ├── augmented_nn.h │ │ │ └── selectivity_defaults.h │ │ ├── util │ │ │ ├── eigen_util.h │ │ │ ├── model_util.h │ │ │ ├── tf_session_entity │ │ │ │ ├── tf_session_entity.h │ │ │ │ ├── tf_session_entity_input.h │ │ │ │ ├── tf_session_entity_io.h │ │ │ │ └── tf_session_entity_output.h │ │ │ └── tf_util.h │ │ └── workload │ │ │ ├── base_tf.h │ │ │ ├── ensemble_model.h │ │ │ ├── kernel_model.h │ │ │ ├── linear_model.h │ │ │ ├── lstm.h │ │ │ └── workload_defaults.h │ ├── capnp │ │ └── peloton_service.capnp │ ├── catalog │ │ ├── abstract_catalog.h │ │ ├── catalog.h │ │ ├── catalog_cache.h │ │ ├── catalog_defaults.h │ │ ├── column.h │ │ ├── column_catalog.h │ │ ├── column_stats_catalog.h │ │ ├── constraint.h │ │ ├── constraint_catalog.h │ │ ├── database_catalog.h │ │ ├── database_metrics_catalog.h │ │ ├── index_catalog.h │ │ ├── index_metrics_catalog.h │ │ ├── language_catalog.h │ │ ├── layout_catalog.h │ │ ├── manager.h │ │ ├── proc_catalog.h │ │ ├── query_history_catalog.h │ │ ├── query_metrics_catalog.h │ │ ├── schema.h │ │ ├── schema_catalog.h │ │ ├── settings_catalog.h │ │ ├── system_catalogs.h │ │ ├── table_catalog.h │ │ ├── table_metrics_catalog.h │ │ ├── trigger_catalog.h │ │ └── zone_map_catalog.h │ ├── codegen │ │ ├── aggregation.h │ │ ├── auxiliary_producer_function.h │ │ ├── bloom_filter_accessor.h │ │ ├── buffer_accessor.h │ │ ├── buffering_consumer.h │ │ ├── code_context.h │ │ ├── codegen.h │ │ ├── compact_storage.h │ │ ├── compilation_context.h │ │ ├── consumer_context.h │ │ ├── counting_consumer.h │ │ ├── deleter.h │ │ ├── execution_consumer.h │ │ ├── expression │ │ │ ├── arithmetic_translator.h │ │ │ ├── case_translator.h │ │ │ ├── comparison_translator.h │ │ │ ├── conjunction_translator.h │ │ │ ├── constant_translator.h │ │ │ ├── expression_translator.h │ │ │ ├── function_translator.h │ │ │ ├── negation_translator.h │ │ │ ├── null_check_translator.h │ │ │ ├── parameter_translator.h │ │ │ └── tuple_value_translator.h │ │ ├── function_builder.h │ │ ├── hash.h │ │ ├── hash_table.h │ │ ├── inserter.h │ │ ├── interpreter │ │ │ ├── bytecode_builder.h │ │ │ ├── bytecode_function.h │ │ │ ├── bytecode_instructions.def │ │ │ └── bytecode_interpreter.h │ │ ├── lang │ │ │ ├── if.h │ │ │ ├── loop.h │ │ │ └── vectorized_loop.h │ │ ├── oa_hash_table.h │ │ ├── operator │ │ │ ├── block_nested_loop_join_translator.h │ │ │ ├── csv_scan_translator.h │ │ │ ├── delete_translator.h │ │ │ ├── global_group_by_translator.h │ │ │ ├── hash_group_by_translator.h │ │ │ ├── hash_join_translator.h │ │ │ ├── hash_translator.h │ │ │ ├── insert_translator.h │ │ │ ├── limit_translator.h │ │ │ ├── operator_translator.h │ │ │ ├── order_by_translator.h │ │ │ ├── projection_translator.h │ │ │ ├── table_scan_translator.h │ │ │ └── update_translator.h │ │ ├── parameter_cache.h │ │ ├── pipeline.h │ │ ├── proxy │ │ │ ├── README.md │ │ │ ├── bloom_filter_proxy.h │ │ │ ├── buffer_proxy.h │ │ │ ├── csv_scanner_proxy.h │ │ │ ├── data_table_proxy.h │ │ │ ├── date_functions_proxy.h │ │ │ ├── deleter_proxy.h │ │ │ ├── executor_context_proxy.h │ │ │ ├── hash_table_proxy.h │ │ │ ├── inserter_proxy.h │ │ │ ├── numeric_functions_proxy.h │ │ │ ├── oa_hash_table_proxy.h │ │ │ ├── pool_proxy.h │ │ │ ├── proxy.h │ │ │ ├── query_parameters_proxy.h │ │ │ ├── runtime_functions_proxy.h │ │ │ ├── sorter_proxy.h │ │ │ ├── storage_manager_proxy.h │ │ │ ├── string_functions_proxy.h │ │ │ ├── target_proxy.h │ │ │ ├── tile_group_proxy.h │ │ │ ├── timestamp_functions_proxy.h │ │ │ ├── transaction_context_proxy.h │ │ │ ├── transaction_runtime_proxy.h │ │ │ ├── tuple_proxy.h │ │ │ ├── type_builder.h │ │ │ ├── updater_proxy.h │ │ │ ├── value_proxy.h │ │ │ ├── values_runtime_proxy.h │ │ │ ├── varlen_proxy.h │ │ │ └── zone_map_proxy.h │ │ ├── query.h │ │ ├── query_cache.h │ │ ├── query_compiler.h │ │ ├── query_parameters.h │ │ ├── query_parameters_map.h │ │ ├── query_state.h │ │ ├── row_batch.h │ │ ├── runtime_functions.h │ │ ├── scan_callback.h │ │ ├── sorter.h │ │ ├── table.h │ │ ├── table_storage.h │ │ ├── tile_group.h │ │ ├── transaction_runtime.h │ │ ├── translator_factory.h │ │ ├── type │ │ │ ├── array_type.h │ │ │ ├── bigint_type.h │ │ │ ├── boolean_type.h │ │ │ ├── date_type.h │ │ │ ├── decimal_type.h │ │ │ ├── integer_type.h │ │ │ ├── smallint_type.h │ │ │ ├── sql_type.h │ │ │ ├── timestamp_type.h │ │ │ ├── tinyint_type.h │ │ │ ├── type.h │ │ │ ├── type_system.h │ │ │ ├── varbinary_type.h │ │ │ └── varchar_type.h │ │ ├── updateable_storage.h │ │ ├── updater.h │ │ ├── util │ │ │ ├── bloom_filter.h │ │ │ ├── buffer.h │ │ │ ├── csv_scanner.h │ │ │ ├── hash_table.h │ │ │ ├── oa_hash_table.h │ │ │ └── sorter.h │ │ ├── value.h │ │ ├── values_runtime.h │ │ ├── varlen.h │ │ └── vector.h │ ├── common │ │ ├── abstract_tuple.h │ │ ├── cache.h │ │ ├── cast.h │ │ ├── container │ │ │ ├── circular_buffer.h │ │ │ ├── cuckoo_map.h │ │ │ ├── lock_free_array.h │ │ │ └── lock_free_queue.h │ │ ├── container_tuple.h │ │ ├── dedicated_thread_owner.h │ │ ├── dedicated_thread_registry.h │ │ ├── dedicated_thread_task.h │ │ ├── event_util.h │ │ ├── exception.h │ │ ├── generator.h │ │ ├── init.h │ │ ├── internal_types.h │ │ ├── item_pointer.h │ │ ├── iterator.h │ │ ├── logger.h │ │ ├── macros.h │ │ ├── notifiable_task.h │ │ ├── overflow_builtins.h │ │ ├── platform.h │ │ ├── portal.h │ │ ├── printable.h │ │ ├── singleton.h │ │ ├── sql_node_visitor.h │ │ ├── stack_trace.h │ │ ├── statement.h │ │ ├── statement_cache.h │ │ ├── statement_cache_manager.h │ │ ├── synchronization │ │ │ ├── condition.h │ │ │ ├── count_down_latch.h │ │ │ ├── mutex_latch.h │ │ │ ├── readwrite_latch.h │ │ │ ├── recursive_latch.h │ │ │ └── spin_latch.h │ │ ├── thread_pool.h │ │ ├── timer.h │ │ └── utility.h │ ├── concurrency │ │ ├── decentralized_epoch_manager.h │ │ ├── epoch_manager.h │ │ ├── epoch_manager_factory.h │ │ ├── local_epoch.h │ │ ├── timestamp_ordering_transaction_manager.h │ │ ├── transaction_context.h │ │ ├── transaction_manager.h │ │ └── transaction_manager_factory.h │ ├── executor │ │ ├── abstract_executor.h │ │ ├── abstract_join_executor.h │ │ ├── abstract_scan_executor.h │ │ ├── aggregate_executor.h │ │ ├── aggregator.h │ │ ├── analyze_executor.h │ │ ├── append_executor.h │ │ ├── copy_executor.h │ │ ├── create_executor.h │ │ ├── create_function_executor.h │ │ ├── delete_executor.h │ │ ├── drop_executor.h │ │ ├── executor_context.h │ │ ├── executors.h │ │ ├── hash_executor.h │ │ ├── hash_join_executor.h │ │ ├── hash_set_op_executor.h │ │ ├── hybrid_scan_executor.h │ │ ├── index_scan_executor.h │ │ ├── insert_executor.h │ │ ├── limit_executor.h │ │ ├── logical_tile.h │ │ ├── logical_tile_factory.h │ │ ├── materialization_executor.h │ │ ├── merge_join_executor.h │ │ ├── nested_loop_join_executor.h │ │ ├── order_by_executor.h │ │ ├── plan_executor.h │ │ ├── populate_index_executor.h │ │ ├── projection_executor.h │ │ ├── seq_scan_executor.h │ │ └── update_executor.h │ ├── expression │ │ ├── abstract_expression.h │ │ ├── aggregate_expression.h │ │ ├── case_expression.h │ │ ├── comparison_expression.h │ │ ├── conjunction_expression.h │ │ ├── constant_value_expression.h │ │ ├── expression_util.h │ │ ├── function_expression.h │ │ ├── operator_expression.h │ │ ├── parameter.h │ │ ├── parameter_value_expression.h │ │ ├── star_expression.h │ │ ├── subquery_expression.h │ │ └── tuple_value_expression.h │ ├── function │ │ ├── date_functions.h │ │ ├── functions.h │ │ ├── numeric_functions.h │ │ ├── old_engine_string_functions.h │ │ ├── string_functions.h │ │ └── timestamp_functions.h │ ├── gc │ │ ├── gc_manager.h │ │ ├── gc_manager_factory.h │ │ └── transaction_level_gc_manager.h │ ├── index │ │ ├── art_index.h │ │ ├── atomic_stack.h │ │ ├── bloom_filter.h │ │ ├── bwtree.h │ │ ├── bwtree_index.h │ │ ├── compact_ints_key.h │ │ ├── generic_key.h │ │ ├── index.h │ │ ├── index_factory.h │ │ ├── index_key.h │ │ ├── index_util.h │ │ ├── scan_optimizer.h │ │ ├── skiplist.h │ │ ├── skiplist_index.h │ │ ├── sorted_small_set.h │ │ └── tuple_key.h │ ├── logging │ │ ├── checkpoint_manager.h │ │ ├── checkpoint_manager_factory.h │ │ ├── log_buffer.h │ │ ├── log_buffer_pool.h │ │ ├── log_manager.h │ │ ├── log_manager_factory.h │ │ ├── log_record.h │ │ ├── logical_checkpoint_manager.h │ │ ├── logical_log_manager.h │ │ └── logical_logger.h │ ├── network │ │ ├── connection_dispatcher_task.h │ │ ├── connection_handle.h │ │ ├── connection_handler_task.h │ │ ├── marshal.h │ │ ├── network_io_wrapper_factory.h │ │ ├── network_io_wrappers.h │ │ ├── network_state.h │ │ ├── peloton_rpc_handler_task.h │ │ ├── peloton_server.h │ │ ├── postgres_protocol_handler.h │ │ ├── protocol_handler.h │ │ └── protocol_handler_factory.h │ ├── optimizer │ │ ├── abstract_optimizer.h │ │ ├── binding.h │ │ ├── child_property_deriver.h │ │ ├── column.h │ │ ├── column_manager.h │ │ ├── cost_model │ │ │ ├── abstract_cost_model.h │ │ │ ├── default_cost_model.h │ │ │ ├── postgres_cost_model.h │ │ │ └── trivial_cost_model.h │ │ ├── group.h │ │ ├── group_expression.h │ │ ├── input_column_deriver.h │ │ ├── memo.h │ │ ├── operator_expression.h │ │ ├── operator_node.h │ │ ├── operator_visitor.h │ │ ├── operators.h │ │ ├── optimize_context.h │ │ ├── optimizer.h │ │ ├── optimizer_metadata.h │ │ ├── optimizer_task.h │ │ ├── optimizer_task_pool.h │ │ ├── pattern.h │ │ ├── plan_generator.h │ │ ├── properties.h │ │ ├── property.h │ │ ├── property_enforcer.h │ │ ├── property_set.h │ │ ├── property_visitor.h │ │ ├── query_node_visitor.h │ │ ├── query_to_operator_transformer.h │ │ ├── rule.h │ │ ├── rule_impls.h │ │ ├── stats │ │ │ ├── child_stats_deriver.h │ │ │ ├── column_stats.h │ │ │ ├── column_stats_collector.h │ │ │ ├── count_min_sketch.h │ │ │ ├── histogram.h │ │ │ ├── hyperloglog.h │ │ │ ├── selectivity.h │ │ │ ├── stats.h │ │ │ ├── stats_calculator.h │ │ │ ├── stats_storage.h │ │ │ ├── stats_util.h │ │ │ ├── table_stats.h │ │ │ ├── table_stats_collector.h │ │ │ ├── top_k_elements.h │ │ │ ├── tuple_sample.h │ │ │ ├── tuple_sampler.h │ │ │ ├── tuple_samples_storage.h │ │ │ └── value_condition.h │ │ └── util.h │ ├── parser │ │ ├── analyze_statement.h │ │ ├── copy_statement.h │ │ ├── create_function_statement.h │ │ ├── create_statement.h │ │ ├── delete_statement.h │ │ ├── drop_statement.h │ │ ├── execute_statement.h │ │ ├── explain_statement.h │ │ ├── insert_statement.h │ │ ├── nodes.h │ │ ├── parse_tree_transformer.h │ │ ├── parsenodes.h │ │ ├── pg_list.h │ │ ├── pg_query.h │ │ ├── pg_trigger.h │ │ ├── postgresparser.h │ │ ├── prepare_statement.h │ │ ├── select_statement.h │ │ ├── sql_statement.h │ │ ├── statements.h │ │ ├── table_ref.h │ │ ├── transaction_statement.h │ │ ├── update_statement.h │ │ └── variable_set_statement.h │ ├── planner │ │ ├── abstract_join_plan.h │ │ ├── abstract_plan.h │ │ ├── abstract_scan_plan.h │ │ ├── aggregate_plan.h │ │ ├── analyze_plan.h │ │ ├── append_plan.h │ │ ├── attribute_info.h │ │ ├── binding_context.h │ │ ├── create_function_plan.h │ │ ├── create_plan.h │ │ ├── csv_scan_plan.h │ │ ├── delete_plan.h │ │ ├── drop_plan.h │ │ ├── export_external_file_plan.h │ │ ├── hash_join_plan.h │ │ ├── hash_plan.h │ │ ├── hybrid_scan_plan.h │ │ ├── index_scan_plan.h │ │ ├── insert_plan.h │ │ ├── limit_plan.h │ │ ├── materialization_plan.h │ │ ├── merge_join_plan.h │ │ ├── mock_plan.h │ │ ├── nested_loop_join_plan.h │ │ ├── order_by_plan.h │ │ ├── plan_util.h │ │ ├── populate_index_plan.h │ │ ├── project_info.h │ │ ├── projection_plan.h │ │ ├── result_plan.h │ │ ├── seq_scan_plan.h │ │ ├── set_op_plan.h │ │ └── update_plan.h │ ├── proto │ │ ├── abstract_service.proto │ │ └── logging_service.proto │ ├── settings │ │ ├── setting_id.h │ │ ├── settings.h │ │ ├── settings_macro.h │ │ └── settings_manager.h │ ├── statistics │ │ ├── abstract_metric.h │ │ ├── access_metric.h │ │ ├── backend_stats_context.h │ │ ├── counter_metric.h │ │ ├── database_metric.h │ │ ├── index_metric.h │ │ ├── latency_metric.h │ │ ├── processor_metric.h │ │ ├── query_metric.h │ │ ├── stats_aggregator.h │ │ └── table_metric.h │ ├── storage │ │ ├── abstract_table.h │ │ ├── backend_manager.h │ │ ├── data_table.h │ │ ├── database.h │ │ ├── indirection_array.h │ │ ├── layout.h │ │ ├── masked_tuple.h │ │ ├── storage_manager.h │ │ ├── table_factory.h │ │ ├── temp_table.h │ │ ├── tile.h │ │ ├── tile_group.h │ │ ├── tile_group_factory.h │ │ ├── tile_group_header.h │ │ ├── tile_group_iterator.h │ │ ├── tuple.h │ │ ├── tuple_iterator.h │ │ └── zone_map_manager.h │ ├── threadpool │ │ ├── mono_queue_pool.h │ │ └── worker_pool.h │ ├── traffic_cop │ │ └── traffic_cop.h │ ├── trigger │ │ └── trigger.h │ ├── tuning │ │ ├── brain_util.h │ │ ├── clusterer.h │ │ ├── index_tuner.h │ │ ├── layout_tuner.h │ │ └── sample.h │ ├── type │ │ ├── abstract_pool.h │ │ ├── array_type.h │ │ ├── bigint_type.h │ │ ├── boolean_type.h │ │ ├── byte_array.h │ │ ├── date_type.h │ │ ├── decimal_type.h │ │ ├── ephemeral_pool.h │ │ ├── integer_parent_type.h │ │ ├── integer_type.h │ │ ├── limits.h │ │ ├── numeric_type.h │ │ ├── serializeio.h │ │ ├── serializer.h │ │ ├── smallint_type.h │ │ ├── timestamp_type.h │ │ ├── tinyint_type.h │ │ ├── type.h │ │ ├── type_id.h │ │ ├── type_util.h │ │ ├── value.h │ │ ├── value_factory.h │ │ ├── value_peeker.h │ │ └── varlen_type.h │ ├── udf │ │ ├── ast_nodes.h │ │ ├── udf_handler.h │ │ └── udf_parser.h │ └── util │ │ ├── file.h │ │ ├── file_util.h │ │ ├── hash_util.h │ │ ├── math_util.h │ │ ├── portable_endian.h │ │ ├── set_util.h │ │ ├── string_util.h │ │ ├── stringbox_util.h │ │ └── stringtable_util.h ├── index │ ├── README.md │ ├── art_index.cpp │ ├── bwtree.cpp │ ├── bwtree_index.cpp │ ├── index.cpp │ ├── index_factory.cpp │ ├── index_util.cpp │ ├── skiplist.cpp │ └── skiplist_index.cpp ├── logging │ ├── checkpoint_manager_factory.cpp │ ├── log_buffer.cpp │ ├── log_buffer_pool.cpp │ └── log_manager_factory.cpp ├── main │ └── peloton │ │ └── peloton.cpp ├── network │ ├── README │ ├── connection_dispatcher_task.cpp │ ├── connection_handle.cpp │ ├── connection_handler_task.cpp │ ├── marshal.cpp │ ├── network_io_wrapper_factory.cpp │ ├── network_io_wrappers.cpp │ ├── peloton_server.cpp │ ├── postgres_protocol_handler.cpp │ ├── protocol_handler.cpp │ └── protocol_handler_factory.cpp ├── optimizer │ ├── README.md │ ├── abstract_optimizer.cpp │ ├── binding.cpp │ ├── child_property_deriver.cpp │ ├── column.cpp │ ├── column_manager.cpp │ ├── group.cpp │ ├── group_expression.cpp │ ├── input_column_deriver.cpp │ ├── memo.cpp │ ├── operator_expression.cpp │ ├── operator_node.cpp │ ├── operators.cpp │ ├── optimizer.cpp │ ├── optimizer_task.cpp │ ├── pattern.cpp │ ├── plan_generator.cpp │ ├── properties.cpp │ ├── property.cpp │ ├── property_enforcer.cpp │ ├── property_set.cpp │ ├── query_to_operator_transformer.cpp │ ├── rule.cpp │ ├── rule_impls.cpp │ ├── stats │ │ ├── child_stats_deriver.cpp │ │ ├── column_stats_collector.cpp │ │ ├── selectivity.cpp │ │ ├── stats.cpp │ │ ├── stats_calculator.cpp │ │ ├── stats_storage.cpp │ │ ├── table_stats.cpp │ │ ├── table_stats_collector.cpp │ │ ├── tuple_sample.cpp │ │ ├── tuple_sampler.cpp │ │ └── tuple_samples_storage.cpp │ └── util.cpp ├── parser │ ├── README.md │ ├── analyze_statement.cpp │ ├── copy_statement.cpp │ ├── create_statement.cpp │ ├── delete_statement.cpp │ ├── drop_statement.cpp │ ├── execute_statement.cpp │ ├── insert_statement.cpp │ ├── postgresparser.cpp │ ├── prepare_statement.cpp │ ├── select_statement.cpp │ ├── sql_statement.cpp │ ├── table_ref.cpp │ ├── transaction_statement.cpp │ └── update_statement.cpp ├── planner │ ├── abstract_join_plan.cpp │ ├── abstract_plan.cpp │ ├── abstract_scan_plan.cpp │ ├── aggregate_plan.cpp │ ├── analyze_plan.cpp │ ├── create_function_plan.cpp │ ├── create_plan.cpp │ ├── csv_scan_plan.cpp │ ├── delete_plan.cpp │ ├── drop_plan.cpp │ ├── export_external_file_plan.cpp │ ├── hash_join_plan.cpp │ ├── hash_plan.cpp │ ├── hybrid_scan_plan.cpp │ ├── index_scan_plan.cpp │ ├── insert_plan.cpp │ ├── nested_loop_join_plan.cpp │ ├── order_by_plan.cpp │ ├── plan_util.cpp │ ├── populate_index_plan.cpp │ ├── project_info.cpp │ ├── projection_plan.cpp │ ├── seq_scan_plan.cpp │ └── update_plan.cpp ├── proto │ └── logging_service.proto ├── settings │ ├── README.md │ └── settings_manager.cpp ├── statistics │ ├── abstract_metric.cpp │ ├── access_metric.cpp │ ├── backend_stats_context.cpp │ ├── counter_metric.cpp │ ├── database_metric.cpp │ ├── index_metric.cpp │ ├── latency_metric.cpp │ ├── processor_metric.cpp │ ├── query_metric.cpp │ ├── stats_aggregator.cpp │ └── table_metric.cpp ├── storage │ ├── abstract_table.cpp │ ├── backend_manager.cpp │ ├── data_table.cpp │ ├── database.cpp │ ├── layout.cpp │ ├── storage_manager.cpp │ ├── table_factory.cpp │ ├── temp_table.cpp │ ├── tile.cpp │ ├── tile_group.cpp │ ├── tile_group_factory.cpp │ ├── tile_group_header.cpp │ ├── tile_group_iterator.cpp │ ├── tuple.cpp │ └── zone_map_manager.cpp ├── threadpool │ └── worker_pool.cpp ├── traffic_cop │ └── traffic_cop.cpp ├── trigger │ ├── README.md │ └── trigger.cpp ├── tuning │ ├── clusterer.cpp │ ├── index_tuner.cpp │ ├── layout_tuner.cpp │ └── sample.cpp ├── type │ ├── array_type.cpp │ ├── bigint_type.cpp │ ├── boolean_type.cpp │ ├── date_type.cpp │ ├── decimal_type.cpp │ ├── integer_parent_type.cpp │ ├── integer_type.cpp │ ├── numeric_type.cpp │ ├── smallint_type.cpp │ ├── timestamp_type.cpp │ ├── tinyint_type.cpp │ ├── type.cpp │ ├── value.cpp │ └── varlen_type.cpp ├── udf │ ├── ast_nodes.cpp │ ├── udf_handler.cpp │ └── udf_parser.cpp └── util │ ├── file.cpp │ ├── string_util.cpp │ └── stringbox_util.cpp ├── test ├── .gitignore ├── CMakeLists.txt ├── README.md ├── binder │ └── binder_test.cpp ├── brain │ ├── augmented_nn_test.cpp │ ├── eigen_util_test.cpp │ ├── model_test.cpp │ ├── model_util_test.cpp │ ├── query_clusterer_test.cpp │ ├── query_logger_test.cpp │ ├── tensorflow_util_test.cpp │ ├── testing_augmented_nn_util.cpp │ └── testing_forecast_util.cpp ├── catalog │ ├── catalog_test.cpp │ ├── constraints_test.cpp │ ├── manager_test.cpp │ └── tuple_schema_test.cpp ├── codegen │ ├── block_nested_loop_join_translator_test.cpp │ ├── bloom_filter_test.cpp │ ├── bytecode_interpreter_test.cpp │ ├── case_translator_test.cpp │ ├── csv_scan_test.cpp │ ├── csv_scan_translator_test.cpp │ ├── delete_translator_test.cpp │ ├── function_builder_test.cpp │ ├── group_by_translator_test.cpp │ ├── hash_join_translator_test.cpp │ ├── hash_table_test.cpp │ ├── if_test.cpp │ ├── insert_translator_test.cpp │ ├── limit_translator_test.cpp │ ├── oa_hash_table_test.cpp │ ├── order_by_translator_test.cpp │ ├── parameterization_test.cpp │ ├── query_cache_test.cpp │ ├── sorter_test.cpp │ ├── table_scan_translator_test.cpp │ ├── testing_codegen_util.cpp │ ├── type_integrity_test.cpp │ ├── update_translator_test.cpp │ ├── value_integrity_test.cpp │ └── zone_map_scan_test.cpp ├── common │ ├── cache_test.cpp │ ├── container_tuple_test.cpp │ ├── count_down_latch_test.cpp │ ├── cuckoo_map_test.cpp │ ├── harness.cpp │ ├── internal_types_test.cpp │ ├── lock_free_array_test.cpp │ ├── logger_test.cpp │ ├── overflow_builtins_test.cpp │ ├── statement_cache_manager_test.cpp │ ├── statement_cache_test.cpp │ └── thread_pool_test.cpp ├── concurrency │ ├── anomaly_test.cpp │ ├── decentralized_epoch_manager_test.cpp │ ├── local_epoch_test.cpp │ ├── multi_granularity_access_test.cpp │ ├── mvcc_test.cpp │ ├── serializable_transaction_test.cpp │ ├── testing_transaction_util.cpp │ └── timestamp_ordering_transaction_manager_test.cpp ├── executor │ ├── aggregate_test.cpp │ ├── append_test.cpp │ ├── copy_test.cpp │ ├── create_index_test.cpp │ ├── create_test.cpp │ ├── drop_test.cpp │ ├── hash_set_op_test.cpp │ ├── index_scan_test.cpp │ ├── insert_test.cpp │ ├── join_test.cpp │ ├── limit_test.cpp │ ├── loader_test.cpp │ ├── logical_tile_test.cpp │ ├── materialization_test.cpp │ ├── mutate_test.cpp │ ├── order_by_test.cpp │ ├── projection_test.cpp │ ├── seq_scan_test.cpp │ ├── testing_executor_util.cpp │ ├── testing_join_util.cpp │ ├── tile_group_layout_test.cpp │ └── update_test.cpp ├── expression │ ├── expression_test.cpp │ └── expression_util_test.cpp ├── function │ ├── functions_test.cpp │ ├── numeric_functions_test.cpp │ ├── string_functions_test.cpp │ └── timestamp_functions_test.cpp ├── gc │ ├── garbage_collection_test.cpp │ └── transaction_level_gc_manager_test.cpp ├── include │ ├── brain │ │ ├── testing_augmented_nn_util.h │ │ └── testing_forecast_util.h │ ├── catalog │ │ └── testing_constraints_util.h │ ├── codegen │ │ └── testing_codegen_util.h │ ├── common │ │ └── harness.h │ ├── concurrency │ │ └── testing_transaction_util.h │ ├── executor │ │ ├── mock_executor.h │ │ ├── testing_executor_util.h │ │ └── testing_join_util.h │ ├── index │ │ └── testing_index_util.h │ ├── logging │ │ └── testing_logging_util.h │ ├── optimizer │ │ └── mock_task.h │ ├── parser │ │ └── mock_sql_statement.h │ ├── sql │ │ └── testing_sql_util.h │ └── statistics │ │ └── testing_stats_util.h ├── index │ ├── art_index_test.cpp │ ├── bwtree_index_test.cpp │ ├── hybrid_index_test.cpp │ ├── index_intskey_test.cpp │ ├── index_util_test.cpp │ ├── skiplist_index_test.cpp │ └── testing_index_util.cpp ├── leak_suppr.txt ├── logging │ ├── buffer_pool_test.cpp │ ├── checkpoint_test.cpp │ ├── log_buffer_pool_test.cpp │ ├── log_buffer_test.cpp │ ├── log_record_test.cpp │ ├── logging_test.cpp │ ├── logging_util_test.cpp │ ├── new_checkpointing_test.cpp │ ├── new_logging_test.cpp │ ├── recovery_test.cpp │ ├── testing_logging_util.cpp │ └── write_behind_logging_test.cpp ├── network │ ├── exception_test.cpp │ ├── prepare_stmt_test.cpp │ ├── select_all_test.cpp │ ├── simple_query_test.cpp │ ├── ssl │ │ ├── root.crt │ │ ├── root.key │ │ ├── server.crt │ │ └── server.key │ └── ssl_test.cpp ├── optimizer │ ├── cardinality_test.cpp │ ├── column_stats_collector_test.cpp │ ├── count_min_sketch_test.cpp │ ├── histogram_test.cpp │ ├── hyperloglog_test.cpp │ ├── old_optimizer_test.cpp │ ├── operator_test.cpp │ ├── operator_transformer_test.cpp │ ├── optimizer_rule_test.cpp │ ├── optimizer_test.cpp │ ├── optimizer_test_util.cpp │ ├── plan_test.cpp │ ├── selectivity_test.cpp │ ├── stats_storage_test.cpp │ ├── table_stats_collector_test.cpp │ ├── table_stats_test.cpp │ ├── top_k_elements_test.cpp │ ├── tuple_sampler_test.cpp │ └── tuple_samples_storage_test.cpp ├── parser │ ├── parser_test.cpp │ ├── parser_utils_test.cpp │ └── postgresparser_test.cpp ├── performance │ ├── index_performance_test.cpp │ └── insert_performance_test.cpp ├── planner │ ├── plan_util_test.cpp │ ├── planner_equality_test.cpp │ └── planner_test.cpp ├── postgres │ └── suite.py ├── settings │ └── settings_manager_test.cpp ├── sql │ ├── aggregate_groupby_sql_test.cpp │ ├── aggregate_sql_test.cpp │ ├── analyze_sql_test.cpp │ ├── case_sql_test.cpp │ ├── decimal_functions_sql_test.cpp │ ├── delete_sql_test.cpp │ ├── distinct_aggregate_sql_test.cpp │ ├── distinct_sql_test.cpp │ ├── drop_sql_test.cpp │ ├── foreign_key_sql_test.cpp │ ├── index_scan_sql_test.cpp │ ├── insert_sql_test.cpp │ ├── is_null_sql_test.cpp │ ├── optimizer_sql_test.cpp │ ├── order_by_sql_test.cpp │ ├── projection_sql_test.cpp │ ├── string_functions_sql_test.cpp │ ├── testing_sql_util.cpp │ ├── timestamp_functions_sql_test.cpp │ ├── type_sql_test.cpp │ ├── update_primary_index_sql_test.cpp │ ├── update_secondary_index_sql_test.cpp │ └── update_sql_test.cpp ├── statistics │ ├── stats_test.cpp │ └── testing_stats_util.cpp ├── storage │ ├── backend_manager_test.cpp │ ├── data_table_test.cpp │ ├── database_test.cpp │ ├── masked_tuple_test.cpp │ ├── temp_table_test.cpp │ ├── tile_group_iterator_test.cpp │ ├── tile_group_test.cpp │ ├── tile_test.cpp │ ├── tuple_test.cpp │ └── zone_map_test.cpp ├── test-driver.sh ├── trigger │ └── trigger_test.cpp ├── tuning │ ├── brain_util_test.cpp │ ├── clusterer_test.cpp │ ├── index_tuner_test.cpp │ └── layout_tuner_test.cpp ├── type │ ├── array_value_test.cpp │ ├── boolean_value_test.cpp │ ├── date_value_test.cpp │ ├── numeric_value_test.cpp │ ├── pool_test.cpp │ ├── timestamp_value_test.cpp │ ├── type_test.cpp │ ├── type_util_test.cpp │ ├── value_factory_test.cpp │ └── value_test.cpp ├── udf │ └── udf_test.cpp └── util │ ├── file_util_test.cpp │ ├── set_util_test.cpp │ ├── string_util_test.cpp │ ├── stringbox_util_test.cpp │ └── stringtable_util_test.cpp └── third_party ├── CMakeLists.txt ├── adaptive_radix_tree ├── Epoch.h ├── Epoch_impl.h ├── Key.h ├── LeafNode_impl.h ├── Node.h ├── Node16_impl.h ├── Node256_impl.h ├── Node48_impl.h ├── Node4_impl.h ├── Node_impl.h ├── README.md ├── Tree.cpp └── Tree.h ├── annoy ├── LICENSE ├── annoylib.h ├── kissrandom.h └── mman.h ├── capnproto ├── .gitignore ├── .travis.yml ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── RELEASE-PROCESS.md ├── appveyor.yml ├── c++ │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── Makefile.am │ ├── Makefile.ekam │ ├── README.txt │ ├── afl-fuzz.sh │ ├── capnp-json.pc.in │ ├── capnp-rpc.pc.in │ ├── capnp.pc.in │ ├── cmake │ │ ├── CapnProtoConfig.cmake.in │ │ ├── CapnProtoMacros.cmake │ │ └── FindCapnProto.cmake │ ├── configure.ac │ ├── ekam-provider │ │ ├── c++header │ │ ├── canonical │ │ └── this-dir-is-to-trick-gdb.txt │ ├── kj-async.pc.in │ ├── kj.pc.in │ ├── m4 │ │ ├── acx_pthread.m4 │ │ └── ax_cxx_compile_stdcxx_11.m4 │ ├── regenerate-bootstraps.sh │ ├── samples │ │ ├── CMakeLists.txt │ │ ├── addressbook.c++ │ │ ├── addressbook.capnp │ │ ├── calculator-client.c++ │ │ ├── calculator-server.c++ │ │ ├── calculator.capnp │ │ └── test.sh │ ├── setup-autotools.sh │ ├── setup-ekam.sh │ └── src │ │ ├── CMakeLists.txt │ │ ├── benchmark │ │ ├── capnproto-carsales.c++ │ │ ├── capnproto-catrank.c++ │ │ ├── capnproto-common.h │ │ ├── capnproto-eval.c++ │ │ ├── carsales.capnp │ │ ├── carsales.proto │ │ ├── catrank.capnp │ │ ├── catrank.proto │ │ ├── common.h │ │ ├── eval.capnp │ │ ├── eval.proto │ │ ├── null-carsales.c++ │ │ ├── null-catrank.c++ │ │ ├── null-common.h │ │ ├── null-eval.c++ │ │ ├── protobuf-carsales.c++ │ │ ├── protobuf-catrank.c++ │ │ ├── protobuf-common.h │ │ ├── protobuf-eval.c++ │ │ └── runner.c++ │ │ ├── capnp │ │ ├── CMakeLists.txt │ │ ├── afl-testcase.c++ │ │ ├── any-test.c++ │ │ ├── any.c++ │ │ ├── any.h │ │ ├── arena.c++ │ │ ├── arena.h │ │ ├── blob-test.c++ │ │ ├── blob.c++ │ │ ├── blob.h │ │ ├── bootstrap-test.ekam-rule │ │ ├── c++.capnp │ │ ├── c++.capnp.c++ │ │ ├── c++.capnp.h │ │ ├── canonicalize-test.c++ │ │ ├── capability-test.c++ │ │ ├── capability.c++ │ │ ├── capability.h │ │ ├── capnpc.ekam-rule │ │ ├── common-test.c++ │ │ ├── common.h │ │ ├── compat │ │ │ ├── json-test.c++ │ │ │ ├── json.c++ │ │ │ ├── json.capnp │ │ │ ├── json.capnp.c++ │ │ │ ├── json.capnp.h │ │ │ └── json.h │ │ ├── compiler │ │ │ ├── capnp-test.ekam-rule │ │ │ ├── capnp-test.sh │ │ │ ├── capnp.c++ │ │ │ ├── capnp.ekam-manifest │ │ │ ├── capnpc-c++.c++ │ │ │ ├── capnpc-capnp.c++ │ │ │ ├── compiler.c++ │ │ │ ├── compiler.h │ │ │ ├── error-reporter.c++ │ │ │ ├── error-reporter.h │ │ │ ├── evolution-test.c++ │ │ │ ├── grammar.capnp │ │ │ ├── grammar.capnp.c++ │ │ │ ├── grammar.capnp.h │ │ │ ├── lexer-test.c++ │ │ │ ├── lexer.c++ │ │ │ ├── lexer.capnp │ │ │ ├── lexer.capnp.c++ │ │ │ ├── lexer.capnp.h │ │ │ ├── lexer.h │ │ │ ├── md5-test.c++ │ │ │ ├── md5.c++ │ │ │ ├── md5.h │ │ │ ├── module-loader.c++ │ │ │ ├── module-loader.h │ │ │ ├── node-translator.c++ │ │ │ ├── node-translator.h │ │ │ ├── parser.c++ │ │ │ └── parser.h │ │ ├── dynamic-capability.c++ │ │ ├── dynamic-test.c++ │ │ ├── dynamic.c++ │ │ ├── dynamic.h │ │ ├── encoding-test.c++ │ │ ├── endian-fallback-test.c++ │ │ ├── endian-reverse-test.c++ │ │ ├── endian-test.c++ │ │ ├── endian.h │ │ ├── ez-rpc-test.c++ │ │ ├── ez-rpc.c++ │ │ ├── ez-rpc.h │ │ ├── fuzz-test.c++ │ │ ├── generated-header-support.h │ │ ├── layout-test.c++ │ │ ├── layout.c++ │ │ ├── layout.h │ │ ├── list.c++ │ │ ├── list.h │ │ ├── membrane-test.c++ │ │ ├── membrane.c++ │ │ ├── membrane.h │ │ ├── message-test.c++ │ │ ├── message.c++ │ │ ├── message.h │ │ ├── orphan-test.c++ │ │ ├── orphan.h │ │ ├── persistent.capnp │ │ ├── persistent.capnp.c++ │ │ ├── persistent.capnp.h │ │ ├── pointer-helpers.h │ │ ├── pretty-print.h │ │ ├── raw-schema.h │ │ ├── rpc-prelude.h │ │ ├── rpc-test.c++ │ │ ├── rpc-twoparty-test.c++ │ │ ├── rpc-twoparty.c++ │ │ ├── rpc-twoparty.capnp │ │ ├── rpc-twoparty.capnp.c++ │ │ ├── rpc-twoparty.capnp.h │ │ ├── rpc-twoparty.h │ │ ├── rpc.c++ │ │ ├── rpc.capnp │ │ ├── rpc.capnp.c++ │ │ ├── rpc.capnp.h │ │ ├── rpc.h │ │ ├── schema-lite.h │ │ ├── schema-loader-test.c++ │ │ ├── schema-loader.c++ │ │ ├── schema-loader.h │ │ ├── schema-parser-test.c++ │ │ ├── schema-parser.c++ │ │ ├── schema-parser.h │ │ ├── schema-test.c++ │ │ ├── schema.c++ │ │ ├── schema.capnp │ │ ├── schema.capnp.c++ │ │ ├── schema.capnp.h │ │ ├── schema.h │ │ ├── serialize-async-test.c++ │ │ ├── serialize-async.c++ │ │ ├── serialize-async.h │ │ ├── serialize-packed-test.c++ │ │ ├── serialize-packed.c++ │ │ ├── serialize-packed.h │ │ ├── serialize-test.c++ │ │ ├── serialize-text-test.c++ │ │ ├── serialize-text.c++ │ │ ├── serialize-text.h │ │ ├── serialize.c++ │ │ ├── serialize.h │ │ ├── stringify-test.c++ │ │ ├── stringify.c++ │ │ ├── test-import.capnp │ │ ├── test-import2.capnp │ │ ├── test-util.c++ │ │ ├── test-util.h │ │ ├── test.capnp │ │ └── testdata │ │ │ ├── binary │ │ │ ├── errors.capnp.nobuild │ │ │ ├── errors.txt │ │ │ ├── flat │ │ │ ├── lists.binary │ │ │ ├── packed │ │ │ ├── packedflat │ │ │ ├── pretty.txt │ │ │ ├── segmented │ │ │ ├── segmented-packed │ │ │ └── short.txt │ │ └── kj │ │ ├── CMakeLists.txt │ │ ├── arena-test.c++ │ │ ├── arena.c++ │ │ ├── arena.h │ │ ├── array-test.c++ │ │ ├── array.c++ │ │ ├── array.h │ │ ├── async-inl.h │ │ ├── async-io-test.c++ │ │ ├── async-io-unix.c++ │ │ ├── async-io-win32.c++ │ │ ├── async-io.c++ │ │ ├── async-io.h │ │ ├── async-prelude.h │ │ ├── async-test.c++ │ │ ├── async-unix-test.c++ │ │ ├── async-unix.c++ │ │ ├── async-unix.h │ │ ├── async-win32-test.c++ │ │ ├── async-win32.c++ │ │ ├── async-win32.h │ │ ├── async.c++ │ │ ├── async.h │ │ ├── common-test.c++ │ │ ├── common.c++ │ │ ├── common.h │ │ ├── compat │ │ ├── gtest.h │ │ ├── http-test.c++ │ │ ├── http.c++ │ │ └── http.h │ │ ├── debug-test.c++ │ │ ├── debug.c++ │ │ ├── debug.h │ │ ├── exception-test.c++ │ │ ├── exception.c++ │ │ ├── exception.h │ │ ├── function-test.c++ │ │ ├── function.h │ │ ├── io-test.c++ │ │ ├── io.c++ │ │ ├── io.h │ │ ├── main.c++ │ │ ├── main.h │ │ ├── memory-test.c++ │ │ ├── memory.c++ │ │ ├── memory.h │ │ ├── miniposix.h │ │ ├── mutex-test.c++ │ │ ├── mutex.c++ │ │ ├── mutex.h │ │ ├── one-of-test.c++ │ │ ├── one-of.h │ │ ├── parse │ │ ├── char-test.c++ │ │ ├── char.c++ │ │ ├── char.h │ │ ├── common-test.c++ │ │ └── common.h │ │ ├── refcount-test.c++ │ │ ├── refcount.c++ │ │ ├── refcount.h │ │ ├── std │ │ ├── iostream-test.c++ │ │ └── iostream.h │ │ ├── string-test.c++ │ │ ├── string-tree-test.c++ │ │ ├── string-tree.c++ │ │ ├── string-tree.h │ │ ├── string.c++ │ │ ├── string.h │ │ ├── test-helpers.c++ │ │ ├── test-test.c++ │ │ ├── test.c++ │ │ ├── test.h │ │ ├── thread-test.c++ │ │ ├── thread.c++ │ │ ├── thread.h │ │ ├── threadlocal-pthread-test.c++ │ │ ├── threadlocal-test.c++ │ │ ├── threadlocal.h │ │ ├── time.c++ │ │ ├── time.h │ │ ├── tuple-test.c++ │ │ ├── tuple.h │ │ ├── units-test.c++ │ │ ├── units.c++ │ │ ├── units.h │ │ ├── vector.h │ │ └── windows-sanity.h ├── doc │ ├── README.md │ ├── _config.yml │ ├── _config_next.yml │ ├── _includes │ │ ├── buttons.html │ │ ├── footer.html │ │ └── header.html │ ├── _layouts │ │ ├── page.html │ │ ├── post.html │ │ └── slides.html │ ├── _plugins │ │ └── capnp_lexer.py │ ├── _posts │ │ ├── 2013-04-01-announcing-capn-proto.md │ │ ├── 2013-06-27-capn-proto-beta-release.md │ │ ├── 2013-08-12-capnproto-0.2-no-more-haskell.md │ │ ├── 2013-08-19-capnproto-0.2.1.md │ │ ├── 2013-09-04-capnproto-0.3-python-tools-features.md │ │ ├── 2013-12-12-capnproto-0.4-time-travel.md │ │ ├── 2013-12-13-promise-pipelining-capnproto-vs-ice.md │ │ ├── 2014-03-11-capnproto-0.4.1-bugfixes.md │ │ ├── 2014-06-17-capnproto-flatbuffers-sbe.md │ │ ├── 2014-12-15-capnproto-0.5-generics-msvc-java-csharp.md │ │ ├── 2015-01-23-capnproto-0.5.1-bugfixes.md │ │ ├── 2015-03-02-security-advisory-and-integer-overflow-protection.md │ │ ├── 2015-03-05-another-cpu-amplification.md │ │ └── 2017-05-01-capnproto-0.6-msvc-json-http-more.md │ ├── capnp-tool.md │ ├── cxx.md │ ├── cxxrpc.md │ ├── encoding.md │ ├── faq.md │ ├── feed.xml │ ├── images │ │ ├── bg_hr.png │ │ ├── blacktocat.png │ │ ├── capnp-vs-ice.png │ │ ├── capnp-vs-thrift-vs-ice.png │ │ ├── gittip.png │ │ ├── gittip15.png │ │ ├── groups-logo.png │ │ ├── icon_download.png │ │ ├── infinitely_faster.png │ │ ├── infinity-times-faster.png │ │ ├── logo.png │ │ ├── sprite_download.png │ │ ├── time-travel.png │ │ └── twitter.svg │ ├── index.md │ ├── install.md │ ├── javascripts │ │ └── main.js │ ├── language.md │ ├── news │ │ └── index.html │ ├── otherlang.md │ ├── push-site.sh │ ├── roadmap.md │ ├── rpc.md │ ├── slides-2017.05.18 │ │ ├── 3ph-0rt.png │ │ ├── 3ph-proxy.png │ │ ├── 3ph-redirect.png │ │ ├── 3ph.png │ │ └── index.md │ └── stylesheets │ │ ├── pygment_trac.css │ │ └── stylesheet.css ├── highlighting │ ├── emacs │ │ ├── README.md │ │ └── capnp-mode.el │ └── qtcreator │ │ └── capnp.xml ├── mega-test-kenton-home.cfg ├── mega-test-kenton-work.cfg ├── mega-test-quick.cfg ├── mega-test.py ├── release.sh ├── security-advisories │ ├── 2015-03-02-0-c++-integer-overflow.md │ ├── 2015-03-02-1-c++-integer-underflow.md │ ├── 2015-03-02-2-all-cpu-amplification.md │ ├── 2015-03-05-0-c++-addl-cpu-amplification.md │ ├── 2017-04-17-0-apple-clang-elides-bounds-check.md │ └── README.md ├── style-guide.md └── super-test.sh ├── concurrentqueue ├── LICENSE.md ├── README.md ├── blockingconcurrentqueue.h └── concurrentqueue.h ├── date ├── README.md ├── chrono_io.h ├── date.h ├── ios.h ├── ios.mm ├── islamic.h ├── iso_week.h └── julian.h ├── eclipse ├── cxx_header_template.xml ├── cxx_source_template.xml └── eclipse-cpp-google-style.xml ├── gmock ├── gmock-gtest-all.cc ├── gmock │ └── gmock.h ├── gmock_main.cc └── gtest │ └── gtest.h ├── iwyu └── iwyu_tool.py ├── jsoncpp ├── jsoncpp-forwards.h ├── jsoncpp.cpp └── jsoncpp.h ├── libcount ├── empirical_data.cc ├── empirical_data.h ├── hll.cc ├── hll.h ├── hll_data.cc ├── hll_data.h ├── hll_limits.h ├── utility.cc └── utility.h ├── libcuckoo ├── city_hasher.hh ├── cuckoohash_config.hh ├── cuckoohash_map.hh ├── cuckoohash_util.hh ├── default_hasher.hh └── lazy_array.hh ├── libpg_query ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README.md ├── examples │ ├── normalize.c │ ├── normalize_error.c │ ├── simple.c │ ├── simple_error.c │ └── simple_plpgsql.c ├── nodes.h ├── patches │ ├── 01_parse_replacement_char.patch │ └── 02_normalize_alter_role_password.patch ├── pg_list.h ├── pg_query.h ├── scripts │ ├── extract_headers.rb │ ├── extract_source.rb │ ├── generate_fingerprint_outfuncs.rb │ ├── generate_fingerprint_tests.rb │ └── generate_json_outfuncs.rb ├── src │ ├── pg_query.c │ ├── pg_query_fingerprint.c │ ├── pg_query_fingerprint.h │ ├── pg_query_fingerprint_conds.c │ ├── pg_query_fingerprint_defs.c │ ├── pg_query_internal.h │ ├── pg_query_json.c │ ├── pg_query_json.h │ ├── pg_query_json_conds.c │ ├── pg_query_json_defs.c │ ├── pg_query_json_helper.c │ ├── pg_query_json_plpgsql.c │ ├── pg_query_json_plpgsql.h │ ├── pg_query_normalize.c │ ├── pg_query_parse.c │ ├── pg_query_parse_plpgsql.c │ └── postgres │ │ ├── contrib_pgcrypto_sha1.c │ │ ├── gram.y │ │ ├── guc-file.c │ │ ├── include │ │ ├── access │ │ │ ├── attnum.h │ │ │ ├── commit_ts.h │ │ │ ├── genam.h │ │ │ ├── gin.h │ │ │ ├── hash.h │ │ │ ├── heapam.h │ │ │ ├── htup.h │ │ │ ├── htup_details.h │ │ │ ├── itup.h │ │ │ ├── parallel.h │ │ │ ├── printtup.h │ │ │ ├── rmgr.h │ │ │ ├── rmgrlist.h │ │ │ ├── sdir.h │ │ │ ├── skey.h │ │ │ ├── stratnum.h │ │ │ ├── sysattr.h │ │ │ ├── transam.h │ │ │ ├── tupdesc.h │ │ │ ├── tupmacs.h │ │ │ ├── twophase.h │ │ │ ├── xact.h │ │ │ ├── xlog.h │ │ │ ├── xlogdefs.h │ │ │ ├── xloginsert.h │ │ │ ├── xlogreader.h │ │ │ └── xlogrecord.h │ │ ├── bootstrap │ │ │ └── bootstrap.h │ │ ├── c.h │ │ ├── catalog │ │ │ ├── dependency.h │ │ │ ├── genbki.h │ │ │ ├── index.h │ │ │ ├── indexing.h │ │ │ ├── namespace.h │ │ │ ├── objectaccess.h │ │ │ ├── objectaddress.h │ │ │ ├── pg_aggregate.h │ │ │ ├── pg_am.h │ │ │ ├── pg_attribute.h │ │ │ ├── pg_authid.h │ │ │ ├── pg_class.h │ │ │ ├── pg_collation.h │ │ │ ├── pg_constraint.h │ │ │ ├── pg_control.h │ │ │ ├── pg_conversion.h │ │ │ ├── pg_conversion_fn.h │ │ │ ├── pg_depend.h │ │ │ ├── pg_event_trigger.h │ │ │ ├── pg_index.h │ │ │ ├── pg_language.h │ │ │ ├── pg_namespace.h │ │ │ ├── pg_opclass.h │ │ │ ├── pg_operator.h │ │ │ ├── pg_opfamily.h │ │ │ ├── pg_proc.h │ │ │ ├── pg_proc_fn.h │ │ │ ├── pg_replication_origin.h │ │ │ ├── pg_statistic.h │ │ │ ├── pg_transform.h │ │ │ ├── pg_trigger.h │ │ │ ├── pg_ts_config.h │ │ │ ├── pg_ts_dict.h │ │ │ ├── pg_ts_parser.h │ │ │ ├── pg_ts_template.h │ │ │ └── pg_type.h │ │ ├── commands │ │ │ ├── async.h │ │ │ ├── dbcommands.h │ │ │ ├── defrem.h │ │ │ ├── event_trigger.h │ │ │ ├── explain.h │ │ │ ├── prepare.h │ │ │ ├── tablespace.h │ │ │ ├── trigger.h │ │ │ ├── vacuum.h │ │ │ └── variable.h │ │ ├── common │ │ │ └── relpath.h │ │ ├── datatype │ │ │ └── timestamp.h │ │ ├── executor │ │ │ ├── execdesc.h │ │ │ ├── executor.h │ │ │ ├── functions.h │ │ │ ├── instrument.h │ │ │ ├── spi.h │ │ │ └── tuptable.h │ │ ├── fmgr.h │ │ ├── funcapi.h │ │ ├── getaddrinfo.h │ │ ├── lib │ │ │ ├── ilist.h │ │ │ ├── pairingheap.h │ │ │ └── stringinfo.h │ │ ├── libpq │ │ │ ├── auth.h │ │ │ ├── be-fsstubs.h │ │ │ ├── hba.h │ │ │ ├── ip.h │ │ │ ├── libpq-be.h │ │ │ ├── libpq.h │ │ │ ├── pqcomm.h │ │ │ ├── pqformat.h │ │ │ └── pqsignal.h │ │ ├── mb │ │ │ └── pg_wchar.h │ │ ├── miscadmin.h │ │ ├── nodes │ │ │ ├── bitmapset.h │ │ │ ├── execnodes.h │ │ │ ├── lockoptions.h │ │ │ ├── makefuncs.h │ │ │ ├── memnodes.h │ │ │ ├── nodeFuncs.h │ │ │ ├── nodes.h │ │ │ ├── params.h │ │ │ ├── parsenodes.h │ │ │ ├── pg_list.h │ │ │ ├── plannodes.h │ │ │ ├── primnodes.h │ │ │ ├── print.h │ │ │ ├── relation.h │ │ │ ├── tidbitmap.h │ │ │ └── value.h │ │ ├── optimizer │ │ │ ├── cost.h │ │ │ ├── geqo.h │ │ │ ├── geqo_gene.h │ │ │ ├── paths.h │ │ │ ├── planmain.h │ │ │ ├── planner.h │ │ │ ├── tlist.h │ │ │ └── var.h │ │ ├── parser │ │ │ ├── analyze.h │ │ │ ├── gram.h │ │ │ ├── gramparse.h │ │ │ ├── keywords.h │ │ │ ├── kwlist.h │ │ │ ├── parse_agg.h │ │ │ ├── parse_clause.h │ │ │ ├── parse_coerce.h │ │ │ ├── parse_collate.h │ │ │ ├── parse_expr.h │ │ │ ├── parse_func.h │ │ │ ├── parse_node.h │ │ │ ├── parse_oper.h │ │ │ ├── parse_relation.h │ │ │ ├── parse_target.h │ │ │ ├── parse_type.h │ │ │ ├── parser.h │ │ │ ├── parsetree.h │ │ │ ├── scanner.h │ │ │ └── scansup.h │ │ ├── pg_config.h │ │ ├── pg_config_ext.h │ │ ├── pg_config_manual.h │ │ ├── pg_config_os.h │ │ ├── pg_getopt.h │ │ ├── pg_trace.h │ │ ├── pgstat.h │ │ ├── pgtime.h │ │ ├── pl_gram.h │ │ ├── plerrcodes.h │ │ ├── plpgsql.h │ │ ├── port.h │ │ ├── port │ │ │ ├── atomics.h │ │ │ ├── atomics │ │ │ │ ├── arch-x86.h │ │ │ │ ├── fallback.h │ │ │ │ ├── generic-gcc.h │ │ │ │ └── generic.h │ │ │ └── pg_crc32c.h │ │ ├── portability │ │ │ └── instr_time.h │ │ ├── postgres.h │ │ ├── postgres_ext.h │ │ ├── postmaster │ │ │ ├── autovacuum.h │ │ │ ├── bgworker.h │ │ │ ├── bgworker_internals.h │ │ │ ├── bgwriter.h │ │ │ ├── fork_process.h │ │ │ ├── pgarch.h │ │ │ ├── postmaster.h │ │ │ ├── syslogger.h │ │ │ └── walwriter.h │ │ ├── regex │ │ │ └── regex.h │ │ ├── replication │ │ │ ├── origin.h │ │ │ ├── slot.h │ │ │ ├── syncrep.h │ │ │ ├── walreceiver.h │ │ │ └── walsender.h │ │ ├── rewrite │ │ │ ├── prs2lock.h │ │ │ ├── rewriteHandler.h │ │ │ ├── rewriteManip.h │ │ │ └── rewriteSupport.h │ │ ├── sha1.h │ │ ├── storage │ │ │ ├── backendid.h │ │ │ ├── barrier.h │ │ │ ├── block.h │ │ │ ├── buf.h │ │ │ ├── bufmgr.h │ │ │ ├── bufpage.h │ │ │ ├── dsm.h │ │ │ ├── dsm_impl.h │ │ │ ├── fd.h │ │ │ ├── ipc.h │ │ │ ├── item.h │ │ │ ├── itemid.h │ │ │ ├── itemptr.h │ │ │ ├── latch.h │ │ │ ├── lmgr.h │ │ │ ├── lock.h │ │ │ ├── lwlock.h │ │ │ ├── off.h │ │ │ ├── pg_sema.h │ │ │ ├── pg_shmem.h │ │ │ ├── pmsignal.h │ │ │ ├── predicate.h │ │ │ ├── proc.h │ │ │ ├── procsignal.h │ │ │ ├── relfilenode.h │ │ │ ├── s_lock.h │ │ │ ├── shm_mq.h │ │ │ ├── shm_toc.h │ │ │ ├── shmem.h │ │ │ ├── sinval.h │ │ │ ├── spin.h │ │ │ └── standby.h │ │ ├── tcop │ │ │ ├── deparse_utility.h │ │ │ ├── dest.h │ │ │ ├── fastpath.h │ │ │ ├── pquery.h │ │ │ ├── tcopprot.h │ │ │ └── utility.h │ │ ├── tsearch │ │ │ └── ts_cache.h │ │ └── utils │ │ │ ├── acl.h │ │ │ ├── aclchk_internal.h │ │ │ ├── array.h │ │ │ ├── builtins.h │ │ │ ├── bytea.h │ │ │ ├── catcache.h │ │ │ ├── date.h │ │ │ ├── datetime.h │ │ │ ├── datum.h │ │ │ ├── dynamic_loader.h │ │ │ ├── elog.h │ │ │ ├── errcodes.h │ │ │ ├── expandeddatum.h │ │ │ ├── fmgroids.h │ │ │ ├── guc.h │ │ │ ├── guc_tables.h │ │ │ ├── hsearch.h │ │ │ ├── int8.h │ │ │ ├── inval.h │ │ │ ├── lsyscache.h │ │ │ ├── memdebug.h │ │ │ ├── memutils.h │ │ │ ├── numeric.h │ │ │ ├── palloc.h │ │ │ ├── pg_locale.h │ │ │ ├── plancache.h │ │ │ ├── portal.h │ │ │ ├── probes.h │ │ │ ├── ps_status.h │ │ │ ├── rel.h │ │ │ ├── relcache.h │ │ │ ├── reltrigger.h │ │ │ ├── resowner.h │ │ │ ├── rls.h │ │ │ ├── ruleutils.h │ │ │ ├── snapmgr.h │ │ │ ├── snapshot.h │ │ │ ├── sortsupport.h │ │ │ ├── syscache.h │ │ │ ├── timeout.h │ │ │ ├── timestamp.h │ │ │ ├── tqual.h │ │ │ ├── tuplesort.h │ │ │ ├── tuplestore.h │ │ │ ├── typcache.h │ │ │ ├── tzparser.h │ │ │ └── xml.h │ │ ├── scan.c │ │ ├── src_backend_catalog_namespace.c │ │ ├── src_backend_catalog_pg_proc.c │ │ ├── src_backend_commands_define.c │ │ ├── src_backend_lib_stringinfo.c │ │ ├── src_backend_libpq_pqcomm.c │ │ ├── src_backend_nodes_bitmapset.c │ │ ├── src_backend_nodes_copyfuncs.c │ │ ├── src_backend_nodes_equalfuncs.c │ │ ├── src_backend_nodes_list.c │ │ ├── src_backend_nodes_makefuncs.c │ │ ├── src_backend_nodes_nodeFuncs.c │ │ ├── src_backend_nodes_value.c │ │ ├── src_backend_parser_gram.c │ │ ├── src_backend_parser_keywords.c │ │ ├── src_backend_parser_kwlookup.c │ │ ├── src_backend_parser_parse_expr.c │ │ ├── src_backend_parser_parser.c │ │ ├── src_backend_parser_scansup.c │ │ ├── src_backend_postmaster_postmaster.c │ │ ├── src_backend_storage_ipc_ipc.c │ │ ├── src_backend_tcop_postgres.c │ │ ├── src_backend_utils_adt_datum.c │ │ ├── src_backend_utils_adt_expandeddatum.c │ │ ├── src_backend_utils_adt_format_type.c │ │ ├── src_backend_utils_adt_ruleutils.c │ │ ├── src_backend_utils_error_assert.c │ │ ├── src_backend_utils_error_elog.c │ │ ├── src_backend_utils_init_globals.c │ │ ├── src_backend_utils_mb_encnames.c │ │ ├── src_backend_utils_mb_mbutils.c │ │ ├── src_backend_utils_mb_wchar.c │ │ ├── src_backend_utils_misc_guc.c │ │ ├── src_backend_utils_mmgr_aset.c │ │ ├── src_backend_utils_mmgr_mcxt.c │ │ ├── src_common_psprintf.c │ │ ├── src_pl_plpgsql_src_pl_comp.c │ │ ├── src_pl_plpgsql_src_pl_funcs.c │ │ ├── src_pl_plpgsql_src_pl_gram.c │ │ ├── src_pl_plpgsql_src_pl_handler.c │ │ ├── src_pl_plpgsql_src_pl_scanner.c │ │ └── src_port_qsort.c ├── srcdata │ ├── all_known_enums.json │ ├── enum_defs.json │ ├── nodetypes.json │ ├── struct_defs.json │ └── typedefs.json ├── test │ ├── complex.c │ ├── concurrency.c │ ├── fingerprint.c │ ├── fingerprint_tests.c │ ├── normalize.c │ ├── normalize_tests.c │ ├── parse.c │ ├── parse_plpgsql.c │ ├── parse_tests.c │ ├── plpgsql_samples.expected.json │ └── plpgsql_samples.sql └── testdata │ └── fingerprint.json ├── murmur3 ├── MurmurHash3.cpp └── MurmurHash3.h ├── rapidjson ├── document.h ├── filestream.h ├── internal │ ├── pow10.h │ ├── stack.h │ └── strfunc.h ├── prettywriter.h ├── rapidjson.h ├── reader.h ├── stringbuffer.h └── writer.h ├── stx ├── btree ├── btree.dox ├── btree.h ├── btree_map ├── btree_map.h ├── btree_multimap ├── btree_multimap.h ├── btree_multiset ├── btree_multiset.h ├── btree_set └── btree_set.h ├── ttmath ├── COPYRIGHT ├── ttmath.h ├── ttmathbig.h ├── ttmathint.h ├── ttmathmisc.h ├── ttmathobjects.h ├── ttmathparser.h ├── ttmaththreads.h ├── ttmathtypes.h ├── ttmathuint.h ├── ttmathuint_noasm.h ├── ttmathuint_x86.h └── ttmathuint_x86_64.h ├── utf8.h ├── utf8 ├── checked.h ├── core.h └── unchecked.h └── valgrind └── valgrind.supp /.clang-format: -------------------------------------------------------------------------------- 1 | # Options for Clang Formatter 2 | 3 | # We'll use defaults from the Google style, 4 | BasedOnStyle: Google 5 | 6 | # 2 columns tab indentation. 7 | TabWidth: 2 8 | 9 | # No tabs 10 | UseTab: Never 11 | 12 | # Don't automatically derive the alignment of & and * 13 | DerivePointerAlignment: false 14 | 15 | # Always align pointer and reference to the right 16 | PointerAlignment: Right 17 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .vs 2 | .git 3 | build 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_style = space 9 | 10 | [Makefile] 11 | indent_style = tab 12 | 13 | [.travis.yml] 14 | indent_size = 4 15 | -------------------------------------------------------------------------------- /cmake/Modules/tsan.suppressions: -------------------------------------------------------------------------------- 1 | # ThreadSanitizer suppressions file for Couchbase 2 | # https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions 3 | 4 | # In forestdb plock_lock is invoked from a lock structure that is sure to not 5 | # overlap with that of another thread by use of is_overlapped() test. 6 | # However since this function is not trusted by ThreadSanitizer it reports 7 | # a lock inversion since the locks in the race are from the same struct definition 8 | # but different memory addresses. This is hence a false positive. 9 | deadlock:plock_lock 10 | -------------------------------------------------------------------------------- /cmake/Templates/PelotonConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Config file for the Peloton package. 2 | # 3 | # After successful configuration the following variables 4 | # will be defined: 5 | # 6 | # Peloton_INCLUDE_DIRS - Peloton include directories 7 | # Peloton_LIBRARIES - libraries to link against 8 | # Peloton_DEFINITIONS - a list of definitions to pass to compiler 9 | # 10 | 11 | # Compute paths 12 | get_filename_component(Peloton_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 13 | set(Peloton_INCLUDE_DIRS "@Peloton_INCLUDE_DIRS@") 14 | 15 | @Peloton_INSTALL_INCLUDE_DIR_APPEND_COMMAND@ 16 | 17 | # Our library dependencies 18 | if(NOT TARGET peloton AND NOT peloton_BINARY_DIR) 19 | include("${Peloton_CMAKE_DIR}/PelotonTargets.cmake") 20 | endif() 21 | 22 | # List of IMPORTED libs created by PelotonTargets.cmake 23 | set(Peloton_LIBRARIES peloton) 24 | 25 | # Definitions 26 | set(Peloton_DEFINITIONS "@Peloton_DEFINITIONS@") 27 | -------------------------------------------------------------------------------- /cmake/Templates/PelotonConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@Peloton_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /cmake/Templates/peloton_config.h.in: -------------------------------------------------------------------------------- 1 | /* Sources directory */ 2 | #define SOURCE_FOLDER "${PROJECT_SOURCE_DIR}" 3 | 4 | /* Binaries directory */ 5 | #define BINARY_FOLDER "${PROJECT_BINARY_DIR}" 6 | 7 | #define DATA_DIR "${DATA_DIR}/" 8 | 9 | /* Temporary (TODO: remove) */ 10 | #if 1 11 | #define CMAKE_SOURCE_DIR SOURCE_FOLDER "/src/" 12 | #define EXAMPLES_SOURCE_DIR BINARY_FOLDER "/examples/" 13 | #define CMAKE_EXT ".gen.cmake" 14 | #else 15 | #define CMAKE_SOURCE_DIR "src/" 16 | #define EXAMPLES_SOURCE_DIR "examples/" 17 | #define CMAKE_EXT "" 18 | #endif 19 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | Placeholder for actual design doc process 2 | -------------------------------------------------------------------------------- /doc/template.md: -------------------------------------------------------------------------------- 1 | # Component Name 2 | 3 | ## Overview 4 | 5 | >What motivates this to be implemented? What will this component achieve? 6 | 7 | ## Scope 8 | >Which parts of the system will this feature rely on or modify? Write down specifics so people involved can review the design doc 9 | 10 | ## Glossary (Optional) 11 | 12 | >If you are introducing new concepts or giving unintuitive names to components, write them down here. 13 | 14 | ## Architectural Design 15 | >Explain the input and output of the component, describe interactions and breakdown the smaller components if any. Include diagrams if appropriate. 16 | 17 | ## Design Rationale 18 | >Explain the goals of this design and how the design achieves these goals. Present alternatives considered and document why they are not chosen. 19 | 20 | ## Testing Plan 21 | >How should the component be tested? 22 | 23 | ## Trade-offs and Potential Problems 24 | >Write down any conscious trade-off you made that can be problematic in the future, or any problems discovered during the design process that remain unaddressed (technical debts). 25 | 26 | ## Future Work 27 | >Write down future work to fix known problems or otherwise improve the component. 28 | 29 | -------------------------------------------------------------------------------- /script/demo/README.md: -------------------------------------------------------------------------------- 1 | ## Terminal 1 2 | ``` sh 3 | cd /home/pavlo/Documents/Peloton/Github/peloton 4 | script -f /tmp/peloton.log 5 | ssh dev4 "$(pwd)/build/bin/peloton --index_tuner" 6 | ``` 7 | ## Terminal 2 8 | ``` sh 9 | cd /home/pavlo/Documents/OLTPBenchmark/oltpbench 10 | ssh ottertune "cd $(pwd) && ant build execute -Dbenchmark=tpcc -Dconfig=config/tpcc_config_peloton.xml -Dcreate=true -Dload=true -Dexecute=false" 11 | ``` 12 | ## Terminal 3 13 | ``` sh 14 | cd /home/pavlo/Documents/Peloton/Github/peloton/script/demo 15 | ssh dev4 "cd $(pwd) && ./init-demo.sh" 16 | ssh dev4 "cd $(pwd) && ./start-demo.sh" 17 | ./throughput-demo.py 18 | ``` 19 | -------------------------------------------------------------------------------- /script/demo/add-index.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TABLE=$1 4 | NAME=$2 5 | TYPE=$3 6 | KEYS=$4 7 | 8 | echo "insert into information_schema_indexes VALUES ('$TABLE', '$NAME', '$TYPE', '$KEYS');" | psql "sslmode=disable" -U postgres -h localhost -p 15721 9 | -------------------------------------------------------------------------------- /script/demo/init-demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "create table information_schema_indexes (table_name VARCHAR(32) PRIMARY KEY, index_name VARCHAR(32) PRIMARY KEY, index_type VARCHAR(32), index_keys VARCHAR(64));" | psql "sslmode=disable" -U postgres -h localhost -p 15721 &> /dev/null 4 | -------------------------------------------------------------------------------- /script/demo/start-demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "load stats from '/home/pavlo/samples.txt';" | psql "sslmode=disable" -U postgres -h localhost -p 15721 4 | -------------------------------------------------------------------------------- /script/docker/centos7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD . /peloton 4 | # preliminary steps to allow packages.sh to run 5 | RUN yum -q -y install sudo wget 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN mkdir /peloton/build && cd /peloton/build && cmake3 -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 10 | 11 | ENV PATH=$(BUILD_DIR)/bin:$PATH 12 | ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH 13 | 14 | EXPOSE 15721 15 | 16 | ENTRYPOINT ["./peloton/build/bin/peloton"] 17 | -------------------------------------------------------------------------------- /script/docker/centos7/Dockerfile-jenkins: -------------------------------------------------------------------------------- 1 | # Dockerfile specifically for build testing from Jenkins 2 | FROM centos:7 3 | 4 | ADD . /peloton 5 | RUN yum -q -y install sudo wget clang 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN echo -n "Peloton Debug build with "; g++ --version | head -1 10 | RUN mkdir /peloton/build && cd /peloton/build && cmake3 -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install 11 | 12 | RUN echo -n "Peloton Release build with "; g++ --version | head -1 13 | RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && cmake3 -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 14 | 15 | RUN echo -n "Peloton Debug build with "; clang++ --version | head -1 16 | RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake3 -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install 17 | 18 | RUN echo -n "Peloton Release build with "; clang++ --version | head -1 19 | RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake3 -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 20 | -------------------------------------------------------------------------------- /script/docker/debian-stretch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch 2 | 3 | ADD . /peloton 4 | # preliminary steps to allow packages.sh to run 5 | RUN apt-get -qq update && apt-get -qq -y --no-install-recommends install python-dev lsb-release sudo software-properties-common && apt-get -qq clean 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && cd /peloton/build && make -j4 && make install 10 | 11 | ENV PATH=$(BUILD_DIR)/bin:$PATH 12 | ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH 13 | 14 | EXPOSE 15721 15 | 16 | ENTRYPOINT ["./peloton/build/bin/peloton"] 17 | -------------------------------------------------------------------------------- /script/docker/fedora26/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fedora:26 2 | 3 | ADD . /peloton 4 | # preliminary steps to allow packages.sh to run 5 | RUN dnf -q -y install sudo 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 10 | 11 | ENV PATH=$(BUILD_DIR)/bin:$PATH 12 | ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH 13 | 14 | EXPOSE 15721 15 | 16 | ENTRYPOINT ["./peloton/build/bin/peloton"] 17 | -------------------------------------------------------------------------------- /script/docker/fedora26/Dockerfile-jenkins: -------------------------------------------------------------------------------- 1 | # Dockerfile specifically for build testing from Jenkins 2 | FROM fedora:26 3 | 4 | ADD . /peloton 5 | RUN dnf -q -y install sudo clang 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN echo -n "Peloton Debug build with "; g++ --version | head -1 10 | RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install 11 | 12 | RUN echo -n "Peloton Release build with "; g++ --version | head -1 13 | RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 14 | 15 | RUN echo -n "Peloton Debug build with "; clang++ --version | head -1 16 | RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install 17 | 18 | RUN echo -n "Peloton Release build with "; clang++ --version | head -1 19 | RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 20 | -------------------------------------------------------------------------------- /script/docker/fedora27/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fedora:27 2 | 3 | ADD . /peloton 4 | # preliminary steps to allow packages.sh to run 5 | RUN dnf -q -y install sudo 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN mkdir /peloton/build && cd /peloton/build && PATH=/usr/lib64/llvm4.0/bin:$PATH cmake -DCMAKE_CXX_FLAGS="-isystem /usr/include/llvm4.0" -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 10 | 11 | ENV PATH=$(BUILD_DIR)/bin:$PATH 12 | ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH 13 | 14 | EXPOSE 15721 15 | 16 | ENTRYPOINT ["./peloton/build/bin/peloton"] 17 | -------------------------------------------------------------------------------- /script/docker/ubuntu-trusty/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | 3 | ADD . /peloton 4 | # preliminary steps to allow packages.sh to run 5 | RUN apt-get -qq update && apt-get -qq -y --no-install-recommends install python-dev 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 10 | 11 | ENV PATH=$(BUILD_DIR)/bin:$PATH 12 | ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH 13 | 14 | EXPOSE 15721 15 | 16 | ENTRYPOINT ["./peloton/build/bin/peloton"] 17 | -------------------------------------------------------------------------------- /script/docker/ubuntu-xenial/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:xenial 2 | 3 | ADD . /peloton 4 | # preliminary steps to allow packages.sh to run 5 | RUN apt-get -qq update && apt-get -qq -y --no-install-recommends install python-dev lsb-release sudo 6 | 7 | RUN /bin/bash -c "source ./peloton/script/installation/packages.sh" 8 | 9 | RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install 10 | 11 | ENV PATH=$(BUILD_DIR)/bin:$PATH 12 | ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH 13 | 14 | EXPOSE 15721 15 | 16 | ENTRYPOINT ["./peloton/build/bin/peloton"] 17 | -------------------------------------------------------------------------------- /script/formatting/iwyu.md: -------------------------------------------------------------------------------- 1 | # Include-What-You-Use 2 | 3 | Need LLVM 4 | 5 | sudo apt-get install iwyu 6 | 7 | make -k CXX=/usr/bin/include-what-you-use -j4 > iwyu.txt 2>&1 8 | 9 | 10 | -------------------------------------------------------------------------------- /script/git-hooks/README.md: -------------------------------------------------------------------------------- 1 | # Git Hooks 2 | 3 | This directory contains all Git hooks used in Peloton. Git hooks provide 4 | a mechanism to execute custom scripts when important events occur during 5 | your interaction with this Git repository. More details on Git hooks can 6 | be found [here](https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks). 7 | 8 | ### Pre-commit 9 | 10 | A pre-commit hook is fired on every commit into your local Git 11 | repository. Peloton's pre-commit hook collects all modified files 12 | (excluding deleted files) and runs them through our source code 13 | validator script in `script/validator/source_validator.py`. *Ideally*, 14 | we should also ensure every commit successfully compiles and, to a 15 | lesser extent, that the commit passes the tests, but this isn't 16 | reasonable for now. 17 | 18 | **Installation:** Under the peloton root directory, run 19 | `ln -s ../../script/git-hooks/pre-commit .git/hooks/pre-commit` to 20 | install locally. The pre-commit file should already have executable 21 | permission, but check again to make sure. -------------------------------------------------------------------------------- /script/git-hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Source validation pre-commit hook 3 | # 4 | # This script collects all modified files and runs it through our source code 5 | # validation script. The validation script returns 0 on success and 1 on any 6 | # failure. 7 | # 8 | # To enable, symlink this file to '.git/hooks/pre-commit' like so: 9 | # ln -s ../../script/git-hooks/pre-commit .git/hooks/pre-commit 10 | 11 | FORMATTER_COMMAND="./script/formatting/formatter.py" 12 | 13 | FILES=$(git diff --name-only HEAD --cached --diff-filter=d | grep '\.\(cpp\|h\)$') 14 | if [ -n "$FILES" ]; then 15 | ./script/validators/source_validator.py --files $FILES 16 | RESULT=$? 17 | if [ $RESULT -ne 0 ]; then 18 | echo "***************************************" 19 | echo "******* Peloton Pre-Commit Hook *******" 20 | echo "***************************************" 21 | echo "Use \"$FORMATTER_PATH -c -f\" to format all staged files." 22 | echo "Or use \"git commit --no-verify\" to temporarily bypass the pre-commit hook." 23 | 24 | echo 25 | echo "Be aware that changed files have to be staged again!" 26 | echo "***************************************" 27 | fi 28 | exit $RESULT 29 | fi 30 | 31 | exit 0 32 | -------------------------------------------------------------------------------- /script/installation/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | -------------------------------------------------------------------------------- /script/oltpbenchmark/testbed/.gitignore: -------------------------------------------------------------------------------- 1 | outputfile* 2 | oltpbench 3 | *_config.xml 4 | -------------------------------------------------------------------------------- /script/oltpbenchmark/testbed/gather_tpcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | for d in `ls | grep tpcc_collected | sort -t '_' -k10,10 -g`; do 3 | b=`echo $d | cut -d'_' -f 10` 4 | echo -n "$b " 5 | done 6 | echo "" 7 | for d in `ls | grep tpcc_collected | sort -t '_' -k10,10 -g`; do 8 | #b=`echo $d | cut -d'-' -f 9` 9 | thrpt=`head -8 ${d}/*.res | tail -1 | cut -d ',' -f 2` 10 | echo -n "$thrpt " 11 | done 12 | echo "" 13 | -------------------------------------------------------------------------------- /script/oltpbenchmark/testbed/gather_ycsb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for ratio in "100_0_0_0" "0_0_100_0" "10_0_90_0"; do 4 | echo $ratio 5 | for d in `ls | grep ycsb_collected | grep $ratio | sort -t '_' -k9,9 -g`; do 6 | b=`echo $d | cut -d'_' -f 9` 7 | echo -n "$b " 8 | done 9 | echo "" 10 | for d in `ls | grep ycsb_collected | grep $ratio | sort -t '_' -k9,9 -g`; do 11 | #b=`echo $d | cut -d'-' -f 9` 12 | thrpt=`head -8 ${d}/*.res | tail -1 | cut -d ',' -f 2` 13 | echo -n "$thrpt " 14 | done 15 | echo "" 16 | done 17 | -------------------------------------------------------------------------------- /script/testing/ddl/tinyint.sql: -------------------------------------------------------------------------------- 1 | CREATE DOMAIN "tinyint" AS smallint; 2 | -------------------------------------------------------------------------------- /script/testing/ddl/ycsb-ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE USERTABLE ( 2 | YCSB_KEY INT NOT NULL, 3 | FIELD1 VARCHAR(100), 4 | FIELD2 VARCHAR(100), 5 | FIELD3 VARCHAR(100), 6 | FIELD4 VARCHAR(100), 7 | FIELD5 VARCHAR(100), 8 | FIELD6 VARCHAR(100), 9 | FIELD7 VARCHAR(100), 10 | FIELD8 VARCHAR(100), 11 | FIELD9 VARCHAR(100), 12 | FIELD10 VARCHAR(100), 13 | PRIMARY KEY (YCSB_KEY) 14 | ); 15 | 16 | -------------------------------------------------------------------------------- /script/testing/dml/basic.sql: -------------------------------------------------------------------------------- 1 | -- create the table and secondary index 2 | 3 | drop table if exists foo; 4 | create table foo(id1 integer, id2 integer, CONSTRAINT pk_foo PRIMARY KEY (id1, id2)); 5 | create index sk_foo on foo (id1); 6 | 7 | -- load in the data 8 | 9 | insert into foo values(1, 100); 10 | insert into foo values(1, 100); 11 | insert into foo values(1, 200); 12 | insert into foo values(1, 500); 13 | insert into foo values(1, 600); 14 | insert into foo values(2, 100); 15 | insert into foo values(2, 200); 16 | insert into foo values(2, 300); 17 | insert into foo values(3, 100); 18 | insert into foo values(3, 200); 19 | insert into foo values(4, 100); 20 | insert into foo values(4, 200); 21 | insert into foo values(4, 300); 22 | select * from foo; 23 | 24 | -- delete 25 | 26 | delete from foo where id2 = 200; 27 | select * from foo; 28 | 29 | -- update 30 | 31 | update foo set id2 = 500 where id2 = 100; 32 | select * from foo; 33 | 34 | update foo set id1 = 3 where id2 = 500; 35 | select * from foo; 36 | 37 | -------------------------------------------------------------------------------- /script/testing/dml/case_unaryminus_coalesce_nullif.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE CASE_TBL ( 2 | i integer, 3 | f double precision 4 | ); 5 | 6 | CREATE TABLE CASE2_TBL ( 7 | i integer, 8 | j integer 9 | ); 10 | 11 | INSERT INTO CASE_TBL VALUES (1, 10.1); 12 | INSERT INTO CASE_TBL VALUES (2, 20.2); 13 | INSERT INTO CASE_TBL VALUES (3, -30.3); 14 | INSERT INTO CASE_TBL VALUES (4, NULL); 15 | 16 | INSERT INTO CASE2_TBL VALUES (1, -1); 17 | INSERT INTO CASE2_TBL VALUES (2, -2); 18 | INSERT INTO CASE2_TBL VALUES (3, -3); 19 | INSERT INTO CASE2_TBL VALUES (2, -4); 20 | INSERT INTO CASE2_TBL VALUES (1, NULL); 21 | INSERT INTO CASE2_TBL VALUES (NULL, -6); 22 | 23 | 24 | SELECT CASE WHEN i=1 THEN 2 ELSE 3 END as t FROM CASE_TBL; 25 | 26 | SELECT i, CASE i WHEN 2 THEN 20 when 3 then 30 ELSE 40 END FROM CASE_TBL; 27 | 28 | UPDATE CASE_TBL 29 | SET i = CASE WHEN i >= 3 THEN (-i) 30 | ELSE (2 * i) END; 31 | 32 | SELECT i, -i, f, -f FROM CASE_TBL; 33 | 34 | select nullif(i,2) from case_tbl; 35 | 36 | SELECT * 37 | FROM CASE_TBL a, CASE2_TBL b 38 | WHERE COALESCE(f,b.i) = 2; 39 | 40 | -------------------------------------------------------------------------------- /script/testing/dml/multi_column_index.sql: -------------------------------------------------------------------------------- 1 | -- create the table and secondary index 2 | 3 | drop table if exists foo; 4 | create table foo(id1 integer, id2 integer, name text, PRIMARY KEY (name)); 5 | -- create index sk_foo on foo (id1, id2, name); 6 | 7 | -- load in the data 8 | 9 | insert into foo values(1, 100, '#1'); 10 | insert into foo values(2, 100, '#2'); 11 | insert into foo values(3, 200, '#3'); 12 | insert into foo values(4, 500, '#4'); 13 | insert into foo values(5, 600, '#5'); 14 | insert into foo values(6, 100, '#6'); 15 | insert into foo values(7, 200, '#7'); 16 | insert into foo values(8, 300, '#8'); 17 | insert into foo values(9, 100, '#9'); 18 | insert into foo values(10, 200, '#10'); 19 | insert into foo values(11, 100, '#11'); 20 | insert into foo values(12, 200, '#12'); 21 | insert into foo values(13, 300, '#13'); 22 | select * from foo; 23 | -------------------------------------------------------------------------------- /script/testing/dml/string_functions.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS foo; 2 | CREATE TABLE foo (id INT PRIMARY KEY, val VARCHAR(32) DEFAULT NULL); 3 | 4 | INSERT INTO foo VALUES (0, 'Cappadonna'); 5 | INSERT INTO foo VALUES (1, 'Ghostface Killah'); 6 | INSERT INTO foo VALUES (2, 'GZA'); 7 | INSERT INTO foo VALUES (3, 'Inspectah Deck'); 8 | INSERT INTO foo VALUES (4, 'Masta Killa'); 9 | INSERT INTO foo VALUES (5, 'Method Man'); 10 | INSERT INTO foo VALUES (6, 'Ol Dirty Bastard'); 11 | INSERT INTO foo VALUES (7, 'Raekwon'); 12 | INSERT INTO foo VALUES (8, 'RZA'); 13 | INSERT INTO foo VALUES (9, 'U-God'); 14 | INSERT INTO foo VALUES (10, NULL); 15 | 16 | SELECT COUNT(id) FROM foo; 17 | 18 | SELECT UPPER(val) FROM foo WHERE id = 0; 19 | SELECT UPPER(val) FROM foo WHERE val IS NULL; 20 | SELECT LOWER(val) FROM foo WHERE id = 1; 21 | SELECT LOWER(val) FROM foo WHERE val IS NULL; 22 | 23 | SELECT CONCAT(UPPER(val), LOWER(val)) FROM foo WHERE val IS NOT NULL; 24 | SELECT CONCAT(UPPER(val), LOWER(val)) FROM foo WHERE val IS NULL; -------------------------------------------------------------------------------- /script/testing/dml/update.sql: -------------------------------------------------------------------------------- 1 | -- create the table 2 | create table foo (a integer, b integer); 3 | 4 | -- load in the data 5 | insert into foo values (1, 200); 6 | insert into foo values (2, 150); 7 | insert into foo values (3, 400); 8 | 9 | -- update with WHERE 10 | update foo set b = 100 where a = 2; 11 | 12 | -- update without WHERE 13 | update foo set b = 100; 14 | -------------------------------------------------------------------------------- /script/testing/jdbc/.gitignore: -------------------------------------------------------------------------------- 1 | # Out 2 | out/ 3 | -------------------------------------------------------------------------------- /script/testing/jdbc/README.md: -------------------------------------------------------------------------------- 1 | ## Simple JDBC test for Peloton 2 | 3 | The java program here provides simple JDBC operation tests for Peloton 4 | database. 5 | 6 | To run the test: 7 | 1. Start peloton. Typically, locally, so hostname would be localhost 8 | and if default port would be 15721 9 | 10 | 2. Compile and run the test: 11 | test_jdbc.sh 12 | 13 | e.g. test_jdbc.sh PelotonBasicTest localhost 15721 14 | 15 | Where 'type' is one of: 16 | PelotonBasicTest 17 | PelotonErrorTest 18 | PelotonTypeTest 19 | StocklevelTest 20 | SSLTest 21 | 22 | The program performs the following tests: 23 | 24 | > 1. Drop testing table if exsits. 25 | > 2. Create testing table. 26 | > 3. Insert a bunch of tuple using prepared statement. 27 | > 3. Index scan using prepared statement. 28 | -------------------------------------------------------------------------------- /script/testing/jdbc/load_rootcrt_ssl.sh: -------------------------------------------------------------------------------- 1 | cd peloton/data/cert 2 | openssl x509 -in ca.cert.pem -inform pem -out ca.der -outform der 3 | keytool -v -printcert -file ca.der 4 | keytool -importcert -alias startssltmp -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file ca.der 5 | 6 | -------------------------------------------------------------------------------- /script/testing/jdbc/test_jdbc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | TARGET=$1 4 | DB_HOST=$2 5 | DB_PORT=$3 6 | 7 | JDBC_JAR="postgresql-9.4.1209.jre6.jar" 8 | 9 | if [ "$#" -ne 3 ]; then 10 | echo "Missing required arguments: $0 " 11 | exit 1 12 | fi 13 | 14 | mkdir -p lib 15 | mkdir -p out 16 | 17 | wget -nc -P lib https://jdbc.postgresql.org/download/${JDBC_JAR} 18 | 19 | javac -classpath ./lib/${JDBC_JAR} -d out src/*.java 20 | jar -cvf out.jar -C out . 21 | java -cp out.jar:./lib/${JDBC_JAR} ${TARGET} ${DB_HOST} ${DB_PORT} 22 | -------------------------------------------------------------------------------- /script/testing/join/nested_loop_join2.sql: -------------------------------------------------------------------------------- 1 | -- create the test tables 2 | SET ENABLE_MERGEJOIN TO FALSE; 3 | SET ENABLE_HASHJOIN TO FALSE; 4 | SET ENABLE_NESTLOOP TO TRUE; 5 | 6 | CREATE TABLE C(id INT, value INT); 7 | CREATE TABLE D(id INT, value INT); 8 | 9 | -- join with empty tables 10 | -- load in the data 11 | 12 | INSERT INTO C VALUES(100, 100); 13 | INSERT INTO C VALUES(101, 101); 14 | INSERT INTO C VALUES(102, 102); 15 | INSERT INTO C VALUES(103, 103); 16 | INSERT INTO C VALUES(104, 104); 17 | INSERT INTO C VALUES(105, 105); 18 | INSERT INTO C VALUES(106, 106); 19 | INSERT INTO C VALUES(107, 107); 20 | INSERT INTO C VALUES(108, 108); 21 | INSERT INTO C VALUES(109, 109); 22 | 23 | INSERT INTO D VALUES(120, 120); 24 | INSERT INTO D VALUES(121, 121); 25 | INSERT INTO D VALUES(122, 122); 26 | INSERT INTO D VALUES(123, 123); 27 | INSERT INTO D VALUES(124, 124); 28 | 29 | -- join with non empty tables 30 | 31 | -- load in some more data 32 | 33 | INSERT INTO D VALUES(125, 125); 34 | INSERT INTO D VALUES(126, 126); 35 | INSERT INTO C VALUES(104, 104); 36 | 37 | -- join with non empty tables 38 | -------------------------------------------------------------------------------- /script/testing/join/nested_loop_join3.sql: -------------------------------------------------------------------------------- 1 | -- create the test tables 2 | SET ENABLE_MERGEJOIN TO FALSE; 3 | SET ENABLE_HASHJOIN TO FALSE; 4 | SET ENABLE_NESTLOOP TO TRUE; 5 | 6 | CREATE TABLE E(id INT, value INT); 7 | CREATE TABLE F(id INT, value INT); 8 | 9 | -- join with empty tables 10 | -- load in the data 11 | 12 | INSERT INTO E VALUES(200, 200); 13 | INSERT INTO E VALUES(201, 201); 14 | INSERT INTO E VALUES(202, 202); 15 | INSERT INTO E VALUES(203, 203); 16 | INSERT INTO E VALUES(204, 204); 17 | INSERT INTO E VALUES(205, 205); 18 | INSERT INTO E VALUES(206, 206); 19 | INSERT INTO E VALUES(207, 207); 20 | INSERT INTO E VALUES(208, 208); 21 | INSERT INTO E VALUES(209, 209); 22 | 23 | INSERT INTO F VALUES(220, 220); 24 | INSERT INTO F VALUES(221, 221); 25 | INSERT INTO F VALUES(222, 222); 26 | INSERT INTO F VALUES(223, 223); 27 | INSERT INTO F VALUES(224, 224); 28 | 29 | -- join with non empty tables 30 | -- load in some more data 31 | 32 | INSERT INTO F VALUES(225, 225); 33 | INSERT INTO F VALUES(226, 226); 34 | INSERT INTO E VALUES(204, 204); 35 | 36 | -------------------------------------------------------------------------------- /script/testing/junit/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | !Makefile 3 | !lib/*.jar -------------------------------------------------------------------------------- /script/testing/junit/lib/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/script/testing/junit/lib/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /script/testing/junit/lib/junit-4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/script/testing/junit/lib/junit-4.12.jar -------------------------------------------------------------------------------- /script/testing/junit/lib/junit-platform-console-standalone-1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/script/testing/junit/lib/junit-platform-console-standalone-1.1.0.jar -------------------------------------------------------------------------------- /script/testing/junit/lib/postgresql-9.4.1209.jre6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/script/testing/junit/lib/postgresql-9.4.1209.jre6.jar -------------------------------------------------------------------------------- /script/testing/logging/create_table.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS A1; 2 | DROP TABLE IF EXISTS B1; 3 | 4 | CREATE TABLE A1(id INT, value INT); 5 | CREATE TABLE B1(id INT, value INT); 6 | 7 | -------------------------------------------------------------------------------- /script/testing/logging/logging_test.sh: -------------------------------------------------------------------------------- 1 | psql < create_table.sql 2 | psql < insert.sql & 3 | psql < insert.sql & 4 | psql < insert.sql & 5 | psql < insert.sql & 6 | psql < insert.sql & 7 | psql < insert.sql & 8 | psql < insert.sql & 9 | psql < insert.sql & 10 | psql < insert.sql & 11 | psql < insert.sql & 12 | psql < insert.sql & 13 | psql < insert.sql 14 | sleep 5 15 | psql < select.sql > before_crash.txt 16 | sleep 3 17 | # after checkpointing 18 | pkill peloton 19 | sleep 3 20 | pg_ctl -D ../../../build/data start 21 | sleep 3 22 | # after recovery 23 | psql < select.sql > after_crash.txt 24 | diff before_crash.txt after_crash.txt 25 | 26 | -------------------------------------------------------------------------------- /script/testing/logging/run_ycsb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SCALE=1 3 | WRITE=1.0 4 | rm -rf pl_log0/*.log 5 | rm -rf pl_checkpoint/*.log 6 | for backend in $(seq 1 1 20) 7 | do 8 | 9 | filename="gc_on_sync_${WRITE}.log" 10 | sh ./ycsb -b ${backend} -l 1 -u $WRITE -x 1 11 | sleep 1 12 | echo "-b $backend -l 1 -u ${WRITE} -x 1" >> $filename 13 | tail -n 1 outputfile.summary >> $filename 14 | rm -rf pl_log0/*.log 15 | rm -rf pl_checkpoint/*.log 16 | 17 | done 18 | -------------------------------------------------------------------------------- /script/testing/logging/select.sql: -------------------------------------------------------------------------------- 1 | select * from A1; 2 | select * from B1; 3 | 4 | -------------------------------------------------------------------------------- /script/testing/memcached/sql/mc_basic.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -- CREATE TABLE IF NOT EXISTS Persons 4 | -- ( 5 | -- PersonID int 6 | -- ); 7 | 8 | -- INSERT INTO Persons VALUES(1); 9 | 10 | -- SELECT * FROM Persons; 11 | 12 | DROP TABLE IF EXISTS Persons 13 | 14 | CREATE TABLE Persons (PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255)) 15 | 16 | INSERT INTO Persons VALUES ('1', 'san', 'sid', 'centre', 'pitt') 17 | 18 | INSERT INTO Persons VALUES ('2', 'san2', 'sid2', 'centr2e', 'pefeitt') 19 | 20 | INSERT INTO Persons VALUES ('3', 'san3', 'sid3', 'centr3e', 'pefeitrwt') 21 | 22 | SELECT * FROM Persons WHERE personid=2 -------------------------------------------------------------------------------- /script/testing/nops/README.md: -------------------------------------------------------------------------------- 1 | ## Simple no-ops test for Peloton 2 | 3 | The java program here provides simple JDBC operation no-op tests for Peloton database. To run the test, simply type: 4 | 5 | `bash test_nop.sh [peloton|postgres|timesten] 6 | 7 | -------------------------------------------------------------------------------- /script/testing/nops/gather_nop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script gathers experiment results of different number of clients for no-op queries 3 | if [ "$#" -ne 3 ]; then 4 | echo "Usage: $0 [target_db] [workload] [max number of client]" 5 | else 6 | echo $1 7 | for (( i=1; i<=$3; i++ )) 8 | do 9 | ./test_nop.sh $1 $2 $i 2> /dev/null 10 | done 11 | fi 12 | -------------------------------------------------------------------------------- /script/testing/nops/test_nop.sh: -------------------------------------------------------------------------------- 1 | mkdir -p lib 2 | mkdir -p out 3 | wget -nc -P lib https://jdbc.postgresql.org/download/postgresql-9.4.1209.jre6.jar 2> /dev/null 4 | javac -classpath ./lib/postgresql-9.4.1209.jre6.jar:./lib/ttjdbc7.jar -d out src/PelotonTest.java 5 | jar -cvf out.jar -C out . > /dev/null 6 | java -cp out.jar:./lib/postgresql-9.4.1209.jre6.jar:./lib/ttjdbc7.jar PelotonTest $1 $2 $3 7 | -------------------------------------------------------------------------------- /script/testing/sqlite_trace/.gitignore: -------------------------------------------------------------------------------- 1 | peloton-test 2 | out 3 | sqllite -------------------------------------------------------------------------------- /script/testing/sqlite_trace/README.md: -------------------------------------------------------------------------------- 1 | # SQLite Trace Testing 2 | 3 | This script will download the SQLite query trace file and run it with our testing framework. It will run each query in Postgres and Peloton, and check to make sure that their results match. 4 | 5 | This is meant to be run in Jenkins as part of our build/test process. 6 | 7 | ## Configuration 8 | 9 | * Keyword Filter File: Any query in the trace files will be ignored if it contains any keyword listed in this file. 10 | 11 | * Supported Trace Files: A list trace files that will be used in the test. As we expand support for new SQL features, we should include new files. 12 | 13 | ## Instructions 14 | 15 | Note that `run.sh` will do these steps automatically. 16 | 17 | 1. Run `clear.sh` to clear the current workspace. 18 | 2) Download peloton-test (temporarily from my forked version) 19 | 3) Download sqlite trace files 20 | 4) Run `test.py`. This will first convert the Sqlite trace file into a SQL file format that is needed by the peloton-test framework. It will then invoke the test. -------------------------------------------------------------------------------- /script/testing/sqlite_trace/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -d peloton-test ]; then rm -rf peloton-test; fi; 4 | 5 | if [ -d sqllite ]; then rm -rf sqllite; fi; 6 | 7 | if [ -d out ]; then rm -rf out; fi; 8 | 9 | if [ -f config.pyc ]; then rm -f config.pyc; fi; 10 | -------------------------------------------------------------------------------- /script/testing/sqlite_trace/config.py: -------------------------------------------------------------------------------- 1 | # parameters for connecting to postgresql 2 | pg_database = "sqlite_trace_test" 3 | pg_username = "jenkins" 4 | pg_password = "jenkinsTest123" 5 | 6 | # parameters for connecting to peloton 7 | peloton_path = "../../../build/bin/peloton" 8 | peloton_port = 52726 9 | peloton_username = "" 10 | peloton_password = "" 11 | 12 | # sqllite trace file path 13 | trace_file_root = "sqllite/trace" 14 | 15 | # peloton-test path 16 | peloton_test_path = "peloton-test" 17 | 18 | # output 19 | output_dir = "out" 20 | peloton_log_file = "peloton_log" 21 | 22 | # trace files 23 | traces = map(lambda x: x.strip(), open("trace_files").readlines()) 24 | 25 | # sql keyword filter 26 | # ** in upper case ** 27 | kw_filter = map(lambda x: x.strip(), open("keyword_filter").readlines()) 28 | -------------------------------------------------------------------------------- /script/testing/sqlite_trace/keyword_filter: -------------------------------------------------------------------------------- 1 | CASE 2 | BETWEEN 3 | <> 4 | IS 5 | \(SELECT 6 | ABS 7 | -------------------------------------------------------------------------------- /script/testing/sqlite_trace/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | ./clear.sh 4 | 5 | wget -O- -q "https://github.com/cmu-db/peloton-test/blob/master/deploy/peloton-test.tar?raw=true" | tar x 6 | wget -O- -q http://pelotondb.io/files/data/sqlite-traces.tar.gz | tar xz 7 | 8 | python trace-replay.py 9 | -------------------------------------------------------------------------------- /script/testing/sqlite_trace/trace_files: -------------------------------------------------------------------------------- 1 | sqllite/test/select1.test 2 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | # C/C++ 2 | [*.{cpp,hpp,cc,cxx,c,h}] 3 | indent_style = space 4 | indent_size = 2 5 | -------------------------------------------------------------------------------- /src/brain/selectivity/selectivity_defaults.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // selectivity_defaults.cpp 6 | // 7 | // Identification: src/brain/workload/selectivity_defaults.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "brain/selectivity/selectivity_defaults.h" 14 | 15 | namespace peloton { 16 | namespace brain { 17 | 18 | const int AugmentedNNDefaults::COLUMN_NUM = 1; 19 | const int AugmentedNNDefaults::ORDER = 1; 20 | const int AugmentedNNDefaults::NEURON_NUM = 16; 21 | const float AugmentedNNDefaults::LR = 0.1f; 22 | const int AugmentedNNDefaults::BATCH_SIZE = 256; 23 | const int AugmentedNNDefaults::EPOCHS = 600; 24 | 25 | 26 | } // namespace brain 27 | } // namespace peloton 28 | -------------------------------------------------------------------------------- /src/codegen/proxy/bloom_filter_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // bloom_filter_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/bloom_filter_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/bloom_filter_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(BloomFilter, "peloton::BloomFilter", num_hash_funcs, bytes, 19 | num_bits, num_misses, num_probes); 20 | 21 | DEFINE_METHOD(peloton::codegen::util, BloomFilter, Init); 22 | DEFINE_METHOD(peloton::codegen::util, BloomFilter, Destroy); 23 | 24 | } // namespace codegen 25 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/buffer_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // buffer_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/buffer_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/buffer_proxy.h" 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "codegen/proxy/type_builder.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | DEFINE_TYPE(Buffer, "peloton::Buffer", buffer_start, buffer_pos, buffer_end); 22 | 23 | DEFINE_METHOD(peloton::codegen::util, Buffer, Init); 24 | DEFINE_METHOD(peloton::codegen::util, Buffer, Destroy); 25 | DEFINE_METHOD(peloton::codegen::util, Buffer, Append); 26 | DEFINE_METHOD(peloton::codegen::util, Buffer, Reset); 27 | 28 | } // namespace codegen 29 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/csv_scanner_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // csv_scanner_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/csv_scanner_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/csv_scanner_proxy.h" 14 | 15 | #include "codegen/proxy/executor_context_proxy.h" 16 | #include "codegen/proxy/runtime_functions_proxy.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | DEFINE_TYPE(CSVScanner, "util::CSVScanner", opaque1, cols, opaque2); 22 | 23 | DEFINE_TYPE(CSVScannerColumn, "util::CSVScanner::Column", type, ptr, len, 24 | is_null); 25 | 26 | DEFINE_METHOD(peloton::codegen::util, CSVScanner, Init); 27 | DEFINE_METHOD(peloton::codegen::util, CSVScanner, Destroy); 28 | DEFINE_METHOD(peloton::codegen::util, CSVScanner, Produce); 29 | 30 | } // namespace codegen 31 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/data_table_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // data_table_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/data_table_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/data_table_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(DataTable, "storage::DataTable", opaque); 19 | 20 | DEFINE_METHOD(peloton::storage, DataTable, GetTileGroupCount); 21 | 22 | } // namespace codegen 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/codegen/proxy/date_functions_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // date_functions_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/date_functions_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/date_functions_proxy.h" 14 | 15 | #include "codegen/proxy/runtime_functions_proxy.h" 16 | #include "codegen/proxy/type_builder.h" 17 | #include "function/date_functions.h" 18 | 19 | namespace peloton { 20 | namespace codegen { 21 | 22 | // Utility functions 23 | DEFINE_METHOD(peloton::function, DateFunctions, Now); 24 | 25 | // Input functions 26 | DEFINE_METHOD(peloton::function, DateFunctions, InputDate); 27 | 28 | } // namespace codegen 29 | } // namespace peloton 30 | -------------------------------------------------------------------------------- /src/codegen/proxy/deleter_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // deleter_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/deleter_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/deleter_proxy.h" 14 | 15 | #include "codegen/proxy/data_table_proxy.h" 16 | #include "codegen/proxy/executor_context_proxy.h" 17 | #include "codegen/proxy/transaction_context_proxy.h" 18 | #include "codegen/proxy/executor_context_proxy.h" 19 | 20 | namespace peloton { 21 | namespace codegen { 22 | 23 | DEFINE_TYPE(Deleter, "codegen::Deleter", opaque); 24 | 25 | DEFINE_METHOD(peloton::codegen, Deleter, Init); 26 | DEFINE_METHOD(peloton::codegen, Deleter, Delete); 27 | 28 | } // namespace codegen 29 | } // namespace peloton 30 | -------------------------------------------------------------------------------- /src/codegen/proxy/executor_context_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // executor_context_proxy.h 6 | // 7 | // Identification: src/codegen/proxy/executor_context_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/executor_context_proxy.h" 14 | #include "codegen/proxy/transaction_context_proxy.h" 15 | 16 | namespace peloton { 17 | namespace codegen { 18 | 19 | // ThreadStates 20 | DEFINE_TYPE(ThreadStates, "executor::ThreadStates", pool, num_threads, 21 | state_size, states); 22 | 23 | DEFINE_METHOD(peloton::executor::ExecutorContext, ThreadStates, Reset); 24 | DEFINE_METHOD(peloton::executor::ExecutorContext, ThreadStates, Allocate); 25 | 26 | // ExecutorContext 27 | DEFINE_TYPE(ExecutorContext, "executor::ExecutorContext", num_processed, txn, 28 | params, storage_manager, pool, thread_states); 29 | 30 | } // namespace codegen 31 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/inserter_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // inserter_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/inserter_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/inserter_proxy.h" 14 | 15 | #include "codegen/proxy/data_table_proxy.h" 16 | #include "codegen/proxy/transaction_context_proxy.h" 17 | #include "codegen/proxy/executor_context_proxy.h" 18 | #include "codegen/proxy/tuple_proxy.h" 19 | #include "codegen/proxy/pool_proxy.h" 20 | 21 | namespace peloton { 22 | namespace codegen { 23 | 24 | DEFINE_TYPE(Inserter, "codegen::Inserter", opaque); 25 | 26 | DEFINE_METHOD(peloton::codegen, Inserter, Init); 27 | DEFINE_METHOD(peloton::codegen, Inserter, AllocateTupleStorage); 28 | DEFINE_METHOD(peloton::codegen, Inserter, GetPool); 29 | DEFINE_METHOD(peloton::codegen, Inserter, Insert); 30 | DEFINE_METHOD(peloton::codegen, Inserter, TearDown); 31 | 32 | } // namespace codegen 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /src/codegen/proxy/pool_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // pool_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/pool_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/pool_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(AbstractPool, "type::AbstractPool", opaque); 19 | DEFINE_TYPE(EphemeralPool, "type::EphemeralPool", opaque); 20 | 21 | } // namespace codegen 22 | } // namespace peloton 23 | -------------------------------------------------------------------------------- /src/codegen/proxy/storage_manager_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // storage_manager_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/storage_manager_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/storage_manager_proxy.h" 14 | 15 | #include "codegen/proxy/data_table_proxy.h" 16 | 17 | namespace peloton { 18 | namespace codegen { 19 | 20 | // Define the proxy type with the single opaque member field 21 | DEFINE_TYPE(StorageManager, "storage::StorageManager", opaque); 22 | 23 | // Define a method that proxies storage::StorageManager::GetTableWithOid() 24 | DEFINE_METHOD(peloton::storage, StorageManager, GetTableWithOid); 25 | 26 | } // namespace codegen 27 | } // namespace peloton 28 | -------------------------------------------------------------------------------- /src/codegen/proxy/target_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // target_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/target_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/target_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(Target, "peloton::Target", opaque); 19 | 20 | } // namespace codegen 21 | } // namespace peloton 22 | -------------------------------------------------------------------------------- /src/codegen/proxy/tile_group_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tile_group_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/tile_group_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/tile_group_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(TileGroup, "peloton::storage::TileGroup", opaque); 19 | 20 | DEFINE_METHOD(peloton::storage, TileGroup, GetNextTupleSlot); 21 | DEFINE_METHOD(peloton::storage, TileGroup, GetTileGroupId); 22 | 23 | } // namespace codegen 24 | } // namespace peloton 25 | -------------------------------------------------------------------------------- /src/codegen/proxy/timestamp_functions_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // timestamp_functions_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/timestamp_functions_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/timestamp_functions_proxy.h" 14 | 15 | #include "codegen/codegen.h" 16 | #include "function/timestamp_functions.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | DEFINE_METHOD(peloton::function, TimestampFunctions, DateTrunc); 22 | DEFINE_METHOD(peloton::function, TimestampFunctions, DatePart); 23 | 24 | } // namespace codegen 25 | } // namespace peloton 26 | -------------------------------------------------------------------------------- /src/codegen/proxy/transaction_context_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // transaction_context_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/transaction_context_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/transaction_context_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(TransactionContext, "concurrency::TransactionContext", opaque); 19 | 20 | } // namespace codegen 21 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/transaction_runtime_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // transaction_runtime_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/transaction_runtime_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/transaction_runtime_proxy.h" 14 | 15 | #include "codegen/transaction_runtime.h" 16 | #include "codegen/proxy/data_table_proxy.h" 17 | #include "codegen/proxy/transaction_context_proxy.h" 18 | #include "codegen/proxy/tile_group_proxy.h" 19 | #include "codegen/proxy/value_proxy.h" 20 | 21 | namespace peloton { 22 | namespace codegen { 23 | 24 | DEFINE_METHOD(peloton::codegen, TransactionRuntime, PerformVectorizedRead); 25 | DEFINE_METHOD(peloton::codegen, TransactionRuntime, PerformVisibilityCheck); 26 | 27 | } // namespace codegen 28 | } // namespace peloton 29 | -------------------------------------------------------------------------------- /src/codegen/proxy/tuple_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tuple_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/tuple_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/tuple_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(Tuple, "storage::Tuple", opaque); 19 | 20 | } // namespace codegen 21 | } // namespace peloton 22 | -------------------------------------------------------------------------------- /src/codegen/proxy/value_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // value_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/value_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/value_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(Value, "peloton::Value", opaque); 19 | 20 | } // namespace codegen 21 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/varlen_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // varlen_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/varlen_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/varlen_proxy.h" 14 | 15 | namespace peloton { 16 | namespace codegen { 17 | 18 | DEFINE_TYPE(Varlen, "peloton::Varlen", length, ptr); 19 | 20 | } // namespace codegen 21 | } // namespace peloton -------------------------------------------------------------------------------- /src/codegen/proxy/zone_map_proxy.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // zone_map_proxy.cpp 6 | // 7 | // Identification: src/codegen/proxy/zone_map_proxy.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "codegen/proxy/zone_map_proxy.h" 14 | 15 | #include "codegen/proxy/value_proxy.h" 16 | #include "codegen/proxy/data_table_proxy.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | DEFINE_TYPE(PredicateInfo, "peloton::storage::PredicateInfo", col_id, 22 | comparison_operator, predicate_value); 23 | DEFINE_TYPE(ZoneMapManager, "peloton::storage::ZoneMapManager", opaque); 24 | 25 | DEFINE_METHOD(peloton::storage, ZoneMapManager, ShouldScanTileGroup); 26 | DEFINE_METHOD(peloton::storage, ZoneMapManager, GetInstance); 27 | 28 | } // namespace codegen 29 | } // namespace peloton -------------------------------------------------------------------------------- /src/common/exception.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // exception.cpp 6 | // 7 | // Identification: src/common/exception.cpp 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "common/exception.h" 15 | 16 | namespace peloton { 17 | 18 | std::ostream &operator<<(std::ostream &os, const peloton::Exception &e) { 19 | os << e.exception_message_.c_str(); 20 | return os; 21 | } 22 | 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/common/item_pointer.cpp: -------------------------------------------------------------------------------- 1 | 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Peloton 5 | // 6 | // item_pointer.cpp 7 | // 8 | // Identification: src/common/item_pointer.cpp 9 | // 10 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #include "common/item_pointer.h" 15 | 16 | #include "common/macros.h" 17 | 18 | namespace peloton { 19 | 20 | ItemPointer INVALID_ITEMPOINTER; 21 | 22 | bool AtomicUpdateItemPointer(ItemPointer* src_ptr, const ItemPointer& value) { 23 | PELOTON_ASSERT(sizeof(ItemPointer) == sizeof(int64_t)); 24 | int64_t* cast_src_ptr = reinterpret_cast((void*)src_ptr); 25 | int64_t* cast_value_ptr = reinterpret_cast((void*)&value); 26 | return __sync_bool_compare_and_swap(cast_src_ptr, *cast_src_ptr, 27 | *cast_value_ptr); 28 | } 29 | 30 | } // namespace peloton 31 | -------------------------------------------------------------------------------- /src/common/portal.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // portal.cpp 6 | // 7 | // Identification: src/common/portal.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "common/portal.h" 14 | #include "common/logger.h" 15 | #include "common/statement.h" 16 | 17 | namespace peloton { 18 | 19 | Portal::Portal(const std::string& portal_name, 20 | std::shared_ptr statement, 21 | std::vector bind_parameters, 22 | std::shared_ptr param_stat) 23 | : portal_name_(portal_name), 24 | statement_(statement), 25 | bind_parameters_(std::move(bind_parameters)), 26 | param_stat_(param_stat) {} 27 | 28 | Portal::~Portal() { statement_.reset(); } 29 | 30 | std::shared_ptr Portal::GetStatement() const { return statement_; } 31 | 32 | const std::vector& Portal::GetParameters() const { 33 | return bind_parameters_; 34 | } 35 | 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/common/printable.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // printable.cpp 6 | // 7 | // Identification: src/common/printable.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include 14 | 15 | #include "common/printable.h" 16 | 17 | namespace peloton { 18 | 19 | // Get a string representation for debugging 20 | std::ostream &operator<<(std::ostream &os, const Printable &printable) { 21 | os << printable.GetInfo(); 22 | return os; 23 | }; 24 | 25 | } // namespace peloton 26 | -------------------------------------------------------------------------------- /src/concurrency/epoch_manager_factory.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // epoch_manager_factory.cpp 6 | // 7 | // Identification: src/concurrency/epoch_manager_factory.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "concurrency/transaction_manager_factory.h" 15 | 16 | namespace peloton { 17 | namespace concurrency { 18 | 19 | EpochType EpochManagerFactory::epoch_ = EpochType::DECENTRALIZED_EPOCH; 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/concurrency/transaction_manager_factory.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // transaction_manager_factory.cpp 6 | // 7 | // Identification: src/concurrency/transaction_manager_factory.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "concurrency/transaction_manager_factory.h" 15 | 16 | namespace peloton { 17 | namespace concurrency { 18 | ProtocolType TransactionManagerFactory::protocol_ = 19 | ProtocolType::TIMESTAMP_ORDERING; 20 | IsolationLevelType TransactionManagerFactory::isolation_level_ = 21 | IsolationLevelType::SERIALIZABLE; 22 | ConflictAvoidanceType TransactionManagerFactory::conflict_avoidance_ = 23 | ConflictAvoidanceType::ABORT; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/executor/README.md: -------------------------------------------------------------------------------- 1 | # EXECUTOR 2 | 3 | ## Overview 4 | This directory contains the query plan executors for the execution engine and as well as the logical tile wrappers for moving data between plan nodes. Each executor implements two methods from the `AbstractExecutor` base class: 5 | 6 | 1. `DInit`: This method initializes the executor to prepare for executing the plan. 7 | 2. `DExecute`: This method is responsible for processing data from either its children nodes or an access method (i.e., table, index) and returning a logical tile. 8 | 9 | ## Additional Notes 10 | 11 | This is for the interpretted execution engine. -------------------------------------------------------------------------------- /src/expression/aggregate_expression.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // aggregate_expression.cpp 6 | // 7 | // Identification: src/expression/aggregate_expression.cpp 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "expression/aggregate_expression.h" 14 | 15 | namespace peloton { 16 | namespace expression { 17 | 18 | const std::string AggregateExpression::GetInfo(int num_indent) const { 19 | std::ostringstream os; 20 | os << StringUtil::Indent(num_indent) << "-[Expression :: " 21 | << "Aggregate]\n" 22 | << StringUtil::Indent(num_indent + 1) << "aggregate type = " << expr_name_ 23 | << std::endl; 24 | for (const auto &child : children_) { 25 | os << child.get()->GetInfo(num_indent + 2); 26 | } 27 | 28 | return os.str(); 29 | } 30 | 31 | const std::string AggregateExpression::GetInfo() const { 32 | std::ostringstream os; 33 | os << GetInfo(0); 34 | 35 | return os.str(); 36 | } 37 | 38 | } // namespace expression 39 | } // namespace peloton 40 | -------------------------------------------------------------------------------- /src/expression/constant_value_expression.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // constant_value_expression.cpp 6 | // 7 | // Identification: src/expression/constant_value_expression.cpp 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "expression/constant_value_expression.h" 14 | 15 | namespace peloton { 16 | namespace expression { 17 | 18 | const std::string ConstantValueExpression::GetInfo(int num_indent) const { 19 | std::ostringstream os; 20 | 21 | os << StringUtil::Indent(num_indent) << "-[Expression :: " 22 | << "Constant Value]\n" 23 | << StringUtil::Indent(num_indent + 1) << "value: " << value_.GetInfo() 24 | << std::endl; 25 | 26 | return os.str(); 27 | } 28 | 29 | const std::string ConstantValueExpression::GetInfo() const { 30 | std::ostringstream os; 31 | os << GetInfo(0); 32 | 33 | return os.str(); 34 | } 35 | 36 | } // namespace expression 37 | } // namespace peloton 38 | -------------------------------------------------------------------------------- /src/expression/star_expression.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // star_expression.cpp 6 | // 7 | // Identification: src/expression/star_expression.cpp 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "expression/star_expression.h" 14 | #include "util/string_util.h" 15 | #include 16 | 17 | namespace peloton { 18 | namespace expression { 19 | 20 | const std::string StarExpression::GetInfo(int num_indent) const { 21 | std::ostringstream os; 22 | 23 | os << StringUtil::Indent(num_indent) << "-[Expression :: " 24 | << "Star]" 25 | << std::endl; 26 | 27 | return os.str(); 28 | } 29 | 30 | const std::string StarExpression::GetInfo() const { 31 | std::ostringstream os; 32 | os << GetInfo(0); 33 | 34 | return os.str(); 35 | } 36 | 37 | } // namespace expression 38 | } // namespace peloton 39 | -------------------------------------------------------------------------------- /src/gc/gc_manager_factory.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // gc_manager_factory.cpp 6 | // 7 | // Identification: src/gc/gc_manager_factory.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "gc/gc_manager_factory.h" 15 | 16 | namespace peloton { 17 | namespace gc { 18 | 19 | GarbageCollectionType GCManagerFactory::gc_type_ = GarbageCollectionType::ON; 20 | 21 | int GCManagerFactory::gc_thread_count_ = 1; 22 | 23 | } // namespace gc 24 | } // namespace peloton 25 | -------------------------------------------------------------------------------- /src/include/brain/selectivity/selectivity_defaults.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // selectivity_defaults.h 6 | // 7 | // Identification: src/include/brain/workload/selectivity_defaults.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | /** 16 | * This header file contains default attributes 17 | * associated with the selectivity prediction task 18 | **/ 19 | 20 | namespace peloton { 21 | namespace brain { 22 | 23 | struct AugmentedNNDefaults { 24 | static const int COLUMN_NUM; 25 | static const int ORDER; 26 | static const int NEURON_NUM; 27 | static const float LR; 28 | static const int BATCH_SIZE; 29 | static const int EPOCHS; 30 | }; 31 | 32 | } // namespace brain 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /src/include/brain/util/tf_util.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tf_util.h 6 | // 7 | // Identification: src/include/brain/util/tf_util.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include 16 | 17 | /** 18 | * Simple utility functions associated with Tensorflow 19 | */ 20 | 21 | namespace peloton { 22 | namespace brain { 23 | class TFUtil { 24 | public: 25 | static const char *GetTFVersion() { return TF_Version(); } 26 | }; 27 | } // namespace brain 28 | } // namespace peloton 29 | -------------------------------------------------------------------------------- /src/include/brain/workload/ensemble_model.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // ensemble_model.h 6 | // 7 | // Identification: src/include/brain/workload/ensemble_model.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "brain/workload/base_tf.h" 16 | 17 | namespace peloton { 18 | namespace brain { 19 | class TimeSeriesEnsemble { 20 | public: 21 | TimeSeriesEnsemble(std::vector> models, 22 | const std::vector &model_weights, int batch_size); 23 | float Validate(const matrix_eig &data); 24 | BaseForecastModel &GetModel(size_t idx); 25 | size_t ModelsSize() const; 26 | 27 | private: 28 | std::vector> models_; 29 | int batch_size_; 30 | const vector_t model_weights_; 31 | // TODO(saatviks): Pass TFModel's bsz here(Find better way of handling this) 32 | }; 33 | } // namespace brain 34 | } // namespace peloton 35 | -------------------------------------------------------------------------------- /src/include/capnp/peloton_service.capnp: -------------------------------------------------------------------------------- 1 | @0xf3d342883f3f0344; 2 | 3 | struct CreateIndexRequest { 4 | databaseName @0 :Text; 5 | tableName @1 :Text; 6 | 7 | keyAttrs @2 :List(Int32); 8 | indexName @3 :Text; 9 | uniqueKeys @4 :Bool; 10 | 11 | indexKeys @5 :Int32; 12 | } 13 | 14 | struct CreateIndexResponse { 15 | message @0 :Text; 16 | } 17 | 18 | interface PelotonService { 19 | createIndex @0 (request :CreateIndexRequest) -> (response :CreateIndexResponse); 20 | } 21 | -------------------------------------------------------------------------------- /src/include/codegen/expression/case_translator.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // case_translator.h 6 | // 7 | // Identification: src/include/codegen/expression/case_translator.h 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/expression/expression_translator.h" 16 | 17 | namespace peloton { 18 | 19 | namespace expression { 20 | class CaseExpression; 21 | } // namespace expression 22 | 23 | namespace codegen { 24 | 25 | /// A translator for CASE expressions. 26 | class CaseTranslator : public ExpressionTranslator { 27 | public: 28 | CaseTranslator(const expression::CaseExpression &expression, 29 | CompilationContext &context); 30 | 31 | codegen::Value DeriveValue(CodeGen &codegen, 32 | RowBatch::Row &row) const override; 33 | }; 34 | 35 | } // namespace codegen 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/include/codegen/expression/negation_translator.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // negation_translator.h 6 | // 7 | // Identification: src/include/codegen/expression/negation_translator.h 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/expression/expression_translator.h" 16 | 17 | namespace peloton { 18 | 19 | namespace expression { 20 | class OperatorUnaryMinusExpression; 21 | } // namespace expression 22 | 23 | namespace codegen { 24 | 25 | class NegationTranslator : public ExpressionTranslator { 26 | public: 27 | // Constructor 28 | NegationTranslator( 29 | const expression::OperatorUnaryMinusExpression &unary_minus_expression, 30 | CompilationContext &ctx); 31 | 32 | Value DeriveValue(CodeGen &codegen, RowBatch::Row &row) const override; 33 | }; 34 | 35 | } // namespace codegen 36 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/bloom_filter_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // bloom_filter_proxy.h 6 | // 7 | // Identification: include/codegen/proxy/bloom_filter_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "codegen/util/bloom_filter.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(BloomFilter) { 22 | // Member Variables 23 | DECLARE_MEMBER(0, uint64_t, num_hash_funcs); 24 | DECLARE_MEMBER(1, char *, bytes); 25 | DECLARE_MEMBER(2, uint64_t, num_bits); 26 | DECLARE_MEMBER(3, uint64_t, num_misses); 27 | DECLARE_MEMBER(4, uint64_t, num_probes); 28 | 29 | DECLARE_TYPE; 30 | 31 | // Methods 32 | DECLARE_METHOD(Init); 33 | DECLARE_METHOD(Destroy); 34 | }; 35 | 36 | TYPE_BUILDER(BloomFilter, util::BloomFilter); 37 | 38 | } // namespace codegen 39 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/buffer_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // buffer_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/buffer_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "codegen/util/buffer.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Buffer) { 22 | // Member Variables 23 | DECLARE_MEMBER(0, char *, buffer_start); 24 | DECLARE_MEMBER(1, char *, buffer_pos); 25 | DECLARE_MEMBER(2, char *, buffer_end); 26 | DECLARE_TYPE; 27 | 28 | DECLARE_METHOD(Init); 29 | DECLARE_METHOD(Destroy); 30 | DECLARE_METHOD(Append); 31 | DECLARE_METHOD(Reset); 32 | }; 33 | 34 | TYPE_BUILDER(Buffer, util::Buffer); 35 | 36 | } // namespace codegen 37 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/data_table_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // data_table_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/data_table_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "storage/data_table.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(DataTable) { 22 | /// We don't need access to internal fields, so use an opaque byte array 23 | DECLARE_MEMBER(0, char[sizeof(storage::DataTable)], opaque); 24 | DECLARE_TYPE; 25 | 26 | /// Proxy DataTable::GetTileGroupCount() 27 | DECLARE_METHOD(GetTileGroupCount); 28 | }; 29 | 30 | TYPE_BUILDER(DataTable, storage::DataTable); 31 | 32 | } // namespace codegen 33 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/date_functions_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // date_functions_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/date_functions_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | 17 | namespace peloton { 18 | namespace codegen { 19 | 20 | PROXY(DateFunctions) { 21 | // Utility functions 22 | DECLARE_METHOD(Now); 23 | 24 | // Input functions 25 | DECLARE_METHOD(InputDate); 26 | }; 27 | 28 | } // namespace codegen 29 | } // namespace peloton 30 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/deleter_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // deleter_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/deleter_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "codegen/deleter.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Deleter) { 22 | /// We don't need access to internal fields, so use an opaque byte array 23 | DECLARE_MEMBER(0, char[sizeof(Deleter)], opaque); 24 | DECLARE_TYPE; 25 | 26 | /// Proxy Init() and Delete() in codegen::Deleter 27 | DECLARE_METHOD(Init); 28 | DECLARE_METHOD(Delete); 29 | }; 30 | 31 | TYPE_BUILDER(Deleter, codegen::Deleter); 32 | 33 | } // namespace codegen 34 | } // namespace peloton 35 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/inserter_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // inserter_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/inserter_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/inserter.h" 16 | #include "codegen/proxy/proxy.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Inserter) { 22 | 23 | DECLARE_MEMBER(0, char[sizeof(Inserter)], opaque); 24 | DECLARE_TYPE; 25 | 26 | DECLARE_METHOD(Init); 27 | DECLARE_METHOD(AllocateTupleStorage); 28 | DECLARE_METHOD(GetPool); 29 | DECLARE_METHOD(Insert); 30 | DECLARE_METHOD(TearDown); 31 | }; 32 | 33 | TYPE_BUILDER(Inserter, codegen::Inserter); 34 | 35 | } // namespace codegen 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/numeric_functions_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // numeric_functions_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/numeric_functions_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | 17 | namespace peloton { 18 | namespace codegen { 19 | 20 | PROXY(NumericFunctions) { 21 | // Utility functions 22 | DECLARE_METHOD(Abs); 23 | DECLARE_METHOD(Floor); 24 | DECLARE_METHOD(Round); 25 | DECLARE_METHOD(Ceil); 26 | 27 | // Input functions 28 | DECLARE_METHOD(InputBoolean); 29 | DECLARE_METHOD(InputTinyInt); 30 | DECLARE_METHOD(InputSmallInt); 31 | DECLARE_METHOD(InputInteger); 32 | DECLARE_METHOD(InputBigInt); 33 | DECLARE_METHOD(InputDecimal); 34 | }; 35 | 36 | } // namespace codegen 37 | } // namespace peloton 38 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/pool_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // pool_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/pool_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "type/abstract_pool.h" 17 | #include "type/ephemeral_pool.h" 18 | 19 | namespace peloton { 20 | namespace codegen { 21 | 22 | PROXY(AbstractPool) { 23 | DECLARE_MEMBER(0, char[sizeof(peloton::type::AbstractPool)], opaque); 24 | DECLARE_TYPE; 25 | }; 26 | 27 | PROXY(EphemeralPool) { 28 | DECLARE_MEMBER(0, char[sizeof(peloton::type::EphemeralPool)], opaque); 29 | DECLARE_TYPE; 30 | }; 31 | 32 | TYPE_BUILDER(AbstractPool, peloton::type::AbstractPool); 33 | TYPE_BUILDER(EphemeralPool, peloton::type::EphemeralPool); 34 | 35 | } // namespace codegen 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/storage_manager_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // storage_manager_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/storage_manager_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "storage/storage_manager.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(StorageManager) { 22 | /// The data members of storage::StorageManager 23 | /// Note: For now, we don't need access to individual fields. Instead, we 24 | /// use an opaque byte array whose size matches a catalog::Catalog object. 25 | DECLARE_MEMBER(0, char[sizeof(storage::StorageManager)], opaque); 26 | DECLARE_TYPE; 27 | 28 | /// Proxy peloton::storage::StorageManager::GetTableWithOid() 29 | DECLARE_METHOD(GetTableWithOid); 30 | }; 31 | 32 | TYPE_BUILDER(StorageManager, storage::StorageManager); 33 | 34 | } // namespace codegen 35 | } // namespace peloton 36 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/target_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // target_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/target_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "common/internal_types.h" 17 | #include "planner/project_info.h" 18 | 19 | namespace peloton { 20 | namespace codegen { 21 | 22 | PROXY(Target) { 23 | DECLARE_MEMBER(0, char[sizeof(peloton::Target)], opaque); 24 | DECLARE_TYPE; 25 | }; 26 | 27 | TYPE_BUILDER(Target, peloton::Target); 28 | 29 | } // namespace codegen 30 | } // namespace peloton 31 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/tile_group_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tile_group_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/tile_group_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "storage/tile_group.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(TileGroup) { 22 | DECLARE_MEMBER(0, char[sizeof(storage::TileGroup)], opaque); 23 | DECLARE_TYPE; 24 | 25 | DECLARE_METHOD(GetNextTupleSlot); 26 | DECLARE_METHOD(GetTileGroupId); 27 | }; 28 | 29 | TYPE_BUILDER(TileGroup, storage::TileGroup); 30 | 31 | } // namespace codegen 32 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/timestamp_functions_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // timestamp_functions_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/timestamp_functions_proxy.h 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | 17 | namespace peloton { 18 | namespace codegen { 19 | 20 | PROXY(TimestampFunctions) { 21 | // Proxy everything in function::DateFunctions 22 | DECLARE_METHOD(DateTrunc); 23 | DECLARE_METHOD(DatePart); 24 | }; 25 | 26 | } // namespace codegen 27 | } // namespace peloton 28 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/transaction_context_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // transaction_context_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/transaction_context_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "concurrency/transaction_context.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(TransactionContext) { 22 | DECLARE_MEMBER(0, char[sizeof(concurrency::TransactionContext)], opaque); 23 | DECLARE_TYPE; 24 | }; 25 | 26 | TYPE_BUILDER(TransactionContext, concurrency::TransactionContext); 27 | 28 | } // namespace codegen 29 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/transaction_runtime_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // transaction_runtime_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/transaction_runtime_proxy.h 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | 17 | namespace peloton { 18 | namespace codegen { 19 | 20 | PROXY(TransactionRuntime) { 21 | DECLARE_METHOD(PerformVectorizedRead); 22 | DECLARE_METHOD(PerformVisibilityCheck); 23 | }; 24 | 25 | } // namespace codegen 26 | } // namespace peloton 27 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/tuple_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tuple_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/tuple_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "storage/tuple.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Tuple) { 22 | DECLARE_MEMBER(0, char[sizeof(storage::Tuple)], opaque); 23 | DECLARE_TYPE; 24 | }; 25 | 26 | TYPE_BUILDER(Tuple, storage::Tuple); 27 | 28 | } // namespace codegen 29 | } // namespace peloton 30 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/updater_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // updater_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/updater_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/updater.h" 16 | #include "codegen/proxy/proxy.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Updater) { 22 | /// We don't need access to internal fields, so use an opaque byte array 23 | DECLARE_MEMBER(0, char[sizeof(Updater)], opaque); 24 | DECLARE_TYPE; 25 | 26 | /// Proxy Init() and Update() in codegen::Updater 27 | DECLARE_METHOD(Init); 28 | DECLARE_METHOD(Prepare); 29 | DECLARE_METHOD(PreparePK); 30 | DECLARE_METHOD(GetPool); 31 | DECLARE_METHOD(Update); 32 | DECLARE_METHOD(UpdatePK); 33 | DECLARE_METHOD(TearDown); 34 | }; 35 | 36 | TYPE_BUILDER(Updater, codegen::Updater); 37 | 38 | } // namespace codegen 39 | } // namespace peloton 40 | -------------------------------------------------------------------------------- /src/include/codegen/proxy/value_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // value_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/value_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "type/value.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Value) { 22 | DECLARE_MEMBER(0, char[sizeof(peloton::type::Value)], opaque); 23 | DECLARE_TYPE; 24 | }; 25 | 26 | TYPE_BUILDER(Value, peloton::type::Value); 27 | 28 | } // namespace codegen 29 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/values_runtime_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // values_runtime_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/values_runtime_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "codegen/values_runtime.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(ValuesRuntime) { 22 | DECLARE_METHOD(OutputBoolean); 23 | DECLARE_METHOD(OutputTinyInt); 24 | DECLARE_METHOD(OutputSmallInt); 25 | DECLARE_METHOD(OutputInteger); 26 | DECLARE_METHOD(OutputBigInt); 27 | DECLARE_METHOD(OutputDate); 28 | DECLARE_METHOD(OutputTimestamp); 29 | DECLARE_METHOD(OutputDecimal); 30 | DECLARE_METHOD(OutputVarchar); 31 | DECLARE_METHOD(OutputVarbinary); 32 | }; 33 | 34 | } // namespace codegen 35 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/codegen/proxy/varlen_proxy.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // varlen_proxy.h 6 | // 7 | // Identification: src/include/codegen/proxy/varlen_proxy.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/proxy/proxy.h" 16 | #include "type/varlen_type.h" 17 | 18 | namespace peloton { 19 | namespace codegen { 20 | 21 | PROXY(Varlen) { 22 | DECLARE_MEMBER(0, uint32_t, length); 23 | DECLARE_MEMBER(1, const char, ptr); 24 | DECLARE_TYPE; 25 | }; 26 | 27 | } // namespace codegen 28 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/common/generator.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // generator.h 6 | // 7 | // Identification: src/include/common/generator.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | //===--------------------------------------------------------------------===// 19 | // Generator 20 | //===--------------------------------------------------------------------===// 21 | 22 | class UniformGenerator { 23 | public: 24 | UniformGenerator() { unif = std::uniform_real_distribution(0, 1); } 25 | 26 | UniformGenerator(double lower_bound, double upper_bound) { 27 | unif = std::uniform_real_distribution(lower_bound, upper_bound); 28 | } 29 | 30 | double GetSample() { return unif(rng); } 31 | 32 | private: 33 | // Random number generator 34 | std::mt19937_64 rng; 35 | 36 | // Distribution 37 | std::uniform_real_distribution unif; 38 | }; 39 | -------------------------------------------------------------------------------- /src/include/common/init.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // init.h 6 | // 7 | // Identification: src/include/common/init.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | namespace peloton { 16 | 17 | class ThreadPool; 18 | 19 | extern ThreadPool thread_pool; 20 | 21 | //===--------------------------------------------------------------------===// 22 | // Global Setup and Teardown 23 | //===--------------------------------------------------------------------===// 24 | 25 | class PelotonInit { 26 | public: 27 | static void Initialize(); 28 | 29 | static void Shutdown(); 30 | 31 | static void SetUpThread(); 32 | 33 | static void TearDownThread(); 34 | }; 35 | 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/include/common/iterator.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // iterator.h 6 | // 7 | // Identification: src/include/common/iterator.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #pragma once 15 | 16 | namespace peloton { 17 | 18 | //===--------------------------------------------------------------------===// 19 | // Iterator Interface 20 | //===--------------------------------------------------------------------===// 21 | 22 | template 23 | class Iterator { 24 | public: 25 | virtual bool Next(T &out) = 0; 26 | 27 | virtual bool HasNext() = 0; 28 | 29 | virtual ~Iterator() {} 30 | }; 31 | 32 | } // namespace peloton 33 | -------------------------------------------------------------------------------- /src/include/common/printable.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // printable.h 6 | // 7 | // Identification: src/include/common/printable.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include 16 | #include 17 | 18 | namespace peloton { 19 | 20 | //===--------------------------------------------------------------------===// 21 | // Printable Object 22 | //===--------------------------------------------------------------------===// 23 | 24 | class Printable { 25 | public: 26 | virtual ~Printable(){}; 27 | 28 | /** @brief Get the info about the object. */ 29 | virtual const std::string GetInfo() const = 0; 30 | 31 | // Get a string representation for debugging 32 | friend std::ostream &operator<<(std::ostream &os, const Printable &printable); 33 | }; 34 | 35 | } // namespace peloton 36 | -------------------------------------------------------------------------------- /src/include/common/singleton.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // singleton.h 6 | // 7 | // Identification: src/include/common/singleton.h 8 | // 9 | // Copyright (c) 2015-17, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "codegen/codegen.h" 16 | #include "common/macros.h" 17 | 18 | namespace peloton { 19 | 20 | template 21 | class Singleton { 22 | public: 23 | static T &Instance() { 24 | static T instance; 25 | return instance; 26 | } 27 | 28 | protected: 29 | Singleton() {} 30 | ~Singleton() {} 31 | 32 | private: 33 | DISALLOW_COPY_AND_MOVE(Singleton); 34 | }; 35 | 36 | } // namespace peloton -------------------------------------------------------------------------------- /src/include/common/stack_trace.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // stack_trace.h 6 | // 7 | // Identification: src/include/common/stack_trace.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | namespace peloton { 15 | 16 | void RegisterSignalHandlers(); 17 | 18 | void PrintStackTrace(FILE *out = ::stderr, 19 | unsigned int max_frames = 63); 20 | 21 | void SignalHandler(int signum); 22 | 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/include/common/utility.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // utility.h 6 | // 7 | // Identification: src/include/common/utility.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | #include 15 | 16 | namespace peloton{ 17 | 18 | int peloton_close(int fd); 19 | 20 | std::string peloton_error_message(); 21 | } 22 | -------------------------------------------------------------------------------- /src/include/executor/create_function_executor.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // create_function_executor.h 6 | // 7 | // Identification: src/include/executor/create_function_executor.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "executor/abstract_executor.h" 16 | 17 | namespace peloton { 18 | 19 | namespace storage { 20 | class DataTable; 21 | } // namespace storage 22 | 23 | namespace executor { 24 | 25 | class CreateFunctionExecutor : public AbstractExecutor { 26 | public: 27 | /// Constructor 28 | CreateFunctionExecutor(const planner::AbstractPlan *node, 29 | ExecutorContext *executor_context); 30 | 31 | /// This class cannot be copied or move-constructed 32 | DISALLOW_COPY_AND_MOVE(CreateFunctionExecutor); 33 | 34 | protected: 35 | bool DInit() override; 36 | 37 | bool DExecute() override; 38 | }; 39 | 40 | } // namespace executor 41 | } // namespace peloton 42 | -------------------------------------------------------------------------------- /src/include/index/index_key.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // index_key.h 6 | // 7 | // Identification: src/include/index/index_key.h 8 | // 9 | // Copyright (c) 2015-17, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "common/logger.h" 16 | #include "common/macros.h" 17 | #include "index/index.h" 18 | #include "storage/tuple.h" 19 | #include "type/value_peeker.h" 20 | 21 | #include 22 | 23 | // There is nothing else to put in here expect the includes for 24 | // the different index key implementations that we have 25 | 26 | #include "compact_ints_key.h" 27 | #include "generic_key.h" 28 | #include "tuple_key.h" 29 | -------------------------------------------------------------------------------- /src/include/index/skiplist.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // skiplist.h 6 | // 7 | // Identification: src/include/index/skiplist.h 8 | // 9 | // Copyright (c) 2015-17, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | namespace peloton { 16 | namespace index { 17 | 18 | /* 19 | * SKIPLIST_TEMPLATE_ARGUMENTS - Save some key strokes 20 | */ 21 | #define SKIPLIST_TEMPLATE_ARGUMENTS \ 22 | template 24 | template 26 | class SkipList { 27 | // TODO: Add your declarations here 28 | }; 29 | 30 | } // namespace index 31 | } // namespace peloton 32 | -------------------------------------------------------------------------------- /src/include/network/protocol_handler_factory.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // protocol_handler_factory.h 6 | // 7 | // Identification: src/include/network/protocol_handler_factory.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include 16 | 17 | #include "network/protocol_handler.h" 18 | 19 | // Packet content macros 20 | 21 | namespace peloton { 22 | 23 | namespace network { 24 | 25 | enum class ProtocolHandlerType { 26 | Postgres, 27 | }; 28 | 29 | // The factory of ProtocolHandler 30 | class ProtocolHandlerFactory { 31 | public: 32 | static std::unique_ptr CreateProtocolHandler( 33 | ProtocolHandlerType type, tcop::TrafficCop *trafficCop); 34 | }; 35 | } // namespace network 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/include/optimizer/pattern.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // pattern.h 6 | // 7 | // Identification: src/include/optimizer/pattern.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include 16 | #include 17 | 18 | #include "optimizer/operator_node.h" 19 | 20 | namespace peloton { 21 | namespace optimizer { 22 | 23 | class Pattern { 24 | public: 25 | Pattern(OpType op); 26 | 27 | void AddChild(std::shared_ptr child); 28 | 29 | const std::vector> &Children() const; 30 | 31 | inline size_t GetChildPatternsSize() const { return children.size(); } 32 | 33 | OpType Type() const; 34 | 35 | private: 36 | OpType _type; 37 | std::vector> children; 38 | }; 39 | 40 | } // namespace optimizer 41 | } // namespace peloton 42 | -------------------------------------------------------------------------------- /src/include/optimizer/stats/stats.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // stats.h 6 | // 7 | // Identification: src/include/optimizer/stats.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "optimizer/stats/tuple_sample.h" 16 | 17 | namespace peloton { 18 | namespace optimizer { 19 | 20 | //===--------------------------------------------------------------------===// 21 | // Stats 22 | //===--------------------------------------------------------------------===// 23 | class Stats { 24 | public: 25 | Stats(TupleSample *sample) : sample_(sample){}; 26 | virtual ~Stats() {} 27 | 28 | private: 29 | TupleSample *sample_; 30 | }; 31 | 32 | } // namespace optimizer 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /src/include/optimizer/stats/tuple_sample.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tuple_sample.h 6 | // 7 | // Identification: src/include/optimizer/tuple_sample.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "optimizer/column.h" 16 | #include "storage/tile_group.h" 17 | 18 | #include 19 | 20 | namespace peloton { 21 | namespace optimizer { 22 | 23 | //===--------------------------------------------------------------------===// 24 | // TupleSample 25 | //===--------------------------------------------------------------------===// 26 | class TupleSample { 27 | public: 28 | TupleSample(std::vector columns, 29 | storage::TileGroup *sampled_tuples); 30 | 31 | private: 32 | std::vector columns; 33 | storage::TileGroup *sampled_tuples; 34 | }; 35 | 36 | } // namespace optimizer 37 | } // namespace peloton 38 | -------------------------------------------------------------------------------- /src/include/parser/explain_statement.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // explain_statement.h 6 | // 7 | // Identification: src/include/parser/explain_statement.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "parser/sql_statement.h" 16 | 17 | namespace peloton { 18 | namespace parser { 19 | 20 | /** 21 | * @class ExplainStatement 22 | * @brief Represents "EXPLAIN " 23 | */ 24 | class ExplainStatement : public SQLStatement { 25 | public: 26 | ExplainStatement() : SQLStatement(StatementType::EXPLAIN) {} 27 | virtual ~ExplainStatement() {} 28 | 29 | void Accept(SqlNodeVisitor *v) override { v->Visit(this); } 30 | 31 | std::unique_ptr real_sql_stmt; 32 | }; 33 | 34 | } // namespace parser 35 | } // namespace peloton 36 | -------------------------------------------------------------------------------- /src/include/parser/statements.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // statements.h 6 | // 7 | // Identification: src/include/parser/statements.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | // This is just for convenience 16 | 17 | #include "analyze_statement.h" 18 | #include "copy_statement.h" 19 | #include "create_function_statement.h" 20 | #include "create_statement.h" 21 | #include "delete_statement.h" 22 | #include "drop_statement.h" 23 | #include "execute_statement.h" 24 | #include "explain_statement.h" 25 | #include "insert_statement.h" 26 | #include "prepare_statement.h" 27 | #include "select_statement.h" 28 | #include "sql_statement.h" 29 | #include "transaction_statement.h" 30 | #include "update_statement.h" 31 | #include "variable_set_statement.h" 32 | -------------------------------------------------------------------------------- /src/include/planner/append_plan.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // append_plan.h 6 | // 7 | // Identification: src/include/planner/append_plan.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "abstract_plan.h" 16 | #include "common/internal_types.h" 17 | 18 | namespace peloton { 19 | namespace planner { 20 | 21 | /** 22 | * @brief Plan node for append. 23 | */ 24 | class AppendPlan : public AbstractPlan { 25 | public: 26 | AppendPlan() {} 27 | 28 | inline PlanNodeType GetPlanNodeType() const { return PlanNodeType::APPEND; } 29 | 30 | const std::string GetInfo() const { return "AppendPlan"; } 31 | 32 | std::unique_ptr Copy() const { 33 | return std::unique_ptr(new AppendPlan()); 34 | } 35 | 36 | private: 37 | DISALLOW_COPY_AND_MOVE(AppendPlan); 38 | }; 39 | 40 | } // namespace planner 41 | } // namespace peloton 42 | -------------------------------------------------------------------------------- /src/include/planner/attribute_info.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // attribute_info.h 6 | // 7 | // Identification: src/include/planner/attribute_info.h 8 | // 9 | // Copyright (c) 2015-17, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include 16 | 17 | #include "codegen/type/type.h" 18 | #include "common/internal_types.h" 19 | 20 | namespace peloton { 21 | namespace planner { 22 | 23 | // Describes an attribute that is passed around in the query plan 24 | struct AttributeInfo { 25 | // The actual type of this attribute (smallint, integer, varchar etc.) 26 | codegen::type::Type type; 27 | // The ID of the attribute 28 | oid_t attribute_id; 29 | // The name of this attribute. This isn't always available, so no one should 30 | // rely on its existence. 31 | std::string name; 32 | }; 33 | 34 | } // namespace planner 35 | } // namespace peloton 36 | -------------------------------------------------------------------------------- /src/include/proto/logging_service.proto: -------------------------------------------------------------------------------- 1 | option cc_generic_services = true; 2 | 3 | package peloton.network.service; 4 | 5 | enum ResponseType { 6 | // Everything is ok with the transaction and it is allowed 7 | // to proceed to the next processing stage 8 | SYNC = 0; 9 | // Status code indicating the stored procedure executed successfully and was 10 | // voluntarily aborted and rolled back by the stored procedure code 11 | ASYNC = 1; 12 | SEMISYNC = 2; 13 | } 14 | 15 | enum LoggingStatus{ 16 | REPLAY_COMPLETE = 0; 17 | REPLAY_ERROR = 1; 18 | } 19 | 20 | message LogRecordReplayRequest{ 21 | required bytes log = 1; 22 | required ResponseType sync_type = 2; 23 | required int64 sequence_number = 3; 24 | } 25 | 26 | message LogRecordReplayResponse{ 27 | required int64 sequence_number = 1; 28 | } 29 | // ----------------------------------- 30 | // SERVICE 31 | // ----------------------------------- 32 | 33 | service PelotonLoggingService { 34 | rpc LogRecordReplay (LogRecordReplayRequest) returns (LogRecordReplayResponse); 35 | 36 | } -------------------------------------------------------------------------------- /src/include/settings/setting_id.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // settings_type.h 6 | // 7 | // Identification: src/include/settings/settings_type.h 8 | // 9 | // Copyright (c) 2015-2017, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #pragma once 15 | 16 | namespace peloton { 17 | namespace settings { 18 | 19 | enum class SettingId { 20 | #define __SETTING_ENUM__ 21 | #include "settings/settings_macro.h" 22 | #include "settings/settings.h" 23 | #undef __SETTING_ENUM__ 24 | }; 25 | 26 | } // namespace settings 27 | } // namespace peloton 28 | 29 | -------------------------------------------------------------------------------- /src/include/type/type_id.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // type_id.h 6 | // 7 | // Identification: src/include/type/type_id.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | namespace peloton { 16 | namespace type { 17 | 18 | // Every possible SQL type ID 19 | enum class TypeId { 20 | INVALID = 0, 21 | PARAMETER_OFFSET, 22 | BOOLEAN, 23 | TINYINT, 24 | SMALLINT, 25 | INTEGER, 26 | BIGINT, 27 | DECIMAL, 28 | TIMESTAMP, 29 | DATE, 30 | VARCHAR, 31 | VARBINARY, 32 | ARRAY, 33 | UDT 34 | }; 35 | 36 | } // namespace type 37 | } // namespace peloton 38 | -------------------------------------------------------------------------------- /src/include/util/math_util.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // math_util.h 6 | // 7 | // Identification: src/include/util/math_util.h 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "common/macros.h" 16 | 17 | namespace peloton { 18 | 19 | /** 20 | * Math Utility Functions 21 | */ 22 | class MathUtil { 23 | public: 24 | /** 25 | * Performs a division of two integer values and rounds up the result. 26 | * Calculation is made using a trick with integer division. 27 | */ 28 | static constexpr ALWAYS_INLINE inline size_t DivRoundUp(size_t numerator, 29 | size_t denominator) { 30 | // division must be integer division 31 | return (numerator + denominator - 1) / denominator; 32 | } 33 | }; 34 | 35 | } // namespace peloton 36 | -------------------------------------------------------------------------------- /src/index/bwtree.cpp: -------------------------------------------------------------------------------- 1 | 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Peloton 5 | // 6 | // bwtree.cpp 7 | // 8 | // Identification: src/index/bwtree.cpp 9 | // 10 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #include "index/bwtree.h" 15 | 16 | #ifdef BWTREE_PELOTON 17 | namespace peloton { 18 | namespace index { 19 | #else 20 | namespace wangziqi2013 { 21 | namespace bwtree { 22 | #endif 23 | 24 | bool print_flag = true; 25 | 26 | // This will be initialized when thread is initialized and in a per-thread 27 | // basis, i.e. each thread will get the same initialization image and then 28 | // is free to change them 29 | thread_local int BwTreeBase::gc_id = -1; 30 | 31 | std::atomic BwTreeBase::total_thread_num{0UL}; 32 | 33 | } // End index/bwtree namespace 34 | } // End peloton/wangziqi2013 namespace 35 | 36 | -------------------------------------------------------------------------------- /src/index/skiplist.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // skiplist.cpp 6 | // 7 | // Identification: src/index/skiplist.cpp 8 | // 9 | // Copyright (c) 2015-17, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "index/skiplist.h" 14 | 15 | namespace peloton { 16 | namespace index { 17 | 18 | // Add your function definitions here 19 | 20 | } // namespace index 21 | } // namespace peloton 22 | -------------------------------------------------------------------------------- /src/logging/checkpoint_manager_factory.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // checkpoint_manager_factory.cpp 6 | // 7 | // Identification: src/logging/checkpoint_manager_factory.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "logging/checkpoint_manager_factory.h" 15 | 16 | namespace peloton { 17 | namespace logging { 18 | 19 | CheckpointingType CheckpointManagerFactory::checkpointing_type_ = CheckpointingType::ON; 20 | int CheckpointManagerFactory::checkpointing_thread_count_ = 1; 21 | 22 | } // namespace gc 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/logging/log_buffer.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // log_buffer.cpp 6 | // 7 | // Identification: src/logging/log_buffer.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "common/macros.h" 15 | #include "logging/log_buffer.h" 16 | 17 | namespace peloton { 18 | namespace logging { 19 | 20 | bool LogBuffer::WriteData(const char *data, size_t len) { 21 | if (unlikely_branch(size_ + len > log_buffer_capacity_)) { 22 | return false; 23 | } else { 24 | PELOTON_ASSERT(data); 25 | PELOTON_ASSERT(len); 26 | PELOTON_MEMCPY(data_ + size_, data, len); 27 | size_ += len; 28 | return true; 29 | } 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/logging/log_manager_factory.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // log_manager_factory.cpp 6 | // 7 | // Identification: src/logging/log_manager_factory.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "logging/log_manager_factory.h" 15 | 16 | namespace peloton { 17 | namespace logging { 18 | 19 | LoggingType LogManagerFactory::logging_type_ = LoggingType::ON; 20 | 21 | int LogManagerFactory::logging_thread_count_ = 1; 22 | 23 | } // namespace gc 24 | } // namespace peloton 25 | -------------------------------------------------------------------------------- /src/network/protocol_handler.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // protocol_handler.cpp 6 | // 7 | // Identification: src/network/protocol_handler.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "network/protocol_handler.h" 14 | 15 | #include 16 | 17 | namespace peloton { 18 | namespace network { 19 | 20 | ProtocolHandler::ProtocolHandler(tcop::TrafficCop *traffic_cop) { 21 | this->traffic_cop_ = traffic_cop; 22 | } 23 | 24 | ProtocolHandler::~ProtocolHandler() {} 25 | 26 | ProcessResult ProtocolHandler::Process(ReadBuffer &, const size_t) { 27 | return ProcessResult::TERMINATE; 28 | } 29 | 30 | void ProtocolHandler::Reset() { 31 | SetFlushFlag(false); 32 | responses_.clear(); 33 | request_.Reset(); 34 | } 35 | 36 | void ProtocolHandler::GetResult() {} 37 | } // namespace network 38 | } // namespace peloton 39 | -------------------------------------------------------------------------------- /src/network/protocol_handler_factory.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // protocol_handler_factory.cpp 6 | // 7 | // Identification: src/network/protocol_handler_factory.cpp 8 | // 9 | // Copyright (c) 2015-2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "network/protocol_handler_factory.h" 14 | #include "network/postgres_protocol_handler.h" 15 | 16 | namespace peloton { 17 | namespace network { 18 | std::unique_ptr ProtocolHandlerFactory::CreateProtocolHandler( 19 | ProtocolHandlerType type, tcop::TrafficCop *traffic_cop) { 20 | switch (type) { 21 | case ProtocolHandlerType::Postgres: { 22 | return std::unique_ptr( 23 | new PostgresProtocolHandler(traffic_cop)); 24 | } 25 | default: 26 | return nullptr; 27 | } 28 | } 29 | } // namespace network 30 | } // namespace peloton 31 | -------------------------------------------------------------------------------- /src/optimizer/abstract_optimizer.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // abstract_optimizer.cpp 6 | // 7 | // Identification: src/optimizer/abstract_optimizer.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "optimizer/abstract_optimizer.h" 14 | 15 | namespace peloton { 16 | namespace optimizer { 17 | 18 | AbstractOptimizer::AbstractOptimizer(){}; 19 | 20 | AbstractOptimizer::~AbstractOptimizer(){}; 21 | 22 | } // namespace optimizer 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/optimizer/pattern.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // pattern.cpp 6 | // 7 | // Identification: src/optimizer/pattern.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "optimizer/pattern.h" 14 | 15 | namespace peloton { 16 | namespace optimizer { 17 | 18 | Pattern::Pattern(OpType op) : _type(op) {} 19 | 20 | void Pattern::AddChild(std::shared_ptr child) { 21 | children.push_back(child); 22 | } 23 | 24 | const std::vector> &Pattern::Children() const { 25 | return children; 26 | } 27 | 28 | OpType Pattern::Type() const { return _type; } 29 | 30 | } // namespace optimizer 31 | } // namespace peloton 32 | -------------------------------------------------------------------------------- /src/optimizer/property.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // property.cpp 6 | // 7 | // Identification: src/optimizer/property.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "optimizer/property.h" 14 | #include "util/hash_util.h" 15 | 16 | namespace peloton { 17 | namespace optimizer { 18 | 19 | Property::~Property() {} 20 | 21 | std::string Property::ToString() const { return PropertyTypeToString(Type()); } 22 | 23 | hash_t Property::Hash() const { 24 | PropertyType t = Type(); 25 | return HashUtil::Hash(&t); 26 | } 27 | 28 | bool Property::operator>=(const Property &r) const { 29 | return Type() == r.Type(); 30 | } 31 | 32 | } // namespace optimizer 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /src/optimizer/stats/stats.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // stats.cpp 6 | // 7 | // Identification: src/optimizer/stats.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "optimizer/stats/stats.h" 14 | 15 | namespace peloton { 16 | namespace optimizer { 17 | 18 | //===--------------------------------------------------------------------===// 19 | // Stats 20 | //===--------------------------------------------------------------------===// 21 | 22 | } // namespace optimizer 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/optimizer/stats/tuple_sample.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tuple_sample.cpp 6 | // 7 | // Identification: src/optimizer/tuple_sample.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "optimizer/stats/tuple_sample.h" 14 | 15 | namespace peloton { 16 | namespace optimizer { 17 | 18 | //===--------------------------------------------------------------------===// 19 | // TupleSample 20 | //===--------------------------------------------------------------------===// 21 | TupleSample::TupleSample(std::vector columns, 22 | storage::TileGroup *sampled_tuples) 23 | : columns(columns), sampled_tuples(sampled_tuples) {} 24 | 25 | } // namespace optimizer 26 | } // namespace peloton 27 | -------------------------------------------------------------------------------- /src/parser/delete_statement.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // delete_statement.cpp 6 | // 7 | // Identification: src/parser/delete_statement.cpp 8 | // 9 | // Copyright (c) 2015-17, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "parser/delete_statement.h" 14 | #include "util/string_util.h" 15 | #include 16 | 17 | namespace peloton { 18 | namespace parser { 19 | 20 | const std::string DeleteStatement::GetInfo(int num_indent) const { 21 | std::ostringstream os; 22 | os << StringUtil::Indent(num_indent) << "DeleteStatement\n"; 23 | os << StringUtil::Indent(num_indent + 1) << GetTableName(); 24 | if (expr != nullptr) os << expr.get()->GetInfo(num_indent + 1) << std::endl; 25 | return os.str(); 26 | } 27 | 28 | const std::string DeleteStatement::GetInfo() const { 29 | std::ostringstream os; 30 | os << "SQLStatement[DELETE]\n"; 31 | os << GetInfo(1); 32 | 33 | return os.str(); 34 | } 35 | 36 | } // namespace parser 37 | } // namespace peloton 38 | -------------------------------------------------------------------------------- /src/planner/populate_index_plan.cpp: -------------------------------------------------------------------------------- 1 | 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // PelotonDB 5 | // 6 | // populate_index_plan.cpp 7 | // 8 | // Identification: /peloton/src/planner/populate_index_plan.cpp 9 | // 10 | // Copyright (c) 2015, Carnegie Mellon University Database Group 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #include "planner/populate_index_plan.h" 15 | 16 | #include "common/internal_types.h" 17 | #include "expression/abstract_expression.h" 18 | 19 | namespace peloton { 20 | namespace planner { 21 | PopulateIndexPlan::PopulateIndexPlan(storage::DataTable *table, 22 | std::vector column_ids) 23 | : target_table_(table), column_ids_(column_ids) {} 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/proto/logging_service.proto: -------------------------------------------------------------------------------- 1 | option cc_generic_services = true; 2 | 3 | package peloton.network.service; 4 | 5 | enum ResponseType { 6 | // Everything is ok with the transaction and it is allowed 7 | // to proceed to the next processing stage 8 | SYNC = 0; 9 | // Status code indicating the stored procedure executed successfully and was 10 | // voluntarily aborted and rolled back by the stored procedure code 11 | ASYNC = 1; 12 | SEMISYNC = 2; 13 | } 14 | 15 | enum LoggingStatus{ 16 | REPLAY_COMPLETE = 0; 17 | REPLAY_ERROR = 1; 18 | } 19 | 20 | message LogRecordReplayRequest{ 21 | required bytes log = 1; 22 | required ResponseType sync_type = 2; 23 | required int64 sequence_number = 3; 24 | } 25 | 26 | message LogRecordReplayResponse{ 27 | required int64 sequence_number = 1; 28 | } 29 | // ----------------------------------- 30 | // SERVICE 31 | // ----------------------------------- 32 | 33 | service PelotonLoggingService { 34 | rpc LogRecordReplay (LogRecordReplayRequest) returns (LogRecordReplayResponse); 35 | 36 | } -------------------------------------------------------------------------------- /src/statistics/abstract_metric.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // abstract_metric.cpp 6 | // 7 | // Identification: src/statistics/abstract_metric.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "statistics/abstract_metric.h" 14 | 15 | namespace peloton { 16 | namespace stats { 17 | 18 | AbstractMetric::AbstractMetric(MetricType type) { type_ = type; } 19 | 20 | AbstractMetric::~AbstractMetric() {} 21 | 22 | } // namespace stats 23 | } // namespace peloton 24 | -------------------------------------------------------------------------------- /src/statistics/access_metric.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // access_metric.cpp 6 | // 7 | // Identification: src/statistics/access_metric.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "statistics/access_metric.h" 14 | #include "common/macros.h" 15 | 16 | namespace peloton { 17 | namespace stats { 18 | 19 | void AccessMetric::Aggregate(AbstractMetric &source) { 20 | PELOTON_ASSERT(source.GetType() == MetricType::ACCESS); 21 | 22 | auto access_metric = static_cast(source); 23 | for (size_t i = 0; i < NUM_COUNTERS; ++i) { 24 | access_counters_[i].Aggregate( 25 | static_cast(access_metric.GetAccessCounter(i))); 26 | } 27 | } 28 | 29 | } // namespace stats 30 | } // namespace peloton 31 | -------------------------------------------------------------------------------- /src/statistics/counter_metric.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // counter_metric.cpp 6 | // 7 | // Identification: src/statistics/counter_metric.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "statistics/counter_metric.h" 14 | #include "common/macros.h" 15 | 16 | namespace peloton { 17 | namespace stats { 18 | 19 | CounterMetric::CounterMetric(MetricType type) : AbstractMetric(type) { 20 | count_ = 0; 21 | } 22 | 23 | void CounterMetric::Aggregate(AbstractMetric &source) { 24 | PELOTON_ASSERT(source.GetType() == MetricType::COUNTER); 25 | count_ += static_cast(source).GetCounter(); 26 | } 27 | 28 | } // namespace stats 29 | } // namespace peloton 30 | -------------------------------------------------------------------------------- /src/storage/tile_group_iterator.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // tile_group_iterator.cpp 6 | // 7 | // Identification: src/storage/tile_group_iterator.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "storage/tile_group_iterator.h" 15 | #include "storage/data_table.h" 16 | #include "storage/tile_group.h" 17 | 18 | namespace peloton { 19 | namespace storage { 20 | 21 | bool TileGroupIterator::Next(std::shared_ptr &tileGroup) { 22 | if (HasNext()) { 23 | auto next = table_->GetTileGroup(tile_group_itr_); 24 | tileGroup.swap(next); 25 | tile_group_itr_++; 26 | return (true); 27 | } 28 | return (false); 29 | } 30 | 31 | bool TileGroupIterator::HasNext() { 32 | return (tile_group_itr_ < table_->GetTileGroupCount()); 33 | } 34 | 35 | } // namespace storage 36 | } // namespace peloton 37 | -------------------------------------------------------------------------------- /src/type/numeric_type.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // numeric_value.cpp 6 | // 7 | // Identification: src/backend/common/numeric_value.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "type/numeric_type.h" 14 | 15 | #include 16 | #include 17 | #include "type/boolean_type.h" 18 | #include "type/decimal_type.h" 19 | #include "type/varlen_type.h" 20 | 21 | namespace peloton { 22 | namespace type { 23 | 24 | NumericType::~NumericType() {} 25 | 26 | } // namespace type 27 | } // namespace peloton 28 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.xml 3 | *.trs 4 | *_test 5 | valgrind.supp 6 | 7 | ## ------------------------------- 8 | ## Test Artifacts 9 | ## ------------------------------- 10 | PRIMARY_INDEX 11 | SECONDARY_INDEX 12 | btree_index -------------------------------------------------------------------------------- /test/common/logger_test.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // logger_test.cpp 6 | // 7 | // Identification: test/common/logger_test.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "common/harness.h" 15 | #include "common/logger.h" 16 | 17 | namespace peloton { 18 | namespace test { 19 | 20 | //===--------------------------------------------------------------------===// 21 | // Logger Tests 22 | //===--------------------------------------------------------------------===// 23 | 24 | class LoggerTests : public PelotonTest {}; 25 | 26 | TEST_F(LoggerTests, BasicTest) { 27 | LOG_TRACE("trace message"); 28 | LOG_WARN("warning message"); 29 | LOG_ERROR("error message"); 30 | } 31 | 32 | } // namespace test 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /test/concurrency/timestamp_ordering_transaction_manager_test.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // timestamp_ordering_transaction_manager_test.cpp 6 | // 7 | // Identification: test/concurrency/timestamp_ordering_transaction_manager_test.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #include "concurrency/testing_transaction_util.h" 15 | #include "common/harness.h" 16 | 17 | namespace peloton { 18 | 19 | namespace test { 20 | 21 | //===--------------------------------------------------------------------===// 22 | // TransactionContext Tests 23 | //===--------------------------------------------------------------------===// 24 | 25 | class TimestampOrderingTransactionManagerTests : public PelotonTest {}; 26 | 27 | TEST_F(TimestampOrderingTransactionManagerTests, Test) { 28 | concurrency::TransactionManagerFactory::Configure(ProtocolType::TIMESTAMP_ORDERING); 29 | EXPECT_TRUE(true); 30 | } 31 | 32 | } // namespace test 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /test/include/brain/testing_augmented_nn_util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common/internal_types.h" 4 | #include "brain/util/eigen_util.h" 5 | #include "brain/workload/base_tf.h" 6 | #include "brain/selectivity/augmented_nn.h" 7 | 8 | namespace peloton{ 9 | namespace test{ 10 | 11 | enum class DistributionType{ UniformDistribution, SkewedDistribution }; 12 | 13 | class TestingAugmentedNNUtil{ 14 | public: 15 | static void Test(brain::AugmentedNN& model, 16 | DistributionType d, size_t val_interval, 17 | size_t num_samples = 1000, 18 | float val_split = 0.5, 19 | bool normalize = false, 20 | float val_loss_thresh = 0.06, 21 | size_t early_stop_patience = 10, 22 | float early_stop_delta = 0.01); 23 | // private: 24 | static matrix_eig GetData(DistributionType d, 25 | size_t num_samples, size_t num_tests); 26 | }; 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/include/executor/mock_executor.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // mock_executor.h 6 | // 7 | // Identification: test/include/executor/mock_executor.h 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | 14 | #pragma once 15 | 16 | #include "gmock/gmock.h" 17 | 18 | #include "executor/abstract_executor.h" 19 | 20 | namespace peloton { 21 | 22 | namespace executor { 23 | class LogicalTile; 24 | } 25 | 26 | namespace test { 27 | 28 | class MockExecutor : public executor::AbstractExecutor { 29 | public: 30 | MockExecutor() : executor::AbstractExecutor(nullptr, nullptr) {} 31 | 32 | MOCK_METHOD0(DInit, bool()); 33 | 34 | MOCK_METHOD0(DExecute, bool()); 35 | 36 | MOCK_METHOD0(GetOutput, executor::LogicalTile *()); 37 | }; 38 | 39 | } // namespace test 40 | } // namespace peloton 41 | -------------------------------------------------------------------------------- /test/include/optimizer/mock_task.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // mock_task.h 6 | // 7 | // Identification: test/include/optimizer/mock_task.h 8 | // 9 | // Copyright (c) 2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "gmock/gmock.h" 16 | 17 | #include "optimizer/optimizer_task.h" 18 | 19 | namespace peloton { 20 | namespace optimizer { 21 | namespace test { 22 | 23 | class MockTask : public optimizer::OptimizerTask { 24 | public: 25 | MockTask() 26 | : optimizer::OptimizerTask(nullptr, OptimizerTaskType::OPTIMIZE_GROUP) {} 27 | 28 | MOCK_METHOD0(execute, void()); 29 | }; 30 | 31 | } // namespace test 32 | } // namespace optimizer 33 | } // namespace peloton 34 | -------------------------------------------------------------------------------- /test/include/parser/mock_sql_statement.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // mock_parse_tree.h 6 | // 7 | // Identification: test/include/parser/mock_parse_tree.h 8 | // 9 | // Copyright (c) 2018, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #pragma once 14 | 15 | #include "gmock/gmock.h" 16 | 17 | #include "parser/sql_statement.h" 18 | 19 | namespace peloton { 20 | 21 | class SqlNodeVisitor; 22 | 23 | namespace parser { 24 | namespace test { 25 | 26 | class MockSQLStatement : public parser::SQLStatement { 27 | public: 28 | MockSQLStatement() : parser::SQLStatement(StatementType::SELECT) {} 29 | 30 | MOCK_METHOD1(Accept, void(SqlNodeVisitor *v)); 31 | }; 32 | 33 | } // namespace test 34 | } // namespace parser 35 | } // namespace peloton 36 | -------------------------------------------------------------------------------- /test/leak_suppr.txt: -------------------------------------------------------------------------------- 1 | 2 | # suppress the leak in the pg_query parser memory management 3 | # see #1194 4 | # 5 | leak:src_backend_utils_mmgr_mcxt.c 6 | # suppress the tensorflow background thread problem(#1232) 7 | leak:tensorflow::thread::EigenEnvironment::CreateThread 8 | leak:tensorflow::thread::ThreadPool::ThreadPool 9 | leak:__cxa_thread_atexit_impl 10 | -------------------------------------------------------------------------------- /test/logging/logging_util_test.cpp: -------------------------------------------------------------------------------- 1 | // //===----------------------------------------------------------------------===// 2 | // // 3 | // // Peloton 4 | // // 5 | // // logging_util_test.cpp 6 | // // 7 | // // Identification: test/logging/logging_util_test.cpp 8 | // // 9 | // // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // // 11 | // //===----------------------------------------------------------------------===// 12 | 13 | 14 | // #include "common/harness.h" 15 | 16 | // #include "logging/logging_util.h" 17 | 18 | // namespace peloton { 19 | // namespace test { 20 | 21 | // //===--------------------------------------------------------------------===// 22 | // // Logging Tests 23 | // //===--------------------------------------------------------------------===// 24 | // class LoggingUtilTests : public PelotonTest {}; 25 | 26 | // TEST_F(LoggingUtilTests, BasicLoggingUtilTest) { 27 | // auto status = logging::LoggingUtil::CreateDirectory("test_dir", 0700); 28 | // EXPECT_TRUE(status); 29 | 30 | // status = logging::LoggingUtil::RemoveDirectory("test_dir", true); 31 | // EXPECT_TRUE(status); 32 | // } 33 | 34 | // } // namespace test 35 | // } // namespace peloton 36 | -------------------------------------------------------------------------------- /test/logging/new_checkpointing_test.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // new_checkpointing_test.cpp 6 | // 7 | // Identification: test/logging/new_checkpointing_test.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "logging/checkpoint_manager_factory.h" 14 | #include "common/harness.h" 15 | 16 | namespace peloton { 17 | namespace test { 18 | 19 | //===--------------------------------------------------------------------===// 20 | // Checkpointing Tests 21 | //===--------------------------------------------------------------------===// 22 | 23 | class NewCheckpointingTests : public PelotonTest {}; 24 | 25 | TEST_F(NewCheckpointingTests, MyTest) { 26 | auto &checkpoint_manager = logging::CheckpointManagerFactory::GetInstance(); 27 | checkpoint_manager.Reset(); 28 | 29 | EXPECT_TRUE(true); 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/logging/new_logging_test.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Peloton 4 | // 5 | // new_logging_test.cpp 6 | // 7 | // Identification: test/logging/new_logging_test.cpp 8 | // 9 | // Copyright (c) 2015-16, Carnegie Mellon University Database Group 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "logging/log_manager_factory.h" 14 | #include "common/harness.h" 15 | 16 | namespace peloton { 17 | namespace test { 18 | 19 | //===--------------------------------------------------------------------===// 20 | // Logging Tests 21 | //===--------------------------------------------------------------------===// 22 | 23 | class NewLoggingTests : public PelotonTest {}; 24 | 25 | TEST_F(NewLoggingTests, MyTest) { 26 | auto &log_manager = logging::LogManagerFactory::GetInstance(); 27 | log_manager.Reset(); 28 | 29 | EXPECT_TRUE(true); 30 | 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/network/ssl/root.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDDzCCAfegAwIBAgIJALnYXsYu6xTqMA0GCSqGSIb3DQEBCwUAMB4xHDAaBgNV 3 | BAMME3Jvb3QueW91cmRvbWFpbi5jb20wHhcNMTgwMzI3MjAwNTM5WhcNMjgwMzI0 4 | MjAwNTM5WjAeMRwwGgYDVQQDDBNyb290LnlvdXJkb21haW4uY29tMIIBIjANBgkq 5 | hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+bP/zPanodNjwRT07JHxeXGhUQGdWbgM 6 | lXa30aYqM3JYsMyumXukNhAI0ErEwX+CkXBsK3/+nuATm18s8FipIWuUeh19Sokh 7 | qeLaZiSrZEHHjsiLreVsoKI9bAuohPay2XI3hkLEeQ1Mo4yxRjU1BpktY4lhzvvf 8 | cTE1G/zRtGMAGKeng/S0aadjJbmFxEQB14x68FQg6UsfpukIizmZmgJ5uRnmhDgL 9 | xiMfYrGjSl+sH9+Pmi5D6jcYIC1P1qcVDB7q1xd+cktrfNCXVo8zaYlDOuAqhPoD 10 | TpTf0eK9aPXoiFtP30Ys8S3CjQA3ChuxX96oyNOxG87VNGVFRiyvfQIDAQABo1Aw 11 | TjAdBgNVHQ4EFgQUcHPnzTFlIDQL7qO4hWpr4c3g0fEwHwYDVR0jBBgwFoAUcHPn 12 | zTFlIDQL7qO4hWpr4c3g0fEwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC 13 | AQEA4ghpPKmNeSlFEwkfaqeum9DuvORlhrdBA/l64QlB3VwmeyA2O/bpTGuad3E6 14 | BsrR2DXH0k4lpoK/uzBGgUas5R0Tg2eiUD/uhHff/thU/yvoCD3o2K0cQXKCTYgq 15 | ct25OLMNxf2sHN8VD64AJnvF6yIv0ptBkF2Iqcn5486f5pJgs48MhJcSjFZYpjvo 16 | T54vh+U6DLT0dPIa5JJOhBQIe6LYuJDwZH84Fh3lGKip5OWT1RfuTHKViz5fL+lX 17 | eQqzL9kA9zm593Z6ltvVdSTxndBW1JYgL9opMB7wrvuEdGUECXzZJWioO9EP/yV2 18 | ekprwI05kJhh2fqrduTuIq30HQ== 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /test/network/ssl/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICujCCAaICCQCGyfkOWMMn2jANBgkqhkiG9w0BAQsFADAeMRwwGgYDVQQDDBNy 3 | b290LnlvdXJkb21haW4uY29tMB4XDTE4MDMyNzIwMDU0OFoXDTE5MDMyNzIwMDU0 4 | OFowIDEeMBwGA1UEAwwVZGJob3N0LnlvdXJkb21haW4uY29tMIIBIjANBgkqhkiG 5 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA75NjtSRgvXgreFG5Ud0UjMMPkkBUcPcHDTuR 6 | SqMkTld+TNw22mCadSVvYtbECwmbbBRvQ4PGaIvyeVH2+s5kUqrB6GHdy3pslhoG 7 | I5QTgMZHlJDDlL/dDKzMRnjAcf33wUnxB0ZgHZiQ1w6DCe8q59BoFc1lqb0jq64x 8 | TtBdmU/KdQT2Bk/3K3hHWhfLDIZnHPxptBBVm2sq7B+lpcAHbw7OGjv7AUyonzWC 9 | U1rvQpzbIs3vqEzNRu1KR6muuf5vNFY5DXchKitZiIwvj6El3Irkk9Of6NrOlSeI 10 | diSh2DS3i3z/mHCvbJc2d7Pbp0Hy0Jb27Ym9TtGJ68675lYTMQIDAQABMA0GCSqG 11 | SIb3DQEBCwUAA4IBAQBc5SNlFnyQLhJSF8iEVw3qevIEjhcgjSUazfNVMNKD+edN 12 | Q5v2w1yEp8sdFJVR9KYfpqj+h9BABG7toY1+COGjdbNM/0dVrwBle14s9ALmj5nR 13 | tAR13jyRsdbGR7C8P7n1KessHi/RBokLZjMkfiPlimWQjMeRsLsQVjf2XGk+ywOO 14 | 57O0GktuEnN17MYa/D393+AL6fMFcmmuE4e7Hf6mN77ztWcWo/BAyc1tQXsQm4CQ 15 | KDk43LAUEA+ml12PuRjDVDeTDPrIte6YDM9Dxbr0vXj+NPZ4rVvPM5b+wxnZr7kQ 16 | 2G7oYEHfI5QRpIw5fvVwRoNo0NhLHK6SlAKnzn3i 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /test/test-driver.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Extract the file name of the tes executable 3 | name=${1##*/} 4 | echo $name 5 | echo $pwd 6 | valgrind --error-exitcode=1 --leak-check=full --quiet --track-origins=yes --suppressions=./valgrind.supp --xml=yes --xml-file=valgrind_${name}.xml --log-file=valgrind_${name}.log -v ./${name} --gtest_output=xml:"unit_"${name}".xml" 7 | #exec $1 --gtest_output="xml:"$1".xml" 8 | -------------------------------------------------------------------------------- /third_party/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################## 2 | # THIRD_PARTY CMAKELISTS 3 | ################################################################################## 4 | 5 | # --[ Cap'nProto library 6 | 7 | add_subdirectory(capnproto) 8 | 9 | ################################################################################## 10 | 11 | -------------------------------------------------------------------------------- /third_party/adaptive_radix_tree/README.md: -------------------------------------------------------------------------------- 1 | This code is originally from [flode](https://github.com/flode/ARTSynchronized), but 2 | has been modified. The modifications include: 3 | 4 | 1. Fix race condition during child traversal. 5 | 2. Store duplicate keys in chunked-array leaf nodes. 6 | -------------------------------------------------------------------------------- /third_party/capnproto/.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - /release-.*/ 5 | language: cpp 6 | os: 7 | - linux 8 | - osx 9 | compiler: 10 | - gcc 11 | - clang 12 | dist: trusty 13 | sudo: false 14 | addons: 15 | apt: 16 | packages: 17 | - automake 18 | - autoconf 19 | - libtool 20 | - pkg-config 21 | before_install: 22 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi 23 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install automake autoconf libtool; fi 24 | script: ./super-test.sh -j2 quick # limit parallelism due to limited memory on Travis 25 | -------------------------------------------------------------------------------- /third_party/capnproto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors 2 | Licensed under the MIT License: 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /third_party/capnproto/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think 4 | JSON, except binary. Or think [Protocol Buffers](http://protobuf.googlecode.com), except faster. 5 | In fact, in benchmarks, Cap'n Proto is INFINITY TIMES faster than Protocol Buffers. 6 | 7 | [Read more...](http://kentonv.github.com/capnproto/) 8 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/LICENSE.txt: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /third_party/capnproto/c++/capnp-json.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Cap'n Proto JSON 7 | Description: JSON encoder and decoder for Cap'n Proto objects 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lcapnp-json 10 | Requires: capnp = @VERSION@ kj = @VERSION@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/capnp-rpc.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Cap'n Proto RPC 7 | Description: Fast object-oriented RPC system 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lcapnp-rpc 10 | Requires: capnp = @VERSION@ kj-async = @VERSION@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/capnp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Cap'n Proto 7 | Description: Insanely fast serialization system 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lcapnp @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @STDLIB_FLAG@ 10 | Libs.private: @LIBS@ 11 | Requires: kj = @VERSION@ 12 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ @STDLIB_FLAG@ @CAPNP_LITE_FLAG@ 13 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/cmake/CapnProtoConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Example usage: 2 | # find_package(CapnProto) 3 | # capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS schema.capnp) 4 | # include_directories(${CMAKE_CURRENT_BINARY_DIR}) 5 | # add_executable(foo main.cpp ${CAPNP_SRCS}) 6 | # target_link_libraries(foo CapnProto::capnp) 7 | # 8 | # If you are using RPC features, use 'CapnProto::capnp-rpc' 9 | # in target_link_libraries call. 10 | # 11 | @PACKAGE_INIT@ 12 | 13 | set(CapnProto_VERSION @VERSION@) 14 | 15 | set(CAPNP_EXECUTABLE $) 16 | set(CAPNPC_CXX_EXECUTABLE $) 17 | set(CAPNP_INCLUDE_DIRECTORY "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@") 18 | 19 | # work around http://public.kitware.com/Bug/view.php?id=15258 20 | if(NOT _IMPORT_PREFIX) 21 | set(_IMPORT_PREFIX ${PACKAGE_PREFIX_DIR}) 22 | endif() 23 | 24 | 25 | 26 | include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoTargets.cmake") 27 | include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoMacros.cmake") 28 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/ekam-provider/c++header: -------------------------------------------------------------------------------- 1 | ../src -------------------------------------------------------------------------------- /third_party/capnproto/c++/ekam-provider/canonical: -------------------------------------------------------------------------------- 1 | ../src -------------------------------------------------------------------------------- /third_party/capnproto/c++/ekam-provider/this-dir-is-to-trick-gdb.txt: -------------------------------------------------------------------------------- 1 | The sole purpose of this directory is to allow GDB to find source files when 2 | debugging an executable compiled using Ekam, since the source locations found 3 | in the compiled binary will correspond to Ekam's virtual filesystem, not the 4 | real one. This is a hack, and doesn't always work. 5 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/kj-async.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: KJ Async Framework Library 7 | Description: Basic utility library called KJ (async part) 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lkj-async @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @STDLIB_FLAG@ 10 | Requires: kj = @VERSION@ 11 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ @STDLIB_FLAG@ @CAPNP_LITE_FLAG@ 12 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/kj.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: KJ Framework Library 7 | Description: Basic utility library called KJ 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lkj @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @STDLIB_FLAG@ 10 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ @STDLIB_FLAG@ @CAPNP_LITE_FLAG@ 11 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/regenerate-bootstraps.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | export PATH=$PWD/bin:$PWD:$PATH 6 | 7 | capnp compile -Isrc --no-standard-import --src-prefix=src -oc++:src \ 8 | src/capnp/c++.capnp src/capnp/schema.capnp \ 9 | src/capnp/compiler/lexer.capnp src/capnp/compiler/grammar.capnp \ 10 | src/capnp/rpc.capnp src/capnp/rpc-twoparty.capnp src/capnp/persistent.capnp \ 11 | src/capnp/compat/json.capnp 12 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/samples/test.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | # 3 | # Quick script that compiles and runs the samples, then cleans up. 4 | # Used for release testing. 5 | 6 | set -exuo pipefail 7 | 8 | capnpc -oc++ addressbook.capnp 9 | c++ -std=c++11 -Wall addressbook.c++ addressbook.capnp.c++ \ 10 | $(pkg-config --cflags --libs capnp) -o addressbook 11 | ./addressbook write | ./addressbook read 12 | ./addressbook dwrite | ./addressbook dread 13 | rm addressbook addressbook.capnp.c++ addressbook.capnp.h 14 | 15 | capnpc -oc++ calculator.capnp 16 | c++ -std=c++11 -Wall calculator-client.c++ calculator.capnp.c++ \ 17 | $(pkg-config --cflags --libs capnp-rpc) -o calculator-client 18 | c++ -std=c++11 -Wall calculator-server.c++ calculator.capnp.c++ \ 19 | $(pkg-config --cflags --libs capnp-rpc) -o calculator-server 20 | rm -f /tmp/capnp-calculator-example-$$ 21 | ./calculator-server unix:/tmp/capnp-calculator-example-$$ & 22 | sleep 0.1 23 | ./calculator-client unix:/tmp/capnp-calculator-example-$$ 24 | kill %+ 25 | wait %+ || true 26 | rm calculator-client calculator-server calculator.capnp.c++ calculator.capnp.h /tmp/capnp-calculator-example-$$ 27 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/setup-autotools.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "This script is no longer needed. Go ahead and run autoreconf. For example:" 6 | echo " autoreconf -i && ./configure && make -j6 check && sudo make install" 7 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/c++.capnp.h: -------------------------------------------------------------------------------- 1 | // Generated by Cap'n Proto compiler, DO NOT EDIT 2 | // source: c++.capnp 3 | 4 | #ifndef CAPNP_INCLUDED_bdf87d7bb8304e81_ 5 | #define CAPNP_INCLUDED_bdf87d7bb8304e81_ 6 | 7 | #include 8 | 9 | #if CAPNP_VERSION != 6001 10 | #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." 11 | #endif 12 | 13 | 14 | namespace capnp { 15 | namespace schemas { 16 | 17 | CAPNP_DECLARE_SCHEMA(b9c6f99ebf805f2c); 18 | CAPNP_DECLARE_SCHEMA(f264a779fef191ce); 19 | 20 | } // namespace schemas 21 | } // namespace capnp 22 | 23 | namespace capnp { 24 | namespace annotations { 25 | 26 | // ======================================================================================= 27 | 28 | // ======================================================================================= 29 | 30 | } // namespace 31 | } // namespace 32 | 33 | #endif // CAPNP_INCLUDED_bdf87d7bb8304e81_ 34 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/compiler/capnp.ekam-manifest: -------------------------------------------------------------------------------- 1 | capnp bin 2 | capnpc-capnp bin 3 | capnpc-c++ bin 4 | -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/binary: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/binary -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/flat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/flat -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/lists.binary: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/lists.binary -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/packed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/packed -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/packedflat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/packedflat -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/segmented: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/segmented -------------------------------------------------------------------------------- /third_party/capnproto/c++/src/capnp/testdata/segmented-packed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/c++/src/capnp/testdata/segmented-packed -------------------------------------------------------------------------------- /third_party/capnproto/doc/README.md: -------------------------------------------------------------------------------- 1 | # Cap'n Proto Documentation 2 | 3 | This directory contains the "source code" for the Cap'n Proto web site. 4 | 5 | The site is built with [Jekyll](http://jekyllrb.com/), which depends on Ruby. 6 | Start by installing ruby1.9.1-dev. On Debian-based operating systems: 7 | 8 | sudo apt-get install ruby-dev 9 | 10 | Then install Jekyll: 11 | 12 | sudo gem install jekyll pygments.rb 13 | 14 | Now install Pygments and SetupTools to be able to install the CapnProto lexer. 15 | On Debian based operating systems: 16 | 17 | sudo apt-get install python-pygments python-setuptools 18 | 19 | Next, install the custom Pygments syntax highlighter: 20 | 21 | cd _plugins 22 | sudo python capnp_lexer.py install 23 | cd .. 24 | 25 | Now you can launch a local server: 26 | 27 | jekyll serve --watch 28 | 29 | Edit, test, commit. 30 | 31 | If you have permission, after you've pushed your changes back to github, you can make your changes live by running: 32 | 33 | ./push-site.sh 34 | 35 | Otherwise, send a pull request and let someone else actually push the new site. 36 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_config.yml: -------------------------------------------------------------------------------- 1 | safe: true 2 | permalink: /news/:year-:month-:day-:title.html 3 | baseurl: / 4 | is_next: false 5 | highlighter: pygments 6 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_config_next.yml: -------------------------------------------------------------------------------- 1 | safe: true 2 | permalink: /news/:year-:month-:day-:title.html 3 | baseurl: /next/ 4 | is_next: true 5 | highlighter: pygments 6 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_includes/buttons.html: -------------------------------------------------------------------------------- 1 |
2 | Develop 4 | Discuss 6 | Stay Updated 8 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_layouts/page.html: -------------------------------------------------------------------------------- 1 | {% include header.html %} 2 | {{ content }} 3 | {% include footer.html %} 4 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_layouts/post.html: -------------------------------------------------------------------------------- 1 | {% include header.html %} 2 | 3 | 5 | 6 |

News

7 | 8 |

{{ page.title }}

9 |

10 | {{ page.author }} 11 | on {{ page.date | date_to_string }} 12 |

13 | {{ content }} 14 | 19 | {% include footer.html %} 20 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_posts/2013-04-01-announcing-capn-proto.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Announcing Cap'n Proto 4 | author: kentonv 5 | --- 6 | 7 | 8 | 9 | So, uh... I have a confession to make. 10 | 11 | I may have rewritten Protocol Buffers. 12 | 13 | Again. 14 | 15 | [And it's infinity times faster.](https://capnproto.org) 16 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_posts/2013-08-19-capnproto-0.2.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "Cap'n Proto v0.2.1: Minor bug fixes" 4 | author: kentonv 5 | --- 6 | 7 | Cap'n Proto was just bumped to v0.2.1. This release contains a couple bug fixes, including 8 | a work-around for [a GCC bug](http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58192). If you were 9 | observing any odd memory corruption or crashes in 0.2.0 -- especially if you are compiling with 10 | GCC with optimization enabled but without `-DNDEBUG` -- you should upgrade. 11 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_posts/2015-01-23-capnproto-0.5.1-bugfixes.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "Cap'n Proto 0.5.1: Bugfixes" 4 | author: kentonv 5 | --- 6 | 7 | Cap'n Proto 0.5.1 has just been released with some bug fixes: 8 | 9 | * On Windows, the `capnp` tool would crash when it tried to generate an ID, e.g. when using `capnp id` or when compiling a file that was missing the file ID, because it tried to get random bytes from `/dev/urandom`, which of course doesn't exist on Windows. Oops. Now it uses `CryptGenRandom()`. 10 | * Declaring a generic method (with method-specific type parameters) inside a generic interface generated code that didn't compile. 11 | * `joinPromises()` didn't work on an array of `Promise`. 12 | * Unnecessary error messages were being printed to the console when RPC clients disconnected. 13 | 14 | Sorry about the bugs. 15 | 16 | In other news, as you can see, the Cap'n Proto web site now lives at `capnproto.org`. Additionally, the Github repo has been moved to the [Sandstorm.io organization](https://github.com/sandstorm-io). Both moves have left behind redirects so that old links / repository references should continue to work. 17 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/_posts/2015-03-05-another-cpu-amplification.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "Another security advisory -- Additional CPU amplification case" 4 | author: kentonv 5 | --- 6 | 7 | Unfortunately, it turns out that our fix for one of [the security advisories issued on Monday](2015-03-02-security-advisory-and-integer-overflow-protection.html) was not complete. 8 | 9 | Fortunately, the incomplete fix is for the non-critical vulnerability. The worst case is that an attacker could consume excessive CPU time. 10 | 11 | Nevertheless, we've issued [a new advisory](https://github.com/sandstorm-io/capnproto/tree/master/security-advisories/2015-03-05-0-c++-addl-cpu-amplification.md) and pushed a new release: 12 | 13 | - Release 0.5.1.2: [source](https://capnproto.org/capnproto-c++-0.5.1.2.tar.gz), [win32](https://capnproto.org/capnproto-c++-win32-0.5.1.2.zip) 14 | - Release 0.4.1.2: [source](https://capnproto.org/capnproto-c++-0.4.1.2.tar.gz) 15 | 16 | Sorry for the rapid repeated releases, but we don't like sitting on security bugs. 17 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/feed.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: none 3 | --- 4 | 5 | 6 | 7 | 8 | Cap'n Proto News 9 | Latest updates on Cap'n Proto 10 | https://capnproto.org 11 | 12 | {% for post in site.posts limit:10 %} 13 | 14 | {{ post.title | xml_escape }} 15 | {{ post.content | xml_escape }} 16 | {{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }} 17 | {{ site.baseurl }}{{ post.url }} 18 | {{ site.baseurl }}{{ post.url }} 19 | 20 | {% endfor %} 21 | 22 | 23 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/bg_hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/bg_hr.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/blacktocat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/blacktocat.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/capnp-vs-ice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/capnp-vs-ice.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/capnp-vs-thrift-vs-ice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/capnp-vs-thrift-vs-ice.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/gittip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/gittip.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/gittip15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/gittip15.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/groups-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/groups-logo.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/icon_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/icon_download.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/infinitely_faster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/infinitely_faster.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/infinity-times-faster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/infinity-times-faster.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/logo.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/sprite_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/sprite_download.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/images/time-travel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/images/time-travel.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/news/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: News 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | 9 | 10 |

News

11 | 12 | {% for post in site.posts %} 13 |

{{ post.title }}

14 |

15 | {{ post.author }} 16 | {% if post.author == 'kentonv' %} 17 | {% endif %} 18 | on {{ post.date | date_to_string }} 19 |

20 | {{ post.content }} 21 | {% endfor %} 22 | 23 | {% include footer.html %} 24 | -------------------------------------------------------------------------------- /third_party/capnproto/doc/slides-2017.05.18/3ph-0rt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/slides-2017.05.18/3ph-0rt.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/slides-2017.05.18/3ph-proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/slides-2017.05.18/3ph-proxy.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/slides-2017.05.18/3ph-redirect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/slides-2017.05.18/3ph-redirect.png -------------------------------------------------------------------------------- /third_party/capnproto/doc/slides-2017.05.18/3ph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/capnproto/doc/slides-2017.05.18/3ph.png -------------------------------------------------------------------------------- /third_party/capnproto/highlighting/emacs/README.md: -------------------------------------------------------------------------------- 1 | Syntax Coloring for Emacs 2 | ========================= 3 | 4 | How to use: 5 | 6 | Add this to your .emacs file (altering the path to wherever your 7 | capnproto directory lives): 8 | 9 | ```elisp 10 | (add-to-list 'load-path "~/src/capnproto/highlighting/emacs") 11 | (require 'capnp-mode) 12 | (add-to-list 'auto-mode-alist '("\\.capnp\\'" . capnp-mode)) 13 | ``` 14 | -------------------------------------------------------------------------------- /third_party/capnproto/mega-test-kenton-home.cfg: -------------------------------------------------------------------------------- 1 | linux-gcc-4.9 9717 ./super-test.sh tmpdir capnp-gcc-4.9 -j8 gcc-4.9 2 | linux-gcc 9720 ./super-test.sh tmpdir capnp-gcc -j8 3 | linux-clang-3.5 9855 ./super-test.sh tmpdir capnp-clang-3.5 -j8 compiler clang++-3.5 4 | linux-clang-5.0 9858 ./super-test.sh tmpdir capnp-clang-5.0 -j8 compiler clang++-5.0 5 | mac 7037 ./super-test.sh remote beat caffeinate 6 | cygwin 8465 ./super-test.sh remote Kenton@flashman 7 | -------------------------------------------------------------------------------- /third_party/capnproto/mega-test-kenton-work.cfg: -------------------------------------------------------------------------------- 1 | linux-gcc-5 9717 ./super-test.sh tmpdir capnp-gcc-5 compiler g++-5 2 | linux-gcc-6 9710 ./super-test.sh tmpdir capnp-gcc-6 compiler g++-6 3 | linux-clang-3 9855 ./super-test.sh tmpdir capnp-clang-3 compiler clang++-3.8 4 | linux-clang-5 9858 ./super-test.sh tmpdir capnp-clang-5 compiler clang++-5.0 5 | exotic 4759 ./super-test.sh tmpdir capnp-exotic exotic 6 | -------------------------------------------------------------------------------- /third_party/capnproto/mega-test-quick.cfg: -------------------------------------------------------------------------------- 1 | linux-gcc-4.9 950 ./super-test.sh tmpdir capnp-gcc-4.9 quick gcc-4.9 2 | linux-gcc-4.8 950 ./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8 3 | linux-clang 980 ./super-test.sh tmpdir capnp-clang quick clang 4 | mac 905 ./super-test.sh remote beat caffeinate quick 5 | cygwin 945 ./super-test.sh remote Kenton@flashman quick 6 | -------------------------------------------------------------------------------- /third_party/capnproto/security-advisories/README.md: -------------------------------------------------------------------------------- 1 | # Security Advisories 2 | 3 | This directory contains security advisories issued for Cap'n Proto. 4 | 5 | Each advisory explains not just the bug that was fixed, but measures we are taking to avoid the class of bugs in the future. 6 | 7 | Note that Cap'n Proto has not yet undergone formal security review and therefore should not yet be trusted for reading possibly-malicious input. Even so, Cap'n Proto intends to be secure and we treat security bugs no less seriously than we would had security review already taken place. 8 | 9 | ## Reporting Bugs 10 | 11 | Please report security bugs to [security@sandstorm.io](mailto:security@sandstorm.io). 12 | -------------------------------------------------------------------------------- /third_party/eclipse/cxx_header_template.xml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /third_party/eclipse/cxx_source_template.xml: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /third_party/libcount/hll_limits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 The libcount Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. See the AUTHORS file for names of 15 | contributors. 16 | */ 17 | 18 | #ifndef INCLUDE_COUNT_HLL_LIMITS_H_ 19 | #define INCLUDE_COUNT_HLL_LIMITS_H_ 20 | 21 | #ifdef __cplusplus 22 | namespace libcount { 23 | #endif 24 | 25 | enum { 26 | /* Minimum and maximum precision values allowed. */ 27 | HLL_MIN_PRECISION = 4, 28 | HLL_MAX_PRECISION = 18 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } // namespace libcount 33 | #endif 34 | 35 | #endif // INCLUDE_COUNT_HLL_LIMITS_H_ 36 | -------------------------------------------------------------------------------- /third_party/libcuckoo/city_hasher.hh: -------------------------------------------------------------------------------- 1 | #ifndef _CITY_HASHER_HH 2 | #define _CITY_HASHER_HH 3 | 4 | #include 5 | #include 6 | 7 | /*! CityHasher is a std::hash-style wrapper around CityHash. We 8 | * encourage using CityHasher instead of the default std::hash if 9 | * possible. */ 10 | template 11 | class CityHasher { 12 | public: 13 | size_t operator()(const Key& k) const { 14 | return CityHash64((const char*) &k, sizeof(k)); 15 | } 16 | }; 17 | 18 | /*! This is a template specialization of CityHasher for 19 | * std::string. */ 20 | template <> 21 | class CityHasher { 22 | public: 23 | size_t operator()(const std::string& k) const { 24 | return CityHash64(k.c_str(), k.size()); 25 | } 26 | }; 27 | 28 | #endif // _CITY_HASHER_HH 29 | -------------------------------------------------------------------------------- /third_party/libcuckoo/default_hasher.hh: -------------------------------------------------------------------------------- 1 | #ifndef _DEFAULT_HASHER_HH 2 | #define _DEFAULT_HASHER_HH 3 | 4 | #include 5 | #include 6 | 7 | /*! DefaultHasher is the default hash class used in the table. It overloads a 8 | * few types that std::hash does badly on (namely integers), and falls back to 9 | * std::hash for anything else. */ 10 | template 11 | class DefaultHasher { 12 | std::hash fallback; 13 | 14 | public: 15 | template 16 | typename std::enable_if::value, size_t>::type 17 | operator()(const Key& k) const { 18 | // This constant is found in the CityHash code 19 | return k * 0x9ddfea08eb382d69ULL; 20 | } 21 | 22 | template 23 | typename std::enable_if::value, size_t>::type 24 | operator()(const Key& k) const { 25 | return fallback(k); 26 | } 27 | }; 28 | 29 | #endif // _DEFAULT_HASHER_HH 30 | -------------------------------------------------------------------------------- /third_party/libpg_query/.gitignore: -------------------------------------------------------------------------------- 1 | postgres/* 2 | postgres.tar.bz2 3 | 4 | *.o 5 | *.a 6 | 7 | examples/* 8 | !examples/*.c 9 | 10 | test/* 11 | !test/*.c 12 | !test/*.sql 13 | !test/*.expected.json 14 | 15 | tmp/* 16 | !tmp/.gitkeep 17 | -------------------------------------------------------------------------------- /third_party/libpg_query/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | script: make 3 | compiler: 4 | - clang 5 | - gcc 6 | -------------------------------------------------------------------------------- /third_party/libpg_query/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.7) 2 | 3 | # ---[ Peloton project 4 | project(pg_query CXX C) 5 | 6 | # this code imitates the Makefile in /third_party/libpg_query/ 7 | file(GLOB_RECURSE pg_query_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c) 8 | list(REMOVE_ITEM pg_query_srcs 9 | "${CMAKE_CURRENT_SOURCE_DIR}/src/pg_query_fingerprint_defs.c" 10 | "${CMAKE_CURRENT_SOURCE_DIR}/src/pg_query_fingerprint_conds.c" 11 | "${CMAKE_CURRENT_SOURCE_DIR}/src/pg_query_json_defs.c" 12 | "${CMAKE_CURRENT_SOURCE_DIR}/src/pg_query_json_conds.c" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/src/postgres/guc-file.c" 14 | "${CMAKE_CURRENT_SOURCE_DIR}/src/postgres/scan.c" 15 | "${CMAKE_CURRENT_SOURCE_DIR}/src/pg_query_json_helper.c") 16 | 17 | include_directories(.) 18 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/postgres/include) 19 | 20 | add_library(pg_query STATIC ${pg_query_srcs}) 21 | 22 | set_target_properties(pg_query PROPERTIES LINKER_LANGUAGE C) 23 | set_target_properties(pg_query PROPERTIES POSITION_INDEPENDENT_CODE ON) -------------------------------------------------------------------------------- /third_party/libpg_query/examples/normalize.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | PgQueryNormalizeResult result; 7 | 8 | result = pg_query_normalize("SELECT 1"); 9 | 10 | if (result.error) { 11 | printf("error: %s at %d\n", result.error->message, result.error->cursorpos); 12 | } else { 13 | printf("%s\n", result.normalized_query); 14 | } 15 | 16 | pg_query_free_normalize_result(result); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /third_party/libpg_query/examples/normalize_error.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | PgQueryNormalizeResult result; 7 | 8 | result = pg_query_normalize("SELECT $$$"); 9 | 10 | if (result.error) { 11 | printf("error: %s at location %d (%s:%d)\n", result.error->message, 12 | result.error->cursorpos, result.error->filename, result.error->lineno); 13 | } else { 14 | printf("%s\n", result.normalized_query); 15 | } 16 | 17 | pg_query_free_normalize_result(result); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /third_party/libpg_query/examples/simple.c: -------------------------------------------------------------------------------- 1 | // Welcome to the easiest way to parse an SQL query :-) 2 | // Compile the file like this: 3 | // 4 | // cc -I../ -L../ -lpg_query simple.c 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | size_t testCount = 7; 11 | const char* tests[] = { 12 | "SELECT 1", 13 | "SELECT * FROM x WHERE z = 2", 14 | "SELECT 5.41414", 15 | "SELECT $1", 16 | "SELECT ?", 17 | "SELECT 999999999999999999999::numeric/1000000000000000000000", 18 | "SELECT 4790999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999" 19 | }; 20 | 21 | int main() { 22 | PgQueryParseResult result; 23 | size_t i; 24 | 25 | for (i = 0; i < testCount; i++) { 26 | result = pg_query_parse(tests[i]); 27 | 28 | if (result.error) { 29 | printf("error: %s at %d\n", result.error->message, result.error->cursorpos); 30 | } else { 31 | printf("%s\n", result.parse_tree); 32 | } 33 | 34 | pg_query_free_parse_result(result); 35 | } 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /third_party/libpg_query/examples/simple_error.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | PgQueryParseResult result; 7 | 8 | result = pg_query_parse("INSERT FROM DOES NOT WORK"); 9 | 10 | if (result.error) { 11 | printf("error: %s at location %d (%s in %s:%d)\n", result.error->message, 12 | result.error->cursorpos, result.error->funcname, result.error->filename, result.error->lineno); 13 | } else { 14 | printf("%s\n", result.parse_tree); 15 | } 16 | 17 | pg_query_free_parse_result(result); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /third_party/libpg_query/examples/simple_plpgsql.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | PgQueryPlpgsqlParseResult result; 7 | 8 | result = pg_query_parse_plpgsql(" \ 9 | CREATE OR REPLACE FUNCTION cs_fmt_browser_version(v_name varchar, \ 10 | v_version varchar) \ 11 | RETURNS varchar AS $$ \ 12 | BEGIN \ 13 | IF v_version IS NULL THEN \ 14 | RETURN v_name; \ 15 | END IF; \ 16 | RETURN v_name || '/' || v_version; \ 17 | END; \ 18 | $$ LANGUAGE plpgsql;"); 19 | 20 | if (result.error) { 21 | printf("error: %s at %d\n", result.error->message, result.error->cursorpos); 22 | } else { 23 | printf("%s\n", result.plpgsql_funcs); 24 | } 25 | 26 | pg_query_free_plpgsql_parse_result(result); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /third_party/libpg_query/scripts/generate_fingerprint_tests.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'bundler' 4 | require 'json' 5 | 6 | class Generator 7 | def initialize 8 | @fingerprint_tests = JSON.parse(File.read('./testdata/fingerprint.json')) 9 | end 10 | 11 | def generate! 12 | test_lines = [] 13 | 14 | @fingerprint_tests.each do |test_def| 15 | test_lines << test_def['input'] 16 | test_lines << test_def['expectedHash'] 17 | end 18 | 19 | File.write './test/fingerprint_tests.c', <<-EOF 20 | const char* tests[] = { 21 | #{test_lines.map { |test_line| format(' %s,', test_line.inspect) }.join("\n")} 22 | }; 23 | 24 | size_t testsLength = __LINE__ - 4; 25 | EOF 26 | end 27 | end 28 | 29 | Generator.new.generate! 30 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/pg_query_fingerprint.h: -------------------------------------------------------------------------------- 1 | #ifndef PG_QUERY_FINGERPRINT_H 2 | #define PG_QUERY_FINGERPRINT_H 3 | 4 | #include 5 | 6 | PgQueryFingerprintResult pg_query_fingerprint_with_opts(const char* input, bool printTokens); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/pg_query_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef PG_QUERY_INTERNAL_H 2 | #define PG_QUERY_INTERNAL_H 3 | 4 | #include "postgres.h" 5 | #include "utils/memutils.h" 6 | #include "nodes/pg_list.h" 7 | #include "pg_query.h" 8 | 9 | #define STDERR_BUFFER_LEN 4096 10 | #define DEBUG 11 | 12 | PgQueryInternalParsetreeAndError pg_query_raw_parse(const char* input); 13 | 14 | void pg_query_free_error(PgQueryError *error); 15 | 16 | MemoryContext pg_query_enter_memory_context(const char* ctx_name); 17 | void pg_query_exit_memory_context(MemoryContext ctx); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/pg_query_json.h: -------------------------------------------------------------------------------- 1 | #ifndef PG_QUERY_JSON_H 2 | #define PG_QUERY_JSON_H 3 | 4 | char *pg_query_nodes_to_json(const void *obj); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/pg_query_json_plpgsql.h: -------------------------------------------------------------------------------- 1 | #ifndef PG_QUERY_JSON_PLPGSQL_H 2 | #define PG_QUERY_JSON_PLPGSQL_H 3 | 4 | #include "plpgsql.h" 5 | 6 | char* plpgsqlToJSON(PLpgSQL_function* func); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/guc-file.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmu-db/peloton/484d76df9344cb5c153a2c361c5d5018912d4cf4/third_party/libpg_query/src/postgres/guc-file.c -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/access/rmgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rmgr.h 3 | * 4 | * Resource managers definition 5 | * 6 | * src/include/access/rmgr.h 7 | */ 8 | #ifndef RMGR_H 9 | #define RMGR_H 10 | 11 | typedef uint8 RmgrId; 12 | 13 | /* 14 | * Built-in resource managers 15 | * 16 | * The actual numerical values for each rmgr ID are defined by the order 17 | * of entries in rmgrlist.h. 18 | * 19 | * Note: RM_MAX_ID must fit in RmgrId; widening that type will affect the XLOG 20 | * file format. 21 | */ 22 | #define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup) \ 23 | symname, 24 | 25 | typedef enum RmgrIds 26 | { 27 | #include "access/rmgrlist.h" 28 | RM_NEXT_ID 29 | } RmgrIds; 30 | 31 | #undef PG_RMGR 32 | 33 | #define RM_MAX_ID (RM_NEXT_ID - 1) 34 | 35 | #endif /* RMGR_H */ 36 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/access/sysattr.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * sysattr.h 4 | * POSTGRES system attribute definitions. 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/access/sysattr.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef SYSATTR_H 15 | #define SYSATTR_H 16 | 17 | 18 | /* 19 | * Attribute numbers for the system-defined attributes 20 | */ 21 | #define SelfItemPointerAttributeNumber (-1) 22 | #define ObjectIdAttributeNumber (-2) 23 | #define MinTransactionIdAttributeNumber (-3) 24 | #define MinCommandIdAttributeNumber (-4) 25 | #define MaxTransactionIdAttributeNumber (-5) 26 | #define MaxCommandIdAttributeNumber (-6) 27 | #define TableOidAttributeNumber (-7) 28 | #define FirstLowInvalidHeapAttributeNumber (-8) 29 | 30 | #endif /* SYSATTR_H */ 31 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/catalog/pg_conversion_fn.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * pg_conversion_fn.h 4 | * prototypes for functions in catalog/pg_conversion.c 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/catalog/pg_conversion_fn.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef PG_CONVERSION_FN_H 15 | #define PG_CONVERSION_FN_H 16 | 17 | 18 | #include "catalog/objectaddress.h" 19 | 20 | extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace, 21 | Oid conowner, 22 | int32 conforencoding, int32 contoencoding, 23 | Oid conproc, bool def); 24 | extern void RemoveConversionById(Oid conversionOid); 25 | extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding); 26 | 27 | #endif /* PG_CONVERSION_FN_H */ 28 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/libpq/auth.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * auth.h 4 | * Definitions for network authentication routines 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/libpq/auth.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef AUTH_H 15 | #define AUTH_H 16 | 17 | #include "libpq/libpq-be.h" 18 | 19 | extern char *pg_krb_server_keyfile; 20 | extern bool pg_krb_caseins_users; 21 | extern char *pg_krb_realm; 22 | 23 | extern void ClientAuthentication(Port *port); 24 | 25 | /* Hook for plugins to get control in ClientAuthentication() */ 26 | typedef void (*ClientAuthentication_hook_type) (Port *, int); 27 | extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook; 28 | 29 | #endif /* AUTH_H */ 30 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/parser/parse_collate.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * parse_collate.h 4 | * Routines for assigning collation information. 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/parser/parse_collate.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef PARSE_COLLATE_H 15 | #define PARSE_COLLATE_H 16 | 17 | #include "parser/parse_node.h" 18 | 19 | extern void assign_query_collations(ParseState *pstate, Query *query); 20 | 21 | extern void assign_list_collations(ParseState *pstate, List *exprs); 22 | 23 | extern void assign_expr_collations(ParseState *pstate, Node *expr); 24 | 25 | extern Oid select_common_collation(ParseState *pstate, List *exprs, bool none_ok); 26 | 27 | #endif /* PARSE_COLLATE_H */ 28 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/parser/parse_expr.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * parse_expr.h 4 | * handle expressions in parser 5 | * 6 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 7 | * Portions Copyright (c) 1994, Regents of the University of California 8 | * 9 | * src/include/parser/parse_expr.h 10 | * 11 | *------------------------------------------------------------------------- 12 | */ 13 | #ifndef PARSE_EXPR_H 14 | #define PARSE_EXPR_H 15 | 16 | #include "parser/parse_node.h" 17 | 18 | /* GUC parameters */ 19 | extern __thread bool operator_precedence_warning; 20 | extern bool Transform_null_equals; 21 | 22 | extern Node *transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind); 23 | 24 | extern const char *ParseExprKindName(ParseExprKind exprKind); 25 | 26 | #endif /* PARSE_EXPR_H */ 27 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/parser/scansup.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * scansup.h 4 | * scanner support routines. used by both the bootstrap lexer 5 | * as well as the normal lexer 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/parser/scansup.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | 15 | #ifndef SCANSUP_H 16 | #define SCANSUP_H 17 | 18 | extern char *scanstr(const char *s); 19 | 20 | extern char *downcase_truncate_identifier(const char *ident, int len, 21 | bool warn); 22 | 23 | extern void truncate_identifier(char *ident, int len, bool warn); 24 | 25 | extern bool scanner_isspace(char ch); 26 | 27 | #endif /* SCANSUP_H */ 28 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/pg_config_ext.h: -------------------------------------------------------------------------------- 1 | /* src/include/pg_config_ext.h. Generated from pg_config_ext.h.in by configure. */ 2 | /* 3 | * src/include/pg_config_ext.h.in. This is generated manually, not by 4 | * autoheader, since we want to limit which symbols get defined here. 5 | */ 6 | 7 | /* Define to the name of a signed 64-bit integer type. */ 8 | #define PG_INT64_TYPE long int 9 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/pg_config_os.h: -------------------------------------------------------------------------------- 1 | /* src/include/port/darwin.h */ 2 | 3 | #define __darwin__ 1 4 | 5 | #if HAVE_DECL_F_FULLFSYNC /* not present before OS X 10.3 */ 6 | #define HAVE_FSYNC_WRITETHROUGH 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/pg_trace.h: -------------------------------------------------------------------------------- 1 | /* ---------- 2 | * pg_trace.h 3 | * 4 | * Definitions for the PostgreSQL tracing framework 5 | * 6 | * Copyright (c) 2006-2015, PostgreSQL Global Development Group 7 | * 8 | * src/include/pg_trace.h 9 | * ---------- 10 | */ 11 | 12 | #ifndef PG_TRACE_H 13 | #define PG_TRACE_H 14 | 15 | #include "utils/probes.h" /* pgrminclude ignore */ 16 | 17 | #endif /* PG_TRACE_H */ 18 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/postmaster/fork_process.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * fork_process.h 4 | * Exports from postmaster/fork_process.c. 5 | * 6 | * Copyright (c) 1996-2015, PostgreSQL Global Development Group 7 | * 8 | * src/include/postmaster/fork_process.h 9 | * 10 | *------------------------------------------------------------------------- 11 | */ 12 | #ifndef FORK_PROCESS_H 13 | #define FORK_PROCESS_H 14 | 15 | extern pid_t fork_process(void); 16 | 17 | #endif /* FORK_PROCESS_H */ 18 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/postmaster/walwriter.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * walwriter.h 4 | * Exports from postmaster/walwriter.c. 5 | * 6 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 7 | * 8 | * src/include/postmaster/walwriter.h 9 | * 10 | *------------------------------------------------------------------------- 11 | */ 12 | #ifndef _WALWRITER_H 13 | #define _WALWRITER_H 14 | 15 | /* GUC options */ 16 | extern int WalWriterDelay; 17 | 18 | extern void WalWriterMain(void) pg_attribute_noreturn(); 19 | 20 | #endif /* _WALWRITER_H */ 21 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/rewrite/rewriteHandler.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * rewriteHandler.h 4 | * External interface to query rewriter. 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/rewrite/rewriteHandler.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef REWRITEHANDLER_H 15 | #define REWRITEHANDLER_H 16 | 17 | #include "utils/relcache.h" 18 | #include "nodes/parsenodes.h" 19 | 20 | extern List *QueryRewrite(Query *parsetree); 21 | extern void AcquireRewriteLocks(Query *parsetree, 22 | bool forExecute, 23 | bool forUpdatePushedDown); 24 | 25 | extern Node *build_column_default(Relation rel, int attrno); 26 | extern Query *get_view_query(Relation view); 27 | extern const char *view_query_is_auto_updatable(Query *viewquery, 28 | bool check_cols); 29 | extern int relation_is_updatable(Oid reloid, 30 | bool include_triggers, 31 | Bitmapset *include_cols); 32 | 33 | #endif /* REWRITEHANDLER_H */ 34 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/rewrite/rewriteSupport.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * rewriteSupport.h 4 | * 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/rewrite/rewriteSupport.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef REWRITESUPPORT_H 15 | #define REWRITESUPPORT_H 16 | 17 | /* The ON SELECT rule of a view is always named this: */ 18 | #define ViewSelectRuleName "_RETURN" 19 | 20 | extern bool IsDefinedRewriteRule(Oid owningRel, const char *ruleName); 21 | 22 | extern void SetRelationRuleStatus(Oid relationId, bool relHasRules); 23 | 24 | extern Oid get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok); 25 | extern Oid get_rewrite_oid_without_relid(const char *rulename, 26 | Oid *relid, bool missing_ok); 27 | 28 | #endif /* REWRITESUPPORT_H */ 29 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/storage/backendid.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * backendid.h 4 | * POSTGRES backend id communication definitions 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/storage/backendid.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef BACKENDID_H 15 | #define BACKENDID_H 16 | 17 | /* ---------------- 18 | * -cim 8/17/90 19 | * ---------------- 20 | */ 21 | typedef int BackendId; /* unique currently active backend identifier */ 22 | 23 | #define InvalidBackendId (-1) 24 | 25 | extern PGDLLIMPORT BackendId MyBackendId; /* backend id of this backend */ 26 | 27 | #endif /* BACKENDID_H */ 28 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/storage/barrier.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * barrier.h 4 | * Memory barrier operations. 5 | * 6 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 7 | * Portions Copyright (c) 1994, Regents of the University of California 8 | * 9 | * src/include/storage/barrier.h 10 | * 11 | *------------------------------------------------------------------------- 12 | */ 13 | #ifndef BARRIER_H 14 | #define BARRIER_H 15 | 16 | /* 17 | * This used to be a separate file, full of compiler/architecture 18 | * dependent defines, but it's not included in the atomics.h 19 | * infrastructure and just kept for backward compatibility. 20 | */ 21 | #include "port/atomics.h" 22 | 23 | #endif /* BARRIER_H */ 24 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/storage/item.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * item.h 4 | * POSTGRES disk item definitions. 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/storage/item.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef ITEM_H 15 | #define ITEM_H 16 | 17 | typedef Pointer Item; 18 | 19 | #endif /* ITEM_H */ 20 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/tcop/fastpath.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * fastpath.h 4 | * 5 | * 6 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 7 | * Portions Copyright (c) 1994, Regents of the University of California 8 | * 9 | * src/include/tcop/fastpath.h 10 | * 11 | *------------------------------------------------------------------------- 12 | */ 13 | #ifndef FASTPATH_H 14 | #define FASTPATH_H 15 | 16 | #include "lib/stringinfo.h" 17 | 18 | extern int GetOldFunctionMessage(StringInfo buf); 19 | extern int HandleFunctionRequest(StringInfo msgBuf); 20 | 21 | #endif /* FASTPATH_H */ 22 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/utils/dynamic_loader.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * dynamic_loader.h 4 | * 5 | * 6 | * 7 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 8 | * Portions Copyright (c) 1994, Regents of the University of California 9 | * 10 | * src/include/utils/dynamic_loader.h 11 | * 12 | *------------------------------------------------------------------------- 13 | */ 14 | #ifndef DYNAMIC_LOADER_H 15 | #define DYNAMIC_LOADER_H 16 | 17 | #include "fmgr.h" 18 | 19 | 20 | extern void *pg_dlopen(char *filename); 21 | extern PGFunction pg_dlsym(void *handle, char *funcname); 22 | extern void pg_dlclose(void *handle); 23 | extern char *pg_dlerror(void); 24 | 25 | #endif /* DYNAMIC_LOADER_H */ 26 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/include/utils/ps_status.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * 3 | * ps_status.h 4 | * 5 | * Declarations for backend/utils/misc/ps_status.c 6 | * 7 | * src/include/utils/ps_status.h 8 | * 9 | *------------------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef PS_STATUS_H 13 | #define PS_STATUS_H 14 | 15 | extern bool update_process_title; 16 | 17 | extern char **save_ps_display_args(int argc, char **argv); 18 | 19 | extern void init_ps_display(const char *username, const char *dbname, 20 | const char *host_info, const char *initial_str); 21 | 22 | extern void set_ps_display(const char *activity, bool force); 23 | 24 | extern const char *get_ps_display(int *displen); 25 | 26 | #endif /* PS_STATUS_H */ 27 | -------------------------------------------------------------------------------- /third_party/libpg_query/src/postgres/src_backend_parser_keywords.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------- 2 | * Symbols referenced in this file: 3 | * - ScanKeywords 4 | * - NumScanKeywords 5 | *-------------------------------------------------------------------- 6 | */ 7 | 8 | /*------------------------------------------------------------------------- 9 | * 10 | * keywords.c 11 | * lexical token lookup for key words in PostgreSQL 12 | * 13 | * 14 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group 15 | * Portions Copyright (c) 1994, Regents of the University of California 16 | * 17 | * 18 | * IDENTIFICATION 19 | * src/backend/parser/keywords.c 20 | * 21 | *------------------------------------------------------------------------- 22 | */ 23 | #include "postgres.h" 24 | 25 | #include "parser/gramparse.h" 26 | 27 | #define PG_KEYWORD(a,b,c) {a,b,c}, 28 | 29 | 30 | const ScanKeyword ScanKeywords[] = { 31 | #include "parser/kwlist.h" 32 | }; 33 | 34 | const int NumScanKeywords = lengthof(ScanKeywords); 35 | -------------------------------------------------------------------------------- /third_party/libpg_query/srcdata/all_known_enums.json: -------------------------------------------------------------------------------- 1 | [ 2 | "QuerySource", 3 | "SortByDir", 4 | "SortByNulls", 5 | "A_Expr_Kind", 6 | "RoleSpecType", 7 | "TableLikeOption", 8 | "DefElemAction", 9 | "RTEKind", 10 | "WCOKind", 11 | "GroupingSetKind", 12 | "SetOperation", 13 | "ObjectType", 14 | "DropBehavior", 15 | "AlterTableType", 16 | "GrantTargetType", 17 | "GrantObjectType", 18 | "VariableSetKind", 19 | "ConstrType", 20 | "ImportForeignSchemaType", 21 | "RoleStmtType", 22 | "FetchDirection", 23 | "FunctionParameterMode", 24 | "TransactionStmtKind", 25 | "ViewCheckOption", 26 | "VacuumOption", 27 | "DiscardMode", 28 | "ReindexObjectType", 29 | "AlterTSConfigType", 30 | "InhOption", 31 | "OnCommitAction", 32 | "ParamKind", 33 | "CoercionContext", 34 | "CoercionForm", 35 | "BoolExprType", 36 | "SubLinkType", 37 | "RowCompareType", 38 | "MinMaxOp", 39 | "XmlExprOp", 40 | "XmlOptionType", 41 | "NullTestType", 42 | "BoolTestType", 43 | "LockClauseStrength", 44 | "LockWaitPolicy", 45 | "NodeTag", 46 | "CmdType", 47 | "JoinType", 48 | "OnConflictAction", 49 | "vartag_external", 50 | "ScanDirection" 51 | ] -------------------------------------------------------------------------------- /third_party/libpg_query/test/fingerprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "fingerprint_tests.c" 9 | 10 | int main() { 11 | size_t i; 12 | bool ret_code = 0; 13 | 14 | for (i = 0; i < testsLength; i += 2) { 15 | PgQueryFingerprintResult result = pg_query_fingerprint(tests[i]); 16 | 17 | if (strcmp(result.hexdigest, tests[i + 1]) == 0) { 18 | printf("."); 19 | } else { 20 | ret_code = -1; 21 | printf("INVALID result for \"%s\"\nexpected: %s\nactual: %s\nactual tokens: ", tests[i], tests[i + 1], result.hexdigest); 22 | pg_query_fingerprint_with_opts(tests[i], true); 23 | } 24 | 25 | pg_query_free_fingerprint_result(result); 26 | } 27 | 28 | printf("\n"); 29 | 30 | return ret_code; 31 | } 32 | -------------------------------------------------------------------------------- /third_party/libpg_query/test/normalize.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "normalize_tests.c" 9 | 10 | int main() { 11 | size_t i; 12 | bool ret_code = 0; 13 | 14 | for (i = 0; i < testsLength; i += 2) { 15 | PgQueryNormalizeResult result = pg_query_normalize(tests[i]); 16 | 17 | if (strcmp(result.normalized_query, tests[i + 1]) == 0) { 18 | printf("."); 19 | } else { 20 | ret_code = -1; 21 | printf("INVALID result for \"%s\"\nexpected: %s\nactual: %s\n", tests[i], tests[i + 1], result.normalized_query); 22 | } 23 | 24 | pg_query_free_normalize_result(result); 25 | } 26 | 27 | printf("\n"); 28 | 29 | return ret_code; 30 | } 31 | -------------------------------------------------------------------------------- /third_party/libpg_query/test/normalize_tests.c: -------------------------------------------------------------------------------- 1 | const char* tests[] = { 2 | "SELECT 1", 3 | "SELECT ?", 4 | "ALTER ROLE postgres LOGIN SUPERUSER PASSWORD 'xyz'", 5 | "ALTER ROLE postgres LOGIN SUPERUSER PASSWORD ?" 6 | }; 7 | 8 | size_t testsLength = __LINE__ - 4; 9 | -------------------------------------------------------------------------------- /third_party/libpg_query/test/parse.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "parse_tests.c" 9 | 10 | int main() { 11 | size_t i; 12 | bool ret_code = 0; 13 | 14 | for (i = 0; i < testsLength; i += 2) { 15 | PgQueryParseResult result = pg_query_parse(tests[i]); 16 | 17 | if (strcmp(result.parse_tree, tests[i + 1]) == 0) { 18 | printf("."); 19 | } else { 20 | ret_code = -1; 21 | printf("INVALID result for \"%s\"\nexpected: %s\nactual: %s\n", tests[i], tests[i + 1], result.parse_tree); 22 | } 23 | 24 | pg_query_free_parse_result(result); 25 | } 26 | 27 | printf("\n"); 28 | 29 | return ret_code; 30 | } 31 | -------------------------------------------------------------------------------- /third_party/rapidjson/filestream.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_FILESTREAM_H_ 2 | #define RAPIDJSON_FILESTREAM_H_ 3 | 4 | #include 5 | 6 | namespace rapidjson { 7 | 8 | //! Wrapper of C file stream for input or output. 9 | /*! 10 | This simple wrapper does not check the validity of the stream. 11 | \implements Stream 12 | */ 13 | class FileStream { 14 | public: 15 | typedef char Ch; //!< Character type. Only support char. 16 | 17 | FileStream(FILE* fp) : fp_(fp), count_(0) { Read(); } 18 | char Peek() const { return current_; } 19 | char Take() { char c = current_; Read(); return c; } 20 | size_t Tell() const { return count_; } 21 | void Put(char c) { fputc(c, fp_); } 22 | 23 | // Not implemented 24 | char* PutBegin() { return 0; } 25 | size_t PutEnd(char*) { return 0; } 26 | 27 | private: 28 | void Read() { 29 | RAPIDJSON_ASSERT(fp_ != 0); 30 | int c = fgetc(fp_); 31 | if (c != EOF) { 32 | current_ = (char)c; 33 | count_++; 34 | } 35 | else 36 | current_ = '\0'; 37 | } 38 | 39 | FILE* fp_; 40 | char current_; 41 | size_t count_; 42 | }; 43 | 44 | } // namespace rapidjson 45 | 46 | #endif // RAPIDJSON_FILESTREAM_H_ 47 | -------------------------------------------------------------------------------- /third_party/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 2 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 3 | 4 | namespace rapidjson { 5 | namespace internal { 6 | 7 | //! Custom strlen() which works on different character types. 8 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 9 | \param s Null-terminated input string. 10 | \return Number of characters in the string. 11 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 12 | */ 13 | template 14 | inline SizeType StrLen(const Ch* s) { 15 | const Ch* p = s; 16 | while (*p != '\0') 17 | ++p; 18 | return SizeType(p - s); 19 | } 20 | 21 | } // namespace internal 22 | } // namespace rapidjson 23 | 24 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 25 | --------------------------------------------------------------------------------