You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/07/20 04:54:14 UTC

[GitHub] [hudi] xushiyan opened a new pull request #1849: Externalize test classes' configs

xushiyan opened a new pull request #1849:
URL: https://github.com/apache/hudi/pull/1849


   - Move getConfig() to properties
   - Use common method to load configs for individual test class
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan commented on a change in pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan commented on a change in pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#discussion_r457785815



##########
File path: hudi-client/src/test/resources/org/apache/hudi/index/hbase/TestHBaseIndex.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+# HoodieWriteConfig

Review comment:
       i agree that it's handy with builder pattern. I came from the point where most configs across test cases are static and duplicated; for each test class, only 1 or 2 properties to variate. That's what the minimal exposure via overwritingProps aim for. But i agree the benefits are less obvious. closing this one first. thanks for the input.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan commented on a change in pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan commented on a change in pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#discussion_r457130487



##########
File path: hudi-client/src/main/java/org/apache/hudi/config/HoodieIndexConfig.java
##########
@@ -274,6 +275,7 @@ public HoodieIndexConfig build() {
           DEFAULT_GLOBAL_SIMPLE_INDEX_PARALLELISM);
       setDefaultOnCondition(props, !props.containsKey(SIMPLE_INDEX_UPDATE_PARTITION_PATH),
           SIMPLE_INDEX_UPDATE_PARTITION_PATH, DEFAULT_SIMPLE_INDEX_UPDATE_PARTITION_PATH);
+      setDefaultOnCondition(props, !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());

Review comment:
       @yanghua Maybe this can be done specially as below for HBase index. But I'm inclined to leaving it as a simple rule: any sub-config should be initialized regardless. Would like to have some input on this.
   
   ```suggestion
         setDefaultOnCondition(props, indexType==IndexType.HBASE && !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan commented on a change in pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan commented on a change in pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#discussion_r457130487



##########
File path: hudi-client/src/main/java/org/apache/hudi/config/HoodieIndexConfig.java
##########
@@ -274,6 +275,7 @@ public HoodieIndexConfig build() {
           DEFAULT_GLOBAL_SIMPLE_INDEX_PARALLELISM);
       setDefaultOnCondition(props, !props.containsKey(SIMPLE_INDEX_UPDATE_PARTITION_PATH),
           SIMPLE_INDEX_UPDATE_PARTITION_PATH, DEFAULT_SIMPLE_INDEX_UPDATE_PARTITION_PATH);
+      setDefaultOnCondition(props, !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());

Review comment:
       @yanghua Maybe this can be done specially for HBase index. But I'm also open to leave it as is: any sub-config should be initialized regardless.
   
   ```suggestion
         setDefaultOnCondition(props, indexType==IndexType.HBASE && !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] vinothchandar commented on a change in pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
vinothchandar commented on a change in pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#discussion_r457717555



##########
File path: hudi-client/src/test/resources/org/apache/hudi/index/hbase/TestHBaseIndex.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+# HoodieWriteConfig

Review comment:
       whats the value of pull this into config instead of code? IMO, code is much easier to debug.. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan commented on a change in pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan commented on a change in pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#discussion_r457130487



##########
File path: hudi-client/src/main/java/org/apache/hudi/config/HoodieIndexConfig.java
##########
@@ -274,6 +275,7 @@ public HoodieIndexConfig build() {
           DEFAULT_GLOBAL_SIMPLE_INDEX_PARALLELISM);
       setDefaultOnCondition(props, !props.containsKey(SIMPLE_INDEX_UPDATE_PARTITION_PATH),
           SIMPLE_INDEX_UPDATE_PARTITION_PATH, DEFAULT_SIMPLE_INDEX_UPDATE_PARTITION_PATH);
+      setDefaultOnCondition(props, !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());

Review comment:
       @yanghua Maybe this can be done specially for HBase index. But I'm also open to leave it as is: any sub-config should be initialized regardless. Would like to have some input on this.
   
   ```suggestion
         setDefaultOnCondition(props, indexType==IndexType.HBASE && !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan closed pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan closed pull request #1849:
URL: https://github.com/apache/hudi/pull/1849


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan edited a comment on pull request #1849: Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan edited a comment on pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#issuecomment-660803628


   @vinothchandar The convention proposed here is for functional test requires HoodieConfig, it is to define its own `properties` file and avoid using `getConfigBuilder()`. if the approach looks good, i'll apply it to more test classes. thanks.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan commented on pull request #1849: Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan commented on pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#issuecomment-660803628


   @vinothchandar if the approach looks good, i'll apply it to more test classes. thanks.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] xushiyan commented on a change in pull request #1849: [WIP] Externalize test classes' configs

Posted by GitBox <gi...@apache.org>.
xushiyan commented on a change in pull request #1849:
URL: https://github.com/apache/hudi/pull/1849#discussion_r457130487



##########
File path: hudi-client/src/main/java/org/apache/hudi/config/HoodieIndexConfig.java
##########
@@ -274,6 +275,7 @@ public HoodieIndexConfig build() {
           DEFAULT_GLOBAL_SIMPLE_INDEX_PARALLELISM);
       setDefaultOnCondition(props, !props.containsKey(SIMPLE_INDEX_UPDATE_PARTITION_PATH),
           SIMPLE_INDEX_UPDATE_PARTITION_PATH, DEFAULT_SIMPLE_INDEX_UPDATE_PARTITION_PATH);
+      setDefaultOnCondition(props, !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());

Review comment:
       @yanghua Maybe this can be done specially as below for HBase index. But I'm also open to leave it as is: any sub-config should be initialized regardless. Would like to have some input on this.
   
   ```suggestion
         setDefaultOnCondition(props, indexType==IndexType.HBASE && !isHBaseIndexConfigSet, HoodieHBaseIndexConfig.newBuilder().fromProperties(props).build());
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org