diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..c32bec2c9131 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = +ij_wrap_on_typing = false + +[*.java] +ij_java_indent_case_from_switch = false +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = normal +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = normal +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = normal +ij_java_extends_list_wrap = normal +ij_java_throws_list_wrap = normal +ij_java_extends_keyword_wrap = normal +ij_java_throws_keyword_wrap = normal +ij_java_method_call_chain_wrap = normal +ij_java_binary_operation_wrap = normal +ij_java_ternary_operation_wrap = normal +ij_java_for_statement_wrap = normal +ij_java_array_initializer_wrap = normal +ij_java_assignment_wrap = normal +ij_java_assert_statement_wrap = normal +ij_java_if_brace_force = always +ij_java_do_while_brace_force = always +ij_java_while_brace_force = always +ij_java_for_brace_force = always +ij_java_parameter_annotation_wrap = normal +ij_java_variable_annotation_wrap = normal +ij_java_enum_constants_wrap = normal +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_before_imports = 1 +ij_java_class_count_to_use_import_on_demand = 9999 +ij_java_packages_to_use_import_on_demand = +ij_java_imports_layout = $*,|,* +ij_java_layout_static_imports_separately = true +ij_java_use_single_class_imports = true + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/CsiServer.xml b/.run/CsiServer.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/CsiServer.xml rename to .run/CsiServer.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1-ha.xml b/.run/Datanode1-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1-ha.xml rename to .run/Datanode1-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1.xml b/.run/Datanode1.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1.xml rename to .run/Datanode1.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2-ha.xml b/.run/Datanode2-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2-ha.xml rename to .run/Datanode2-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2.xml b/.run/Datanode2.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2.xml rename to .run/Datanode2.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3-ha.xml b/.run/Datanode3-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3-ha.xml rename to .run/Datanode3-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3.xml b/.run/Datanode3.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3.xml rename to .run/Datanode3.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/FreonStandalone.xml b/.run/FreonStandalone.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/FreonStandalone.xml rename to .run/FreonStandalone.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell-ha.xml b/.run/OzoneFsShell-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell-ha.xml rename to .run/OzoneFsShell-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell.xml b/.run/OzoneFsShell.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell.xml rename to .run/OzoneFsShell.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager-ha.xml b/.run/OzoneManager-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager-ha.xml rename to .run/OzoneManager-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager.xml b/.run/OzoneManager.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager.xml rename to .run/OzoneManager.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit-ha.xml b/.run/OzoneManagerInit-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit-ha.xml rename to .run/OzoneManagerInit-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit.xml b/.run/OzoneManagerInit.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit.xml rename to .run/OzoneManagerInit.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell-ha.xml b/.run/OzoneShell-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell-ha.xml rename to .run/OzoneShell-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell.xml b/.run/OzoneShell.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell.xml rename to .run/OzoneShell.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCM-ha.xml b/.run/PrimordialSCM-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCM-ha.xml rename to .run/PrimordialSCM-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCMInit-ha.xml b/.run/PrimordialSCMInit-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCMInit-ha.xml rename to .run/PrimordialSCMInit-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Recon-ha.xml b/.run/Recon-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Recon-ha.xml rename to .run/Recon-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Recon.xml b/.run/Recon.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Recon.xml rename to .run/Recon.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/S3Gateway.xml b/.run/S3Gateway.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/S3Gateway.xml rename to .run/S3Gateway.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm2-ha.xml b/.run/Scm2-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm2-ha.xml rename to .run/Scm2-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm2Bootstrap-ha.xml b/.run/Scm2Bootstrap-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm2Bootstrap-ha.xml rename to .run/Scm2Bootstrap-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm3-ha.xml b/.run/Scm3-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm3-ha.xml rename to .run/Scm3-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm3Bootstrap-ha.xml b/.run/Scm3Bootstrap-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm3Bootstrap-ha.xml rename to .run/Scm3Bootstrap-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/ScmRoles.xml b/.run/ScmRoles.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/ScmRoles.xml rename to .run/ScmRoles.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManager.xml b/.run/StorageContainerManager.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManager.xml rename to .run/StorageContainerManager.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManagerInit.xml b/.run/StorageContainerManagerInit.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManagerInit.xml rename to .run/StorageContainerManagerInit.run.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a1eeda8cf13..dcd525d09d15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,13 +125,9 @@ Basic code conventions followed by Ozone: These are checked by tools like Checkstyle and RAT. -For IntelliJ users, it is recommended to import and select the Code Style scheme located at: +Ozone code style is shared via `.editorconfig` configuration file and will be automatically imported when the project is opened. -``` -./hadoop-ozone/dev-support/intellij/ozone-style.xml -``` - -See https://www.jetbrains.com/help/idea/configuring-code-style.html#import-code-style for detailed instructions. +See https://www.jetbrains.com/help/idea/configure-project-settings.html#share-project-through-vcs for detailed instructions. ### Check your contribution @@ -166,16 +162,17 @@ As Ozone uses Apache Maven it can be developed from any IDE. IntelliJ IDEA is a ### Run Ozone from IntelliJ -Ozone components depends on maven classpath. We generate classpath descriptor from the maven pom.xml files to use exactly the same classpath at runtime. +Ozone components depend on maven classpath. We generate classpath descriptor from the maven pom.xml files to use exactly the same classpath at runtime. -As a result, it's easy to start _all_ the components from IDE as the right classpath (without provided scope) has already been set. +As a result, it's straightforward to start _all_ the components from IDE as the right classpath (without provided scope) has already been set. -To start Ozone from IntelliJ: +Ozone project has pre-defined run configurations shared via standard IDE folder for run configurations: + +``` +.run +``` -1. Stop your IDE -2. Execute the `./hadoop-ozone/dev-support/intellij/install-runconfigs.sh` helper script. -3. Start the IDE -4. New runner definitions are available from the Run menu. +They will be automatically added to the IDE on project import. You can use the installed Run configurations in the following order: diff --git a/hadoop-ozone/dev-support/intellij/install-runconfigs.sh b/hadoop-ozone/dev-support/intellij/install-runconfigs.sh deleted file mode 100755 index fc877bdde622..000000000000 --- a/hadoop-ozone/dev-support/intellij/install-runconfigs.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -SRC_DIR="$SCRIPT_DIR/runConfigurations" -DEST_DIR="$SCRIPT_DIR/../../../.idea/runConfigurations/" -mkdir -p "$DEST_DIR" -#shellcheck disable=SC2010 -ls -1 "$SRC_DIR" | grep -v ozone-site.xml | xargs -n1 -I FILE cp "$SRC_DIR/FILE" "$DEST_DIR" diff --git a/hadoop-ozone/dev-support/intellij/ozone-style.xml b/hadoop-ozone/dev-support/intellij/ozone-style.xml deleted file mode 100644 index fa69abd2de86..000000000000 --- a/hadoop-ozone/dev-support/intellij/ozone-style.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file