lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1234230 - in /lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud: RecoveryStrategy.java SyncStrategy.java
Date Sat, 21 Jan 2012 01:40:52 GMT
Author: markrmiller
Date: Sat Jan 21 01:40:51 2012
New Revision: 1234230

URL: http://svn.apache.org/viewvc?rev=1234230&view=rev
Log:
turn on debug output

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java?rev=1234230&r1=1234229&r2=1234230&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
Sat Jan 21 01:40:51 2012
@@ -23,6 +23,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
+import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
 import org.apache.solr.client.solrj.request.CoreAdminRequest.PrepRecovery;
@@ -37,8 +38,10 @@ import org.apache.solr.core.RequestHandl
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.ReplicationHandler;
 import org.apache.solr.request.SolrRequestHandler;
+import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.update.UpdateLog;
 import org.apache.solr.update.UpdateLog.RecoveryInfo;
+import org.apache.solr.util.RefCounted;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -138,18 +141,18 @@ public class RecoveryStrategy extends Th
       }
       
       // nocommit
-//      try {
-//        RefCounted<SolrIndexSearcher> searchHolder = core.getNewestSearcher(false);
-//        SolrIndexSearcher searcher = searchHolder.get();
-//        try {
-//          System.out.println(core.getCoreDescriptor().getCoreContainer().getZkController().getNodeName()
+ " replicated "
-//              + searcher.search(new MatchAllDocsQuery(), 1).totalHits + " from " + leaderUrl
+ " gen:" + core.getDeletionPolicy().getLatestCommit().getGeneration() + " data:" + core.getDataDir());
-//        } finally {
-//          searchHolder.decref();
-//        }
-//      } catch (Exception e) {
-//        
-//      }
+      try {
+        RefCounted<SolrIndexSearcher> searchHolder = core.getNewestSearcher(false);
+        SolrIndexSearcher searcher = searchHolder.get();
+        try {
+          System.out.println(core.getCoreDescriptor().getCoreContainer().getZkController().getNodeName()
+ " replicated "
+              + searcher.search(new MatchAllDocsQuery(), 1).totalHits + " from " + leaderUrl
+ " gen:" + core.getDeletionPolicy().getLatestCommit().getGeneration() + " data:" + core.getDataDir());
+        } finally {
+          searchHolder.decref();
+        }
+      } catch (Exception e) {
+        
+      }
     }
   }
   
@@ -254,18 +257,18 @@ public class RecoveryStrategy extends Th
     }
     
     // nocommit
-//    try {
-//      RefCounted<SolrIndexSearcher> searchHolder = core.getNewestSearcher(false);
-//      SolrIndexSearcher searcher = searchHolder.get();
-//      try {
-//        System.out.println(core.getCoreDescriptor().getCoreContainer().getZkController().getNodeName()
+ " replayed "
-//            + searcher.search(new MatchAllDocsQuery(), 1).totalHits);
-//      } finally {
-//        searchHolder.decref();
-//      }
-//    } catch (Exception e) {
-//      
-//    }
+    try {
+      RefCounted<SolrIndexSearcher> searchHolder = core.getNewestSearcher(false);
+      SolrIndexSearcher searcher = searchHolder.get();
+      try {
+        System.out.println(core.getCoreDescriptor().getCoreContainer().getZkController().getNodeName()
+ " replayed "
+            + searcher.search(new MatchAllDocsQuery(), 1).totalHits);
+      } finally {
+        searchHolder.decref();
+      }
+    } catch (Exception e) {
+      
+    }
     
     return future;
   }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java?rev=1234230&r1=1234229&r2=1234230&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
Sat Jan 21 01:40:51 2012
@@ -195,7 +195,7 @@ public class SyncStrategy {
             "false"));
         CommonsHttpSolrServer server = new CommonsHttpSolrServer(
             node.getCoreUrl());
-        
+        System.out.println("ask " + node.getCoreUrl() + " to sync");
         NamedList rsp = server.request(qr);
         System.out.println("response about syncing to leader:" + rsp + " node:"
             + node.getCoreUrl() + " me:" + zkController.getBaseUrl());



Mime
View raw message