arina-ielchiieva closed pull request #1482: DRILL-6762: Dynamic UDFs registered 
on 1 Drillbit not visible on others
URL: https://github.com/apache/drill/pull/1482
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java
index f24f9aaef58..79540500597 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java
@@ -408,7 +408,7 @@ private boolean isRegistrySyncNeeded() {
    * @return true is local registry should be refreshed, false otherwise
    */
   private boolean isRegistrySyncNeeded(long remoteVersion, long localVersion) {
-    return remoteVersion != -1 && remoteVersion != localVersion;
+    return remoteVersion != RemoteFunctionRegistry.UNREACHABLE && 
remoteVersion != localVersion;
   }
 
   /**
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/RemoteFunctionRegistry.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/RemoteFunctionRegistry.java
index 4e947656f3a..c2d8a9a932d 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/RemoteFunctionRegistry.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/RemoteFunctionRegistry.java
@@ -84,6 +84,7 @@
   private static final String registry_path = "registry";
   private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(RemoteFunctionRegistry.class);
   private static final ObjectMapper mapper = new 
ObjectMapper().enable(INDENT_OUTPUT);
+  public static final int UNREACHABLE = Integer.MIN_VALUE;
 
   private final TransientStoreListener unregistrationListener;
   private int retryAttempts;
@@ -108,9 +109,9 @@ public void init(DrillConfig config, 
PersistentStoreProvider storeProvider, Clus
 
   /**
    * Returns current remote function registry version.
-   * If remote function registry is not found or unreachable, logs error and 
returns -1.
+   * If remote function registry is not found or unreachable, logs error and 
returns UNREACHABLE (Integer.MIN_VALUE) .
    *
-   * @return remote function registry version if any, -1 otherwise
+   * @return remote function registry version if any, 
RemoteFunctionRegistry.UNREACHABLE otherwise
    */
   public long getRegistryVersion() {
     DataChangeVersion version = new DataChangeVersion();
@@ -124,7 +125,7 @@ public long getRegistryVersion() {
       return version.getVersion();
     } else {
       logger.error("Remote function registry [{}] is unreachable", 
registry_path);
-      return -1;
+      return UNREACHABLE;
     }
   }
 


 

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


With regards,
Apache Git Services

Reply via email to