From d50139351f3ed88b495c6b49247c06a3bb4bddad Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 12 May 2015 16:22:12 +0300 Subject: [PATCH 1/3] cql3: Use pragma once everywhere There's no benefit to using C include guards so switch to pragma once everywhere for consistency. Signed-off-by: Pekka Enberg --- cql3/abstract_marker.hh | 5 +---- cql3/assignment_testable.hh | 5 +---- cql3/attributes.hh | 6 +----- cql3/cf_name.hh | 5 +---- cql3/column_condition.hh | 5 +---- cql3/column_identifier.hh | 5 +---- cql3/column_specification.hh | 5 +---- cql3/constants.hh | 5 +---- cql3/cql_statement.hh | 5 +---- cql3/functions/abstract_function.hh | 5 +---- cql3/functions/aggregate_function.hh | 5 +---- cql3/functions/function.hh | 5 +---- cql3/functions/function_name.hh | 5 +---- cql3/functions/native_aggregate_function.hh | 6 +----- cql3/functions/native_function.hh | 5 +---- cql3/functions/native_scalar_function.hh | 5 +---- cql3/functions/scalar_function.hh | 5 +---- cql3/lists.hh | 5 +---- cql3/maps.hh | 5 +---- cql3/operation.hh | 5 +---- cql3/query_options.hh | 5 +---- cql3/selection/selectable.hh | 5 +---- cql3/sets.hh | 5 +---- cql3/statements/alter_keyspace_statement.hh | 5 +---- cql3/statements/alter_type_statement.hh | 5 +---- cql3/statements/cf_statement.hh | 5 +---- cql3/statements/ks_prop_defs.hh | 5 +---- cql3/statements/modification_statement.hh | 5 +---- cql3/statements/parsed_statement.hh | 5 +---- cql3/statements/select_statement.hh | 5 +---- cql3/statements/truncate_statement.hh | 5 +---- cql3/statements/update_statement.hh | 5 +---- cql3/term.hh | 5 +---- cql3/update_parameters.hh | 5 +---- cql3/ut_name.hh | 5 +---- cql3/variable_specifications.hh | 5 +---- 36 files changed, 36 insertions(+), 146 deletions(-) diff --git a/cql3/abstract_marker.hh b/cql3/abstract_marker.hh index 29ad6d1932..9ed22830be 100644 --- a/cql3/abstract_marker.hh +++ b/cql3/abstract_marker.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_ABSTRACT_MARKER_HH -#define CQL3_ABSTRACT_MARKER_HH +#pragma once #include "cql3/variable_specifications.hh" #include "cql3/column_specification.hh" @@ -100,5 +99,3 @@ public: }; } - -#endif diff --git a/cql3/assignment_testable.hh b/cql3/assignment_testable.hh index c4d6703e72..a86e34f0b0 100644 --- a/cql3/assignment_testable.hh +++ b/cql3/assignment_testable.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_ASSIGNMENT_TESTABLE_HH -#define CQL3_ASSIGNMENT_TESTABLE_HH +#pragma once #include "column_specification.hh" #include @@ -104,5 +103,3 @@ operator<<(std::ostream& os, const assignment_testable& at) { } } - -#endif diff --git a/cql3/attributes.hh b/cql3/attributes.hh index 634dbfdde0..8f54caf092 100644 --- a/cql3/attributes.hh +++ b/cql3/attributes.hh @@ -22,9 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_ATTRIBUTES_HH -#define CQL3_ATTRIBUTES_HH - +#pragma once #include "exceptions/exceptions.hh" #include "cql3/term.hh" @@ -144,5 +142,3 @@ public: }; } - -#endif diff --git a/cql3/cf_name.hh b/cql3/cf_name.hh index 76df0b4879..c2a9cc9258 100644 --- a/cql3/cf_name.hh +++ b/cql3/cf_name.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_CFNAME_HH -#define CQL3_CFNAME_HH +#pragma once #include @@ -74,5 +73,3 @@ operator<<(std::ostream& os, const cf_name& n) { } } - -#endif diff --git a/cql3/column_condition.hh b/cql3/column_condition.hh index c5bf238b35..07cb8d51fe 100644 --- a/cql3/column_condition.hh +++ b/cql3/column_condition.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_COLUMN_CONDITION_HH -#define CQL3_COLUMN_CONDITION_HH +#pragma once #include "cql3/term.hh" #include "cql3/abstract_marker.hh" @@ -763,5 +762,3 @@ public: }; } - -#endif diff --git a/cql3/column_identifier.hh b/cql3/column_identifier.hh index fcdeaaaf1e..3d7184effd 100644 --- a/cql3/column_identifier.hh +++ b/cql3/column_identifier.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_COLUMN_IDENTIFIER_HH -#define CQL3_COLUMN_IDENTIFIER_HH +#pragma once #include "cql3/selection/selectable.hh" @@ -216,5 +215,3 @@ struct hash { }; } - -#endif diff --git a/cql3/column_specification.hh b/cql3/column_specification.hh index 34df553488..d36db293a1 100644 --- a/cql3/column_specification.hh +++ b/cql3/column_specification.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_COLUMN_SPECIFICATION_HH -#define CQL3_COLUMN_SPECIFICATION_HH +#pragma once #include "db/marshal/reversed_type.hh" #include "types.hh" @@ -63,5 +62,3 @@ public: }; } - -#endif diff --git a/cql3/constants.hh b/cql3/constants.hh index 4ee31a4adf..85d70ea5d0 100644 --- a/cql3/constants.hh +++ b/cql3/constants.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_CONSTANTS_HH -#define CQL3_CONSTANTS_HH +#pragma once #include "cql3/abstract_marker.hh" #include "cql3/update_parameters.hh" @@ -234,5 +233,3 @@ public: std::ostream& operator<<(std::ostream&out, constants::type t); } - -#endif diff --git a/cql3/cql_statement.hh b/cql3/cql_statement.hh index 90f0de7702..082a77c87b 100644 --- a/cql3/cql_statement.hh +++ b/cql3/cql_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_CQL_STATEMENT_HH -#define CQL3_CQL_STATEMENT_HH +#pragma once #include "service/client_state.hh" #include "service/query_state.hh" @@ -85,5 +84,3 @@ public: }; } - -#endif diff --git a/cql3/functions/abstract_function.hh b/cql3/functions/abstract_function.hh index dbe817c038..c95ed3f22a 100644 --- a/cql3/functions/abstract_function.hh +++ b/cql3/functions/abstract_function.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_ABSTRACT_FUNCTION_HH -#define CQL3_FUNCTIONS_ABSTRACT_FUNCTION_HH +#pragma once #include "types.hh" #include @@ -109,5 +108,3 @@ struct hash { }; } - -#endif diff --git a/cql3/functions/aggregate_function.hh b/cql3/functions/aggregate_function.hh index cb6f862c06..623ec8fc2f 100644 --- a/cql3/functions/aggregate_function.hh +++ b/cql3/functions/aggregate_function.hh @@ -22,8 +22,7 @@ * Copyright 2014 Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_AGGREGATE_FUNCTION_HH_ -#define CQL3_FUNCTIONS_AGGREGATE_FUNCTION_HH_ +#pragma once #include "function.hh" #include @@ -80,5 +79,3 @@ public: } } - -#endif /* CQL3_FUNCTIONS_AGGREGATE_FUNCTION_HH_ */ diff --git a/cql3/functions/function.hh b/cql3/functions/function.hh index 6edc0ec43d..74684b09d2 100644 --- a/cql3/functions/function.hh +++ b/cql3/functions/function.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_FUNCTION_HH -#define CQL3_FUNCTIONS_FUNCTION_HH +#pragma once #include "function_name.hh" #include "types.hh" @@ -78,5 +77,3 @@ operator<<(std::ostream& os, const function& f) { } } - -#endif diff --git a/cql3/functions/function_name.hh b/cql3/functions/function_name.hh index 33d6da9c03..c1a5e4a231 100644 --- a/cql3/functions/function_name.hh +++ b/cql3/functions/function_name.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_FUNCTION_NAME_HH -#define CQL3_FUNCTION_NAME_HH +#pragma once #include "core/sstring.hh" #include "db/system_keyspace.hh" @@ -82,5 +81,3 @@ struct hash { }; } - -#endif diff --git a/cql3/functions/native_aggregate_function.hh b/cql3/functions/native_aggregate_function.hh index d2631892f2..b640bc2726 100644 --- a/cql3/functions/native_aggregate_function.hh +++ b/cql3/functions/native_aggregate_function.hh @@ -22,8 +22,7 @@ * Copyright 2014 Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_NATIVE_AGGREGATE_FUNCTION_HH -#define CQL3_FUNCTIONS_NATIVE_AGGREGATE_FUNCTION_HH +#pragma once #include "types.hh" #include "native_function.hh" @@ -68,6 +67,3 @@ make_native_aggregate_function_using(sstring name, data_type type) { } } - -#endif - diff --git a/cql3/functions/native_function.hh b/cql3/functions/native_function.hh index 0da401ad15..6ad8e14cb1 100644 --- a/cql3/functions/native_function.hh +++ b/cql3/functions/native_function.hh @@ -22,8 +22,7 @@ * Copyright 2014 Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_NATIVE_FUNCTION_HH -#define CQL3_FUNCTIONS_NATIVE_FUNCTION_HH +#pragma once #include "abstract_function.hh" @@ -53,5 +52,3 @@ public: } } - -#endif diff --git a/cql3/functions/native_scalar_function.hh b/cql3/functions/native_scalar_function.hh index e3ccd13939..4a3dde5fed 100644 --- a/cql3/functions/native_scalar_function.hh +++ b/cql3/functions/native_scalar_function.hh @@ -22,8 +22,7 @@ * Copyright 2014 Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_NATIVE_SCALAR_FUNCTION_HH_ -#define CQL3_FUNCTIONS_NATIVE_SCALAR_FUNCTION_HH_ +#pragma once #include "native_function.hh" #include "scalar_function.hh" @@ -77,5 +76,3 @@ make_native_scalar_function(sstring name, } } - -#endif /* CQL3_FUNCTIONS_NATIVE_SCALAR_FUNCTION_HH_ */ diff --git a/cql3/functions/scalar_function.hh b/cql3/functions/scalar_function.hh index e99412f88d..005ef97f46 100644 --- a/cql3/functions/scalar_function.hh +++ b/cql3/functions/scalar_function.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_FUNCTIONS_SCALAR_FUNCTION_HH -#define CQL3_FUNCTIONS_SCALAR_FUNCTION_HH +#pragma once #include "bytes.hh" #include @@ -48,5 +47,3 @@ public: } } - -#endif diff --git a/cql3/lists.hh b/cql3/lists.hh index 4c5f9a8ffe..819305a2b8 100644 --- a/cql3/lists.hh +++ b/cql3/lists.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_LISTS_HH -#define CQL3_LISTS_HH +#pragma once #include "cql3/abstract_marker.hh" #include "to_string.hh" @@ -182,5 +181,3 @@ public: }; } - -#endif diff --git a/cql3/maps.hh b/cql3/maps.hh index 25bbc7f836..1a0d3f4ff0 100644 --- a/cql3/maps.hh +++ b/cql3/maps.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_MAPS_HH -#define CQL3_MAPS_HH +#pragma once #include "cql3/abstract_marker.hh" #include "cql3/term.hh" @@ -134,5 +133,3 @@ public: }; } - -#endif diff --git a/cql3/operation.hh b/cql3/operation.hh index a632d46f5e..f91c15b9d0 100644 --- a/cql3/operation.hh +++ b/cql3/operation.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_OPERATION_HH -#define CQL3_OPERATION_HH +#pragma once #include "core/shared_ptr.hh" #include "exceptions/exceptions.hh" @@ -267,5 +266,3 @@ public: }; } - -#endif diff --git a/cql3/query_options.hh b/cql3/query_options.hh index d48cc6e323..087b80abe2 100644 --- a/cql3/query_options.hh +++ b/cql3/query_options.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_CQL_QUERY_OPTIONS_HH -#define CQL3_CQL_QUERY_OPTIONS_HH +#pragma once #include "timestamp.hh" #include "bytes.hh" @@ -253,5 +252,3 @@ public: }; } - -#endif diff --git a/cql3/selection/selectable.hh b/cql3/selection/selectable.hh index 8debaf504f..c14438fdd3 100644 --- a/cql3/selection/selectable.hh +++ b/cql3/selection/selectable.hh @@ -23,8 +23,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_SELECTION_SELECTABLE_HH -#define CQL3_SELECTION_SELECTABLE_HH +#pragma once #include "schema.hh" #include "core/shared_ptr.hh" @@ -120,5 +119,3 @@ public: } } - -#endif diff --git a/cql3/sets.hh b/cql3/sets.hh index a3c2d32795..2676cc9301 100644 --- a/cql3/sets.hh +++ b/cql3/sets.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_SETS_HH -#define CQL3_SETS_HH +#pragma once #include "cql3/abstract_marker.hh" #include "maps.hh" @@ -157,5 +156,3 @@ public: }; } - -#endif diff --git a/cql3/statements/alter_keyspace_statement.hh b/cql3/statements/alter_keyspace_statement.hh index 182618f0ee..fbf7e2d72b 100644 --- a/cql3/statements/alter_keyspace_statement.hh +++ b/cql3/statements/alter_keyspace_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_ALTER_KEYSPACE_STATEMENT_HH -#define CQL3_STATEMENTS_ALTER_KEYSPACE_STATEMENT_HH +#pragma once #include "cql3/statements/schema_altering_statement.hh" #include "cql3/statements/ks_prop_defs.hh" @@ -118,5 +117,3 @@ public: } } - -#endif diff --git a/cql3/statements/alter_type_statement.hh b/cql3/statements/alter_type_statement.hh index 6947a55885..e42f2e0d1f 100644 --- a/cql3/statements/alter_type_statement.hh +++ b/cql3/statements/alter_type_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL_STATEMENTS_ALTER_TYPE_STATEMENT_HH -#define CQL_STATEMENTS_ALTER_TYPE_STATEMENT_HH +#pragma once #include "cql3/ut_name.hh" @@ -368,5 +367,3 @@ protected: } } - -#endif diff --git a/cql3/statements/cf_statement.hh b/cql3/statements/cf_statement.hh index 509e403f9f..b23e7c68de 100644 --- a/cql3/statements/cf_statement.hh +++ b/cql3/statements/cf_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_CF_STATEMENT_HH -#define CQL3_STATEMENTS_CF_STATEMENT_HH +#pragma once #include "cql3/statements/parsed_statement.hh" #include "cql3/cf_name.hh" @@ -75,5 +74,3 @@ public: } } - -#endif diff --git a/cql3/statements/ks_prop_defs.hh b/cql3/statements/ks_prop_defs.hh index 3d6ba6b9e3..8adff982da 100644 --- a/cql3/statements/ks_prop_defs.hh +++ b/cql3/statements/ks_prop_defs.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_KS_PROP_DEFS_HH -#define CQL3_STATEMENTS_KS_PROP_DEFS_HH +#pragma once #include "cql3/statements/property_definitions.hh" #include "config/ks_meta_data.hh" @@ -106,5 +105,3 @@ public: } } - -#endif diff --git a/cql3/statements/modification_statement.hh b/cql3/statements/modification_statement.hh index 0170bb6317..3575b352a3 100644 --- a/cql3/statements/modification_statement.hh +++ b/cql3/statements/modification_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_MODIFICATION_STATEMENT_HH -#define CQL3_STATEMENTS_MODIFICATION_STATEMENT_HH +#pragma once #include "cql3/restrictions/restriction.hh" #include "cql3/statements/cf_statement.hh" @@ -447,5 +446,3 @@ std::ostream& operator<<(std::ostream& out, modification_statement::statement_ty } } - -#endif diff --git a/cql3/statements/parsed_statement.hh b/cql3/statements/parsed_statement.hh index 8c2b7896c8..a57cff8e11 100644 --- a/cql3/statements/parsed_statement.hh +++ b/cql3/statements/parsed_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_PARSED_STATEMENT_HH -#define CQL3_STATEMENTS_PARSED_STATEMENT_HH +#pragma once #include "cql3/variable_specifications.hh" #include "cql3/column_specification.hh" @@ -90,5 +89,3 @@ public: } } - -#endif diff --git a/cql3/statements/select_statement.hh b/cql3/statements/select_statement.hh index 8eabaf0f04..8caa4d15ea 100644 --- a/cql3/statements/select_statement.hh +++ b/cql3/statements/select_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_SELECT_STATEMENT_HH -#define CQL3_STATEMENTS_SELECT_STATEMENT_HH +#pragma once #include "cql3/statements/cf_statement.hh" #include "cql3/cql_statement.hh" @@ -502,5 +501,3 @@ private: } } - -#endif diff --git a/cql3/statements/truncate_statement.hh b/cql3/statements/truncate_statement.hh index e909d1f7f2..acfb5793f0 100644 --- a/cql3/statements/truncate_statement.hh +++ b/cql3/statements/truncate_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_STATEMENTS_TRUNCATE_STATEMENT_HH -#define CQL3_STATEMENTS_TRUNCATE_STATEMENT_HH +#pragma once #include "cql3/statements/cf_statement.hh" #include "cql3/cql_statement.hh" @@ -95,5 +94,3 @@ public: } } - -#endif diff --git a/cql3/statements/update_statement.hh b/cql3/statements/update_statement.hh index d749284c1f..47ba8e6eb3 100644 --- a/cql3/statements/update_statement.hh +++ b/cql3/statements/update_statement.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL_STATEMENTS_UPDATE_STATEMENT_HH -#define CQL_STATEMENTS_UPDATE_STATEMENT_HH +#pragma once #include "cql3/statements/modification_statement.hh" #include "cql3/column_identifier.hh" @@ -137,5 +136,3 @@ public: } } - -#endif diff --git a/cql3/term.hh b/cql3/term.hh index 44691bab2a..279df18830 100644 --- a/cql3/term.hh +++ b/cql3/term.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_TERM_HH -#define CQL3_TERM_HH +#pragma once #include #include "variable_specifications.hh" @@ -218,5 +217,3 @@ public: }; } - -#endif diff --git a/cql3/update_parameters.hh b/cql3/update_parameters.hh index ea57e587a0..9a4972d9ca 100644 --- a/cql3/update_parameters.hh +++ b/cql3/update_parameters.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_UPDATE_PARAMETERS_HH -#define CQL3_UPDATE_PARAMETERS_HH +#pragma once #include "gc_clock.hh" #include "timestamp.hh" @@ -164,5 +163,3 @@ public: }; } - -#endif diff --git a/cql3/ut_name.hh b/cql3/ut_name.hh index b9b8f636e4..6330615caf 100644 --- a/cql3/ut_name.hh +++ b/cql3/ut_name.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_UT_NAME_HH -#define CQL3_UT_NAME_HH +#pragma once #include "core/shared_ptr.hh" #include "column_identifier.hh" @@ -72,5 +71,3 @@ public: }; } - -#endif diff --git a/cql3/variable_specifications.hh b/cql3/variable_specifications.hh index 4051004818..d15b48388b 100644 --- a/cql3/variable_specifications.hh +++ b/cql3/variable_specifications.hh @@ -22,8 +22,7 @@ * Modified by Cloudius Systems */ -#ifndef CQL3_VARIABLE_SPECIFICATIONS_HH -#define CQL3_VARIABLE_SPECIFICATIONS_HH +#pragma once #include "cql3/column_specification.hh" #include "cql3/column_identifier.hh" @@ -83,5 +82,3 @@ public: }; } - -#endif From c6da7e684419f2cefbecebce2c796232268453fe Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 12 May 2015 16:35:39 +0300 Subject: [PATCH 2/3] cql3: Use std::nullopt constant There's a std::nullopt constant for unset optionals. Use it. Signed-off-by: Pekka Enberg --- cql3/cql3_type.cc | 2 +- cql3/statements/property_definitions.hh | 4 ++-- cql3/ut_name.hh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cql3/cql3_type.cc b/cql3/cql3_type.cc index 93f2ac5220..ce9f11929e 100644 --- a/cql3/cql3_type.cc +++ b/cql3/cql3_type.cc @@ -207,7 +207,7 @@ cql3_type::raw::is_counter() const { std::experimental::optional cql3_type::raw::keyspace() const { - return std::experimental::optional{}; + return std::experimental::nullopt; } void diff --git a/cql3/statements/property_definitions.hh b/cql3/statements/property_definitions.hh index e3e53910d4..4c55154096 100644 --- a/cql3/statements/property_definitions.hh +++ b/cql3/statements/property_definitions.hh @@ -87,7 +87,7 @@ protected: std::experimental::optional get_simple(const sstring& name) const { auto it = _properties.find(name); if (it == _properties.end()) { - return std::experimental::optional{}; + return std::experimental::nullopt; } try { return boost::any_cast(it->second); @@ -99,7 +99,7 @@ protected: std::experimental::optional> get_map(const sstring& name) const { auto it = _properties.find(name); if (it == _properties.end()) { - return std::experimental::optional>{}; + return std::experimental::nullopt; } try { return boost::any_cast>(it->second); diff --git a/cql3/ut_name.hh b/cql3/ut_name.hh index 6330615caf..d230438c0d 100644 --- a/cql3/ut_name.hh +++ b/cql3/ut_name.hh @@ -36,7 +36,7 @@ class ut_name final { ::shared_ptr _ut_name; public: ut_name(shared_ptr ks_name, ::shared_ptr ut_name) - : _ks_name{!ks_name ? std::experimental::optional{} : std::experimental::optional{ks_name->to_string()}} + : _ks_name{!ks_name ? std::experimental::nullopt : std::experimental::optional{ks_name->to_string()}} , _ut_name{ut_name} { } From 11b633208d06f5b0a4a35a8c6357c7a510dbf6d2 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 12 May 2015 16:38:04 +0300 Subject: [PATCH 3/3] cql3: Remove Java imports from C++ files Remove left-over Java imports from files that are already translated to C++. Signed-off-by: Pekka Enberg --- cql3/column_condition.hh | 20 --------------- cql3/column_identifier.hh | 20 --------------- cql3/operation.hh | 12 --------- cql3/selection/selectable.hh | 16 ------------ cql3/sets.hh | 23 ----------------- cql3/statements/alter_keyspace_statement.hh | 16 ------------ cql3/statements/alter_type_statement.hh | 15 ----------- cql3/statements/cf_prop_defs.hh | 18 ------------- cql3/statements/create_keyspace_statement.hh | 19 -------------- cql3/statements/create_table_statement.hh | 27 -------------------- cql3/statements/delete_statement.hh | 16 ------------ cql3/statements/update_statement.hh | 17 ------------ 12 files changed, 219 deletions(-) diff --git a/cql3/column_condition.hh b/cql3/column_condition.hh index 07cb8d51fe..6c5a2095a2 100644 --- a/cql3/column_condition.hh +++ b/cql3/column_condition.hh @@ -28,26 +28,6 @@ #include "cql3/abstract_marker.hh" #include "cql3/operator.hh" -#if 0 -import java.nio.ByteBuffer; -import java.util.*; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterators; -import static com.google.common.collect.Lists.newArrayList; - -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.db.*; -import org.apache.cassandra.db.composites.CellName; -import org.apache.cassandra.db.composites.CellNameType; -import org.apache.cassandra.db.composites.Composite; -import org.apache.cassandra.db.filter.ColumnSlice; -import org.apache.cassandra.db.marshal.*; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.cassandra.transport.Server; -import org.apache.cassandra.utils.ByteBufferUtil; -#endif - namespace cql3 { /** diff --git a/cql3/column_identifier.hh b/cql3/column_identifier.hh index 3d7184effd..a342a563ff 100644 --- a/cql3/column_identifier.hh +++ b/cql3/column_identifier.hh @@ -34,26 +34,6 @@ namespace cql3 { -#if 0 -import java.util.List; -import java.util.Locale; -import java.nio.ByteBuffer; - -import org.apache.cassandra.cache.IMeasurableMemory; -import org.apache.cassandra.config.CFMetaData; -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.cql3.selection.Selectable; -import org.apache.cassandra.cql3.selection.Selector; -import org.apache.cassandra.cql3.selection.SimpleSelector; -import org.apache.cassandra.db.marshal.AbstractType; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.cassandra.db.marshal.CompositeType; -import org.apache.cassandra.db.marshal.UTF8Type; -import org.apache.cassandra.utils.ByteBufferUtil; -import org.apache.cassandra.utils.ObjectSizes; -import org.apache.cassandra.utils.memory.AbstractAllocator; -#endif - /** * Represents an identifer for a CQL column definition. * TODO : should support light-weight mode without text representation for when not interned diff --git a/cql3/operation.hh b/cql3/operation.hh index f91c15b9d0..b38fff993b 100644 --- a/cql3/operation.hh +++ b/cql3/operation.hh @@ -35,18 +35,6 @@ namespace cql3 { class update_parameters; -#if 0 -package org.apache.cassandra.cql3; - -import java.nio.ByteBuffer; - -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.db.ColumnFamily; -import org.apache.cassandra.db.composites.Composite; -import org.apache.cassandra.db.marshal.*; -import org.apache.cassandra.exceptions.InvalidRequestException; -#endif - /** * An UPDATE or DELETE operation. * diff --git a/cql3/selection/selectable.hh b/cql3/selection/selectable.hh index c14438fdd3..5cb8ec7e3e 100644 --- a/cql3/selection/selectable.hh +++ b/cql3/selection/selectable.hh @@ -34,22 +34,6 @@ namespace cql3 { namespace selection { -#if 0 -import java.util.ArrayList; -import java.util.List; - -import org.apache.cassandra.config.CFMetaData; -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.cql3.ColumnIdentifier; -import org.apache.cassandra.cql3.functions.Function; -import org.apache.cassandra.cql3.functions.FunctionName; -import org.apache.cassandra.cql3.functions.Functions; -import org.apache.cassandra.db.marshal.AbstractType; -import org.apache.cassandra.db.marshal.UserType; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.commons.lang3.text.StrBuilder; -#endif - class selectable { public: virtual ~selectable() {} diff --git a/cql3/sets.hh b/cql3/sets.hh index 2676cc9301..f9369cba3e 100644 --- a/cql3/sets.hh +++ b/cql3/sets.hh @@ -33,29 +33,6 @@ namespace cql3 { -#if 0 -package org.apache.cassandra.cql3; - -import java.nio.ByteBuffer; -import java.util.*; - -import com.google.common.base.Joiner; - -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.db.ColumnFamily; -import org.apache.cassandra.db.composites.CellName; -import org.apache.cassandra.db.composites.Composite; -import org.apache.cassandra.db.marshal.AbstractType; -import org.apache.cassandra.db.marshal.MapType; -import org.apache.cassandra.db.marshal.SetType; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.cassandra.serializers.CollectionSerializer; -import org.apache.cassandra.serializers.MarshalException; -import org.apache.cassandra.transport.Server; -import org.apache.cassandra.utils.ByteBufferUtil; -import org.apache.cassandra.utils.FBUtilities; -#endif - /** * Static helper methods and classes for sets. */ diff --git a/cql3/statements/alter_keyspace_statement.hh b/cql3/statements/alter_keyspace_statement.hh index fbf7e2d72b..06cfb4fdc6 100644 --- a/cql3/statements/alter_keyspace_statement.hh +++ b/cql3/statements/alter_keyspace_statement.hh @@ -33,22 +33,6 @@ namespace cql3 { namespace statements { -#if 0 -package org.apache.cassandra.cql3.statements; - -import org.apache.cassandra.auth.Permission; -import org.apache.cassandra.config.DatabaseDescriptor; -import org.apache.cassandra.config.KSMetaData; -import org.apache.cassandra.config.Schema; -import org.apache.cassandra.db.SystemKeyspace; -import org.apache.cassandra.exceptions.*; -import org.apache.cassandra.locator.AbstractReplicationStrategy; -import org.apache.cassandra.service.ClientState; -import org.apache.cassandra.service.MigrationManager; -import org.apache.cassandra.service.StorageService; -import org.apache.cassandra.transport.Event; -#endif - class alter_keyspace_statement : public schema_altering_statement { sstring _name; std::unique_ptr _attrs; diff --git a/cql3/statements/alter_type_statement.hh b/cql3/statements/alter_type_statement.hh index e42f2e0d1f..a9b3e4f45d 100644 --- a/cql3/statements/alter_type_statement.hh +++ b/cql3/statements/alter_type_statement.hh @@ -32,21 +32,6 @@ namespace cql3 { namespace statements { -#if 0 -import java.nio.ByteBuffer; -import java.util.*; - -import org.apache.cassandra.auth.Permission; -import org.apache.cassandra.config.*; -import org.apache.cassandra.cql3.*; -import org.apache.cassandra.db.composites.CellNames; -import org.apache.cassandra.db.marshal.*; -import org.apache.cassandra.exceptions.*; -import org.apache.cassandra.service.ClientState; -import org.apache.cassandra.service.MigrationManager; -import org.apache.cassandra.transport.Event; -#endif - class alter_type_statement : public schema_altering_statement { protected: const ::shared_ptr _name; diff --git a/cql3/statements/cf_prop_defs.hh b/cql3/statements/cf_prop_defs.hh index 182b95d9c6..4f5c4d82f4 100644 --- a/cql3/statements/cf_prop_defs.hh +++ b/cql3/statements/cf_prop_defs.hh @@ -28,24 +28,6 @@ #include "schema.hh" -#if 0 -package org.apache.cassandra.cql3.statements; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.apache.cassandra.cache.CachingOptions; -import org.apache.cassandra.config.CFMetaData; -import org.apache.cassandra.config.CFMetaData.SpeculativeRetry; -import org.apache.cassandra.db.compaction.AbstractCompactionStrategy; -import org.apache.cassandra.exceptions.ConfigurationException; -import org.apache.cassandra.exceptions.SyntaxException; -import org.apache.cassandra.io.compress.CompressionParameters; -#endif - namespace cql3 { namespace statements { diff --git a/cql3/statements/create_keyspace_statement.hh b/cql3/statements/create_keyspace_statement.hh index e7f60c37e1..17dd06da8f 100644 --- a/cql3/statements/create_keyspace_statement.hh +++ b/cql3/statements/create_keyspace_statement.hh @@ -32,25 +32,6 @@ #include "core/shared_ptr.hh" -#if 0 -package org.apache.cassandra.cql3.statements; - -import org.apache.cassandra.exceptions.ConfigurationException; -import org.apache.cassandra.auth.Permission; -import org.apache.cassandra.config.DatabaseDescriptor; -import org.apache.cassandra.config.Schema; -import org.apache.cassandra.exceptions.AlreadyExistsException; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.cassandra.exceptions.RequestValidationException; -import org.apache.cassandra.exceptions.UnauthorizedException; -import org.apache.cassandra.locator.AbstractReplicationStrategy; -import org.apache.cassandra.service.ClientState; -import org.apache.cassandra.service.MigrationManager; -import org.apache.cassandra.service.StorageService; -import org.apache.cassandra.thrift.ThriftValidation; -import org.apache.cassandra.transport.Event; -#endif - namespace cql3 { namespace statements { diff --git a/cql3/statements/create_table_statement.hh b/cql3/statements/create_table_statement.hh index e85fd65f05..c51d1076a9 100644 --- a/cql3/statements/create_table_statement.hh +++ b/cql3/statements/create_table_statement.hh @@ -39,33 +39,6 @@ #include #include -#if 0 -package org.apache.cassandra.cql3.statements; - -import java.nio.ByteBuffer; -import java.util.*; - -import org.apache.cassandra.exceptions.*; -import org.apache.commons.lang3.StringUtils; -import com.google.common.collect.HashMultiset; -import com.google.common.collect.Multiset; - -import org.apache.cassandra.auth.Permission; -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.config.CFMetaData; -import org.apache.cassandra.config.Schema; -import org.apache.cassandra.cql3.*; -import org.apache.cassandra.db.composites.*; -import org.apache.cassandra.db.ColumnFamilyType; -import org.apache.cassandra.db.marshal.*; -import org.apache.cassandra.exceptions.AlreadyExistsException; -import org.apache.cassandra.io.compress.CompressionParameters; -import org.apache.cassandra.service.ClientState; -import org.apache.cassandra.service.MigrationManager; -import org.apache.cassandra.transport.Event; -import org.apache.cassandra.utils.ByteBufferUtil; -#endif - namespace cql3 { namespace statements { diff --git a/cql3/statements/delete_statement.hh b/cql3/statements/delete_statement.hh index f3cc4cac9c..4340bb7b0d 100644 --- a/cql3/statements/delete_statement.hh +++ b/cql3/statements/delete_statement.hh @@ -33,22 +33,6 @@ namespace cql3 { namespace statements { -#if 0 -import java.nio.ByteBuffer; -import java.util.*; - -import com.google.common.collect.Iterators; - -import org.apache.cassandra.cql3.*; -import org.apache.cassandra.cql3.restrictions.Restriction; -import org.apache.cassandra.config.CFMetaData; -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.db.*; -import org.apache.cassandra.db.composites.Composite; -import org.apache.cassandra.exceptions.*; -import org.apache.cassandra.utils.Pair; -#endif - /** * A DELETE parsed from a CQL query statement. */ diff --git a/cql3/statements/update_statement.hh b/cql3/statements/update_statement.hh index 47ba8e6eb3..cce735540e 100644 --- a/cql3/statements/update_statement.hh +++ b/cql3/statements/update_statement.hh @@ -33,23 +33,6 @@ #include #include "unimplemented.hh" -#if 0 -package org.apache.cassandra.cql3.statements; - -import java.nio.ByteBuffer; -import java.util.*; - -import org.apache.cassandra.cql3.*; -import org.apache.cassandra.config.CFMetaData; -import org.apache.cassandra.config.ColumnDefinition; -import org.apache.cassandra.db.*; -import org.apache.cassandra.db.composites.Composite; -import org.apache.cassandra.db.index.SecondaryIndexManager; -import org.apache.cassandra.exceptions.*; -import org.apache.cassandra.utils.ByteBufferUtil; -import org.apache.cassandra.utils.Pair; -#endif - namespace cql3 { namespace statements {