[GitHub] [hudi] yihua commented on a diff in pull request #9108: [HUDI-6462] Add Hudi client init callback interface

2023-07-03 Thread via GitHub


yihua commented on code in PR #9108:
URL: https://github.com/apache/hudi/pull/9108#discussion_r1251218379


##
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/callback/TestThrowExceptionCallback.java:
##
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.hudi.callback;
+
+import org.apache.hudi.client.BaseHoodieClient;
+import org.apache.hudi.exception.HoodieIOException;
+
+/**
+ * A test {@link HoodieClientInitCallback} implementation to throw an 
exception.
+ */
+public class TestThrowExceptionCallback implements HoodieClientInitCallback {

Review Comment:
   OK, the inner classes have to be static to work.  Now all test 
implementation are in inner classes.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

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



[GitHub] [hudi] yihua commented on a diff in pull request #9108: [HUDI-6462] Add Hudi client init callback interface

2023-07-03 Thread via GitHub


yihua commented on code in PR #9108:
URL: https://github.com/apache/hudi/pull/9108#discussion_r1251167929


##
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/callback/TestThrowExceptionCallback.java:
##
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.hudi.callback;
+
+import org.apache.hudi.client.BaseHoodieClient;
+import org.apache.hudi.exception.HoodieIOException;
+
+/**
+ * A test {@link HoodieClientInitCallback} implementation to throw an 
exception.
+ */
+public class TestThrowExceptionCallback implements HoodieClientInitCallback {

Review Comment:
   I tried inner class but it does not work well with the class loader.  So I 
rather put them in independent classes.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

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



[GitHub] [hudi] yihua commented on a diff in pull request #9108: [HUDI-6462] Add Hudi client init callback interface

2023-07-03 Thread via GitHub


yihua commented on code in PR #9108:
URL: https://github.com/apache/hudi/pull/9108#discussion_r1251167572


##
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/callback/TestChangeConfigInitCallback.java:
##
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package org.apache.hudi.callback;
+
+import org.apache.hudi.client.BaseHoodieClient;
+import org.apache.hudi.config.HoodieWriteConfig;
+
+import org.apache.avro.Schema;
+
+import static org.apache.hudi.config.HoodieWriteConfig.WRITE_SCHEMA_OVERRIDE;
+
+/**
+ * A test {@link HoodieClientInitCallback} implementation to add the property
+ * `user.defined.key2=value2` to the write schema.
+ */
+public class TestChangeConfigInitCallback implements HoodieClientInitCallback {

Review Comment:
   I renamed the classes with `TestClass` suffix to differentiated them from 
other classes containing the actual tests.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

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