Author: markrmiller
Date: Tue Jan 12 21:23:13 2010
New Revision: 898522
URL: http://svn.apache.org/viewvc?rev=898522&view=rev
Log:
more comments - synchronize cloud state (cloud state still needs overhaul)
Added:
lucene/solr/branches/cloud/junitvmwatcher1202296855631582538.properties
Modified:
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/CloudInfo.java
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ConnectionManager.java
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ShardsWatcher.java
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
Added: lucene/solr/branches/cloud/junitvmwatcher1202296855631582538.properties
URL:
http://svn.apache.org/viewvc/lucene/solr/branches/cloud/junitvmwatcher1202296855631582538.properties?rev=898522&view=auto
==============================================================================
--- lucene/solr/branches/cloud/junitvmwatcher1202296855631582538.properties
(added)
+++ lucene/solr/branches/cloud/junitvmwatcher1202296855631582538.properties Tue
Jan 12 21:23:13 2010
@@ -0,0 +1 @@
+terminated successfully
Modified:
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/CloudInfo.java
URL:
http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/CloudInfo.java?rev=898522&r1=898521&r2=898522&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/CloudInfo.java
(original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/CloudInfo.java
Tue Jan 12 21:23:13 2010
@@ -24,11 +24,11 @@
private Map<String,CollectionInfo> collectionInfos = new
HashMap<String,CollectionInfo>();
//nocommit
- public void addCollectionInfo(String collection, CollectionInfo
collectionInfo) {
+ public synchronized void addCollectionInfo(String collection, CollectionInfo
collectionInfo) {
collectionInfos.put(collection, collectionInfo);
}
- public CollectionInfo getCollectionInfo(String collection) {
+ public synchronized CollectionInfo getCollectionInfo(String collection) {
return collectionInfos.get(collection);
}
}
Modified:
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ConnectionManager.java
URL:
http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ConnectionManager.java?rev=898522&r1=898521&r2=898522&view=diff
==============================================================================
---
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ConnectionManager.java
(original)
+++
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ConnectionManager.java
Tue Jan 12 21:23:13 2010
@@ -76,6 +76,7 @@
clientConnected.countDown();
} else if (state == KeeperState.Expired) {
// nocommit : much to do here - if expired, on reconnect we must remake
ephemeral nodes (re-register cores)
+ // also may need to re-watch given nodes
// what about on disconnect ??
connected = false;
@@ -100,6 +101,7 @@
log.info("Connected:" + connected);
} else if (state == KeeperState.Disconnected) {
+ // nocommit : not sure we have to reconnect like this on disconnect
if(connected == false) {
// nocommit
System.out.println("we already know we are dc'd - why are we notified
twice?");
Modified:
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ShardsWatcher.java
URL:
http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ShardsWatcher.java?rev=898522&r1=898521&r2=898522&view=diff
==============================================================================
---
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ShardsWatcher.java
(original)
+++
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ShardsWatcher.java
Tue Jan 12 21:23:13 2010
@@ -48,7 +48,7 @@
// controller.getKeeperConnection().exists(event.getPath(), this);
// TODO: need to load whole state?
- controller.loadCloudInfo();
+ controller.readCloudInfo();
} catch (KeeperException e) {
log.error("", e);
Modified:
lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
URL:
http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java?rev=898522&r1=898521&r2=898522&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
(original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
Tue Jan 12 21:23:13 2010
@@ -115,7 +115,10 @@
public void command() {
try {
- loadCloudInfo();
+
+ // nocommit : re-register ephemeral nodes, wait a while
+ // for others to do the same, then load
+ readCloudInfo();
} catch (KeeperException e) {
log.error("ZooKeeper Exception", e);
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
@@ -369,7 +372,7 @@
}
// load and publish a new CollectionInfo
- public void loadCloudInfo() throws KeeperException, InterruptedException,
+ public void readCloudInfo() throws KeeperException, InterruptedException,
IOException {
// nocommit : not thread safe anymore ?
Modified:
lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
URL:
http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java?rev=898522&r1=898521&r2=898522&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
(original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
Tue Jan 12 21:23:13 2010
@@ -403,7 +403,7 @@
if(zooKeeperController != null) {
// nocommit : exceptions
try {
- zooKeeperController.loadCloudInfo();
+ zooKeeperController.readCloudInfo();
// nocommit : set shards node watches
zooKeeperController.watchShards();