ChenSammi commented on code in PR #10096:
URL: https://github.com/apache/ozone/pull/10096#discussion_r3199591817


##########
hadoop-ozone/ozone-manager-plugins/src/main/java/org/apache/hadoop/ozone/om/eventlistener/OMEventListenerKafkaPublisher.java:
##########
@@ -0,0 +1,172 @@
+/*
+ * 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.hadoop.ozone.om.eventlistener;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.ozone.om.helpers.OmCompletedRequestInfo;
+import org.apache.kafka.clients.admin.AdminClient;
+import org.apache.kafka.clients.admin.NewTopic;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is an implementation of OMEventListener which uses the
+ * OMEventListenerLedgerPoller as a building block to periodically poll/consume
+ * completed operations, serialize them to a S3 schema and produce them
+ * to a kafka topic.
+ */
+public class OMEventListenerKafkaPublisher implements OMEventListener {
+  public static final Logger LOG = 
LoggerFactory.getLogger(OMEventListenerKafkaPublisher.class);
+
+  private static final String KAFKA_CONFIG_PREFIX = "ozone.notify.kafka.";

Review Comment:
   @gardenia , how about we unify the event property configuration prefix? 
   
   Previous, we have "ozone.om.plugin.destination." prefix for plugin 
configuration.  For example, 
   ```
   ozone.om.plugin.destination.foo      enabled
   ozone.om.plugin.destination.foo.classname  
org.apache.hadoop.ozone.om.eventlistener.FooPlugin 
   ```
   
   now we have prefix "ozone.notify." for kafka plugin
   
   Let's unify it to "ozone.om.plugin.", so how about rename 
"ozone.notify.kafka" to "ozone.om.plugin.kafka."



##########
hadoop-ozone/ozone-manager-plugins/src/main/java/org/apache/hadoop/ozone/om/eventlistener/OMEventListenerKafkaPublisher.java:
##########
@@ -0,0 +1,172 @@
+/*
+ * 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.hadoop.ozone.om.eventlistener;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.ozone.om.helpers.OmCompletedRequestInfo;
+import org.apache.kafka.clients.admin.AdminClient;
+import org.apache.kafka.clients.admin.NewTopic;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is an implementation of OMEventListener which uses the
+ * OMEventListenerLedgerPoller as a building block to periodically poll/consume
+ * completed operations, serialize them to a S3 schema and produce them
+ * to a kafka topic.
+ */
+public class OMEventListenerKafkaPublisher implements OMEventListener {
+  public static final Logger LOG = 
LoggerFactory.getLogger(OMEventListenerKafkaPublisher.class);
+
+  private static final String KAFKA_CONFIG_PREFIX = "ozone.notify.kafka.";

Review Comment:
   @gardenia , how about we unify the event property configuration prefix? 
   
   Previous, we have "ozone.om.plugin.destination." prefix for plugin 
configuration.  For example, 
   ```
   ozone.om.plugin.destination.foo      enabled
   ozone.om.plugin.destination.foo.classname  
org.apache.hadoop.ozone.om.eventlistener.FooPlugin 
   ```
   
   now we have prefix "ozone.notify." for kafka plugin
   
   Let's unify it to "ozone.om.plugin.", so how about rename 
"ozone.notify.kafka" to "ozone.om.plugin.kafka."?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to