[
https://issues.apache.org/jira/browse/KYLIN-4780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17297227#comment-17297227
]
ASF GitHub Bot commented on KYLIN-4780:
---------------------------------------
yanghua commented on a change in pull request #1596:
URL: https://github.com/apache/kylin/pull/1596#discussion_r589291800
##########
File path:
core-common/src/test/java/org/apache/kylin/common/notify/MailServiceTest.java
##########
@@ -16,18 +16,19 @@
* limitations under the License.
*/
-package org.apache.kylin.common.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
+package org.apache.kylin.common.notify;
import org.apache.kylin.common.KylinConfig;
+import org.apache.kylin.common.util.LocalFileMetadataTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
+import java.io.IOException;
Review comment:
We should not change the position of the existed imports.
##########
File path:
core-common/src/main/java/org/apache/kylin/common/notify/util/Notify.java
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.kylin.common.notify.util;
+
+public interface Notify {
Review comment:
Can we define the constants into a base class?
##########
File path:
core-common/src/main/java/org/apache/kylin/common/notify/NotifyServiceBase.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.kylin.common.notify;
+
+import org.apache.kylin.common.util.Pair;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+public abstract class NotifyServiceBase implements Callable<Boolean> {
+
+ public Map<String, List<String>> receivers;
+ public String state;
+ public Pair<String[], Map<String, Object>> content;
+
+ public abstract boolean sendNotify();
+
+ public void sendNotify(Map<String, List<String>> receivers, String state,
Pair<String[], Map<String, Object>> content){
Review comment:
IMO, `sendNotification` sounds better?
----------------------------------------------------------------
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:
[email protected]
> Refactor AbstractExecutable to extract the notification relevant business
> logic into a single component
> -------------------------------------------------------------------------------------------------------
>
> Key: KYLIN-4780
> URL: https://issues.apache.org/jira/browse/KYLIN-4780
> Project: Kylin
> Issue Type: Improvement
> Components: Integration
> Reporter: vinoyang
> Assignee: chenjie
> Priority: Major
>
> Currently, Kylin supports mail service to know the change around the cube.
> However, there are some issues about the design, e.g.
> * AbstractExecutable contains an implementation of the mechanism of a
> notification listener, but only support mail service, it does not belong
> there;
> * The current implementation is hard to scale to other notification e.g.
> Ding Talk(which is a popular production supports by Alibaba)
> I propose to refactor the current implementation to extract the notification
> logic and redesign a new common notification/listener
--
This message was sent by Atlassian Jira
(v8.3.4#803005)