pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] srkukarni commented on a change in pull request #2924: Added some basic checks for function/source/sink in cli as well
Date Sun, 04 Nov 2018 18:26:48 GMT
srkukarni commented on a change in pull request #2924: Added some basic checks for function/source/sink
in cli as well
URL: https://github.com/apache/pulsar/pull/2924#discussion_r230599510
 
 

 ##########
 File path: pulsar-common/src/main/java/org/apache/pulsar/common/functions/Utils.java
 ##########
 @@ -29,4 +34,39 @@ public static boolean isFunctionPackageUrlSupported(String functionPkgUrl)
{
         return isNotBlank(functionPkgUrl) && (functionPkgUrl.startsWith(HTTP)
                 || functionPkgUrl.startsWith(FILE));
     }
+
+    public static void inferMissingFunctionName(FunctionConfig functionConfig) {
+        String[] domains = functionConfig.getClassName().split("\\.");
+        if (domains.length == 0) {
+            functionConfig.setName(functionConfig.getClassName());
+        } else {
+            functionConfig.setName(domains[domains.length - 1]);
+        }
+    }
+
+    public static void inferMissingTenant(FunctionConfig functionConfig) {
+        functionConfig.setTenant(PUBLIC_TENANT);
+    }
+
+    public static void inferMissingNamespace(FunctionConfig functionConfig) {
+        functionConfig.setNamespace(DEFAULT_NAMESPACE);
+    }
+
+    public static void inferMissingArguments(SourceConfig sourceConfig) {
 
 Review comment:
   There are three:- One for FunctionConfig/SourceConfig/SinkConfig

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Mime
View raw message