You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by el...@apache.org on 2016/06/21 22:02:33 UTC

[3/4] phoenix git commit: PHOENIX-3017 Catch TableNotFoundException and avoid logging at warn

PHOENIX-3017 Catch TableNotFoundException and avoid logging at warn


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/499f5c41
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/499f5c41
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/499f5c41

Branch: refs/heads/4.x-HBase-1.0
Commit: 499f5c4160becae75e91ebf904a7e2e95831a196
Parents: 3b06216
Author: Josh Elser <el...@apache.org>
Authored: Tue Jun 21 16:43:36 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Tue Jun 21 17:50:09 2016 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/query/TableStatsCache.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/499f5c41/phoenix-core/src/main/java/org/apache/phoenix/query/TableStatsCache.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/TableStatsCache.java b/phoenix-core/src/main/java/org/apache/phoenix/query/TableStatsCache.java
index 287886e..2c7b2db 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/TableStatsCache.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/TableStatsCache.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
@@ -93,6 +94,10 @@ public class TableStatsCache {
                         Long.MAX_VALUE);
                 traceStatsUpdate(tableNameBytes, stats);
                 return stats;
+            } catch (TableNotFoundException e) {
+                // On a fresh install, stats might not yet be created, don't warn about this.
+                logger.debug("Unable to locate Phoenix stats table", e);
+                return PTableStats.EMPTY_STATS;
             } catch (IOException e) {
                 logger.warn("Unable to read from stats table", e);
                 // Just cache empty stats. We'll try again after some time anyway.