This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new a2560e4b6 [ISSUE #3505] Do some code optimization[EtcdRegistryService] 
(#3715)
a2560e4b6 is described below

commit a2560e4b6dfa785c3c3422d5edc260850ca3993c
Author: maheshnikam <[email protected]>
AuthorDate: Fri May 5 07:26:19 2023 +0530

    [ISSUE #3505] Do some code optimization[EtcdRegistryService] (#3715)
    
    * Update EtcdRegistryService.java
    
    * Update EtcdRegistryService.java
    
    ---------
    
    Co-authored-by: mike_xwm <[email protected]>
---
 .../eventmesh/registry/etcd/service/EtcdRegistryService.java     | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/eventmesh-registry-plugin/eventmesh-registry-etcd/src/main/java/org/apache/eventmesh/registry/etcd/service/EtcdRegistryService.java
 
b/eventmesh-registry-plugin/eventmesh-registry-etcd/src/main/java/org/apache/eventmesh/registry/etcd/service/EtcdRegistryService.java
index f151c9f59..ab1aecc61 100644
--- 
a/eventmesh-registry-plugin/eventmesh-registry-etcd/src/main/java/org/apache/eventmesh/registry/etcd/service/EtcdRegistryService.java
+++ 
b/eventmesh-registry-plugin/eventmesh-registry-etcd/src/main/java/org/apache/eventmesh/registry/etcd/service/EtcdRegistryService.java
@@ -36,9 +36,11 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ScheduledExecutorService;
@@ -182,7 +184,7 @@ public class EtcdRegistryService implements RegistryService 
{
     public Map<String, Map<String, Integer>> 
findEventMeshClientDistributionData(String clusterName, String group, String 
purpose)
         throws RegistryException {
         // todo find metadata
-        return null;
+        return Collections.emptyMap();
     }
 
     @Override
@@ -204,7 +206,8 @@ public class EtcdRegistryService implements RegistryService 
{
             EventMeshDataInfo eventMeshDataInfo =
                 new EventMeshDataInfo(eventMeshClusterName, eventMeshName,
                     endPoint, System.currentTimeMillis(), 
eventMeshRegisterInfo.getMetadata());
-            ByteSequence etcdValue = 
ByteSequence.from(JsonUtils.toJSONString(eventMeshDataInfo).getBytes(Constants.DEFAULT_CHARSET));
+            ByteSequence etcdValue = 
ByteSequence.from(Objects.requireNonNull(JsonUtils.toJSONString(eventMeshDataInfo))
+                                                 
.getBytes(Constants.DEFAULT_CHARSET));
             etcdClient.getKVClient().put(etcdKey, etcdValue, 
PutOption.newBuilder().withLeaseId(getLeaseId()).build());
             eventMeshRegisterInfoMap.put(eventMeshName, eventMeshRegisterInfo);
 
@@ -244,7 +247,7 @@ public class EtcdRegistryService implements RegistryService 
{
 
     @Override
     public List<EventMeshServicePubTopicInfo> 
findEventMeshServicePubTopicInfos() throws RegistryException {
-        return null;
+        return Collections.emptyList();
     }
 
     public Client getEtcdClient() {


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

Reply via email to