[hotfix] [qs] Combine logging statements in 
QueryableStateUtils#createKvStateServer


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/5757942d
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/5757942d
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/5757942d

Branch: refs/heads/master
Commit: 5757942d598afa4b2df6a0beb8da38052dbbee10
Parents: a354a9a
Author: Till Rohrmann <[email protected]>
Authored: Thu Jan 25 10:56:35 2018 +0100
Committer: Till Rohrmann <[email protected]>
Committed: Thu Jan 25 15:33:30 2018 +0100

----------------------------------------------------------------------
 .../runtime/query/QueryableStateUtils.java      | 24 +++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/5757942d/flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateUtils.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateUtils.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateUtils.java
index adbe15d..c3f83447 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateUtils.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateUtils.java
@@ -73,10 +73,14 @@ public final class QueryableStateUtils {
                                        KvStateRequestStats.class);
                        return constructor.newInstance(address, ports, 
eventLoopThreads, queryThreads, stats);
                } catch (ClassNotFoundException e) {
-                       LOG.warn("Could not load Queryable State Client Proxy. 
" +
-                                       "Probable reason: 
flink-queryable-state-runtime is not in the classpath. " +
-                                       "Please put the corresponding jar from 
the opt to the lib folder.");
-                       LOG.debug("Caught exception", e);
+                       final String msg = "Could not load Queryable State 
Client Proxy. " +
+                               "Probable reason: flink-queryable-state-runtime 
is not in the classpath. " +
+                               "Please put the corresponding jar from the opt 
to the lib folder.";
+                       if (LOG.isDebugEnabled()) {
+                               LOG.debug(msg, e);
+                       } else {
+                               LOG.info(msg);
+                       }
                        return null;
                } catch (InvocationTargetException e) {
                        LOG.error("Queryable State Client Proxy could not be 
created: ", e.getTargetException());
@@ -128,10 +132,14 @@ public final class QueryableStateUtils {
                                        KvStateRequestStats.class);
                        return constructor.newInstance(address, ports, 
eventLoopThreads, queryThreads, kvStateRegistry, stats);
                } catch (ClassNotFoundException e) {
-                       LOG.warn("Could not load Queryable State Server. " +
-                                       "Probable reason: 
flink-queryable-state-runtime is not in the classpath. " +
-                                       "Please put the corresponding jar from 
the opt to the lib folder.");
-                       LOG.debug("Caught exception", e);
+                       final String msg = "Could not load Queryable State 
Server. " +
+                               "Probable reason: flink-queryable-state-runtime 
is not in the classpath. " +
+                               "Please put the corresponding jar from the opt 
to the lib folder.";
+                       if (LOG.isDebugEnabled()) {
+                               LOG.debug(msg, e);
+                       } else {
+                               LOG.info(msg);
+                       }
                        return null;
                } catch (InvocationTargetException e) {
                        LOG.error("Queryable State Server could not be created: 
", e.getTargetException());

Reply via email to