You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/07/14 11:53:47 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4847: [WIP]Provide kafka as collector/reporter

kezhenxu94 commented on a change in pull request #4847:
URL: https://github.com/apache/skywalking/pull/4847#discussion_r453406682



##########
File path: .github/workflows/e2e.kafka.yaml
##########
@@ -0,0 +1,50 @@
+# 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.
+
+name: E2E
+
+on:
+  pull_request:
+  push:
+    branches:
+      - master
+    tags:
+      - 'v*'
+
+env:
+  SKIP_TEST: true
+  SW_AGENT_JDK_VERSION: 8
+
+jobs:
+  GOAgent:

Review comment:
       ```suggestion
     Kafka:
   ```

##########
File path: oap-server/server-receiver-plugin/skywalking-kafka-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/kafka/provider/SourceReceiverPoint.java
##########
@@ -0,0 +1,29 @@
+/*
+ * 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.skywalking.oap.server.receiver.kafka.provider;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface SourceReceiverPoint {

Review comment:
       unused

##########
File path: oap-server/server-cluster-plugin/cluster-zookeeper-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/zookeeper/ZookeeperCoordinator.java
##########
@@ -78,6 +84,33 @@ public synchronized void registerRemote(RemoteInstance remoteInstance) throws Se
         }
     }
 
+    @Override
+    public synchronized RemoteInstance updateRemoteNodes(String serverId) throws Exception {
+        ServiceInstance self = null;
+        for (ServiceInstance<RemoteInstance> service : serviceCache.getInstances()) {
+
+            if (service.getPayload().getAddress().equals(selfAddress)) {
+                self = service;
+            } else if (StringUtil.isNotEmpty(serverId) && serverId.equals(service.getPayload().getServerId())) {
+                throw new ServiceRegisterException("ServerId[" + serverId + "] confirmed");

Review comment:
       Do you mean `conflict` (instead of `confirmed`)?

##########
File path: apm-sniffer/optional-reporter-plugins/kafka-reporter-plugin/src/main/java/org/apache/skywalking/apm/agent/core/kafka/KafkaServiceManagementProducer.java
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.skywalking.apm.agent.core.kafka;
+
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+import org.apache.kafka.clients.admin.AdminClient;
+import org.apache.kafka.clients.admin.DescribeTopicsResult;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.common.serialization.BytesSerializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.kafka.common.utils.Bytes;
+import org.apache.skywalking.apm.agent.core.boot.BootService;
+import org.apache.skywalking.apm.agent.core.boot.DefaultImplementor;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+
+/**
+ *  Configuring, initializing and holding a KafkaProducer instance for reporters.
+ */
+@DefaultImplementor
+public class KafkaServiceManagementProducer implements BootService, Runnable {

Review comment:
       Is this class name general enough? Seems `KafkaServiceManagementService` has nothing to do with `ServiceManagement`, a little misleading (because there is another class `KafkaServiceManagementService`)




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