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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2ac4941  Fix routingDataSourceType not configured in helix rest (#1309)
2ac4941 is described below

commit 2ac4941bf36bcc3347c9f1a1a294c1eb441db7ba
Author: Huizhi Lu <[email protected]>
AuthorDate: Mon Aug 24 16:11:10 2020 -0700

    Fix routingDataSourceType not configured in helix rest (#1309)
    
    Routing data source type is not set in helix rest when creating a 
realm-aware zkclient. This commit sets the source type to HTTP in helix rest 
server context.
---
 .../src/main/java/org/apache/helix/rest/server/ServerContext.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java 
b/helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
index dc19da7..9bb3098 100644
--- a/helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
+++ b/helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
@@ -41,6 +41,7 @@ import org.apache.helix.task.TaskDriver;
 import org.apache.helix.tools.ClusterSetup;
 import org.apache.helix.zookeeper.api.client.HelixZkClient;
 import org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
+import org.apache.helix.zookeeper.constant.RoutingDataReaderType;
 import org.apache.helix.zookeeper.datamodel.ZNRecord;
 import org.apache.helix.zookeeper.datamodel.serializer.ZNRecordSerializer;
 import org.apache.helix.zookeeper.impl.client.FederatedZkClient;
@@ -133,7 +134,8 @@ public class ServerContext implements IZkDataListener, 
IZkChildListener, IZkStat
                   new 
RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder();
               // If MSDS endpoint is set for this namespace, use that instead.
               if (_msdsEndpoint != null && !_msdsEndpoint.isEmpty()) {
-                
connectionConfigBuilder.setRoutingDataSourceEndpoint(_msdsEndpoint);
+                
connectionConfigBuilder.setRoutingDataSourceEndpoint(_msdsEndpoint)
+                    
.setRoutingDataSourceType(RoutingDataReaderType.HTTP.name());
               }
               _zkClient = new 
FederatedZkClient(connectionConfigBuilder.build(),
                   new RealmAwareZkClient.RealmAwareZkClientConfig()

Reply via email to