From 537cc460a38cb732d4567895caecd7c5cd3a3f84 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sun, 3 Nov 2013 15:36:06 +0000 Subject: [PATCH] tests: use debug logging level for solrcloud debug output git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1538380 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/cloud/ElectionContext.java | 4 ++-- .../java/org/apache/solr/cloud/RecoveryStrategy.java | 12 ++++++------ .../src/java/org/apache/solr/cloud/SyncStrategy.java | 6 +----- .../apache/solr/handler/admin/CoreAdminHandler.java | 8 ++++---- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java index 65cc11d6e84..ca5634044d5 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java +++ b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java @@ -226,13 +226,13 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase { } // solrcloud_debug - if (Boolean.getBoolean("solr.cloud.debug")) { + if (log.isDebugEnabled()) { try { RefCounted searchHolder = core .getNewestSearcher(false); SolrIndexSearcher searcher = searchHolder.get(); try { - System.err.println(core.getCoreDescriptor().getCoreContainer() + log.debug(core.getCoreDescriptor().getCoreContainer() .getZkController().getNodeName() + " synched " + searcher.search(new MatchAllDocsQuery(), 1).totalHits); diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java index 438b75fd70e..6ad73c8ba62 100644 --- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java @@ -156,13 +156,13 @@ public class RecoveryStrategy extends Thread implements ClosableThread { } // solrcloud_debug - if (Boolean.getBoolean("solr.cloud.debug")) { + if (log.isDebugEnabled()) { try { RefCounted searchHolder = core .getNewestSearcher(false); SolrIndexSearcher searcher = searchHolder.get(); try { - System.err.println(core.getCoreDescriptor().getCoreContainer() + log.debug(core.getCoreDescriptor().getCoreContainer() .getZkController().getNodeName() + " replicated " + searcher.search(new MatchAllDocsQuery(), 1).totalHits @@ -387,13 +387,13 @@ public class RecoveryStrategy extends Thread implements ClosableThread { log.info("PeerSync Recovery was successful - registering as Active. core=" + coreName); // solrcloud_debug - if (Boolean.getBoolean("solr.cloud.debug")) { + if (log.isDebugEnabled()) { try { RefCounted searchHolder = core .getNewestSearcher(false); SolrIndexSearcher searcher = searchHolder.get(); try { - System.err.println(core.getCoreDescriptor() + log.debug(core.getCoreDescriptor() .getCoreContainer().getZkController().getNodeName() + " synched " + searcher.search(new MatchAllDocsQuery(), 1).totalHits); @@ -536,13 +536,13 @@ public class RecoveryStrategy extends Thread implements ClosableThread { } // solrcloud_debug - if (Boolean.getBoolean("solr.cloud.debug")) { + if (log.isDebugEnabled()) { try { RefCounted searchHolder = core .getNewestSearcher(false); SolrIndexSearcher searcher = searchHolder.get(); try { - System.err.println(core.getCoreDescriptor().getCoreContainer() + log.debug(core.getCoreDescriptor().getCoreContainer() .getZkController().getNodeName() + " replayed " + searcher.search(new MatchAllDocsQuery(), 1).totalHits); diff --git a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java index 537f737f470..8249d2732e8 100644 --- a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java @@ -92,11 +92,7 @@ public class SyncStrategy { return false; } log.info("Sync replicas to " + ZkCoreNodeProps.getCoreUrl(leaderProps)); - // TODO: look at our state usage of sync - // zkController.publish(core, ZkStateReader.SYNC); - - // solrcloud_debug - // System.out.println("SYNC UP"); + if (core.getUpdateHandler().getUpdateLog() == null) { log.error("No UpdateLog found - cannot sync"); return false; diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java index 80072af6c4b..53ebed42404 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java @@ -796,13 +796,13 @@ public class CoreAdminHandler extends RequestHandlerBase { boolean success = syncStrategy.sync(zkController, core, new ZkNodeProps(props)); // solrcloud_debug - if (Boolean.getBoolean("solr.cloud.debug")) { + if (log.isDebugEnabled()) { try { RefCounted searchHolder = core .getNewestSearcher(false); SolrIndexSearcher searcher = searchHolder.get(); try { - System.err.println(core.getCoreDescriptor().getCoreContainer() + log.debug(core.getCoreDescriptor().getCoreContainer() .getZkController().getNodeName() + " synched " + searcher.search(new MatchAllDocsQuery(), 1).totalHits); @@ -915,7 +915,7 @@ public class CoreAdminHandler extends RequestHandlerBase { } // solrcloud_debug - if (Boolean.getBoolean("solr.cloud.debug")) { + if (log.isDebugEnabled()) { try { ; LocalSolrQueryRequest r = new LocalSolrQueryRequest(core, @@ -927,7 +927,7 @@ public class CoreAdminHandler extends RequestHandlerBase { .getNewestSearcher(false); SolrIndexSearcher searcher = searchHolder.get(); try { - System.err.println(core.getCoreDescriptor().getCoreContainer() + log.debug(core.getCoreDescriptor().getCoreContainer() .getZkController().getNodeName() + " to replicate " + searcher.search(new MatchAllDocsQuery(), 1).totalHits