fixed another shutdown problem (only occurs if webgraph core is enabled)

pull/1/head
Michael Peter Christen 11 years ago
parent e485fbd0ce
commit 0e7d249a69

@ -126,6 +126,16 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
ensureAliveProcessHandler();
}
@Override
public int hashCode() {
return this.connector.hashCode();
}
@Override
public boolean equals(Object o) {
return o instanceof ConcurrentUpdateSolrConnector && this.connector.equals(((ConcurrentUpdateSolrConnector) o).connector);
}
@Override
public int bufferSize() {
return this.processQueue.size();

@ -98,6 +98,16 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
this.requestHandler.inform(this.core);
super.init(this.instance.getServer(coreName));
}
@Override
public int hashCode() {
return this.instance.hashCode();
}
@Override
public boolean equals(Object o) {
return o instanceof EmbeddedSolrConnector && this.instance.equals(((EmbeddedSolrConnector) o).instance);
}
@Override
public int bufferSize() {

@ -52,6 +52,19 @@ public class MirrorSolrConnector extends AbstractSolrConnector implements SolrCo
this.solr0 = solr0;
this.solr1 = solr1;
}
@Override
public int hashCode() {
return (this.solr0 == null ? 0 : this.solr0.hashCode()) + (this.solr1 == null ? 0 : this.solr1.hashCode());
}
@Override
public boolean equals(Object o) {
return o instanceof MirrorSolrConnector &&
((this.solr0 == null && ((MirrorSolrConnector) o).solr0 == null) || (((this.solr0 != null && ((MirrorSolrConnector) o).solr0 != null)) && this.solr0.equals(((MirrorSolrConnector) o).solr0))) &&
((this.solr1 == null && ((MirrorSolrConnector) o).solr1 == null) || (((this.solr1 != null && ((MirrorSolrConnector) o).solr1 != null)) && this.solr1.equals(((MirrorSolrConnector) o).solr1)));
}
@Override
public int bufferSize() {

@ -66,6 +66,16 @@ public class RemoteSolrConnector extends SolrServerConnector implements SolrConn
super.init(s);
}
@Override
public int hashCode() {
return this.instance.hashCode();
}
@Override
public boolean equals(Object o) {
return o instanceof RemoteSolrConnector && ((RemoteSolrConnector) o).instance.equals(this.instance);
}
public SolrInstance getInstance() {
return this.instance;
}

@ -100,6 +100,16 @@ public class EmbeddedInstance implements SolrInstance {
this.server.put(this.defaultCoreName, this.defaultCoreServer);
}
@Override
public int hashCode() {
return this.containerPath.hashCode();
}
@Override
public boolean equals(Object o) {
return o instanceof EmbeddedInstance && this.containerPath.equals(((EmbeddedInstance) o).containerPath);
}
private void initializeCoreConf(final File solr_config, final File containerPath, String coreName) {
// ensure that default core path exists

@ -22,7 +22,9 @@ package net.yacy.cora.federate.solr.instance;
import java.io.IOException;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.federate.solr.connector.ConcurrentUpdateSolrConnector;
@ -92,7 +94,9 @@ public class InstanceMirror {
}
public synchronized void close() {
for (SolrConnector connector: this.mirrorConnectorCache.values()) connector.close();
Set<SolrConnector> connectors = new HashSet<SolrConnector>();
connectors.addAll(this.mirrorConnectorCache.values());
for (SolrConnector connector: connectors) connector.close();
this.mirrorConnectorCache.clear();
}

@ -183,6 +183,16 @@ public class RemoteInstance implements SolrInstance {
if (this.defaultServer == null) throw new IOException("cannot connect to url " + url + " and connect core " + defaultCoreName);
}
@Override
public int hashCode() {
return this.solrurl.hashCode();
}
@Override
public boolean equals(Object o) {
return o instanceof RemoteInstance && ((RemoteInstance) o).solrurl.equals(this.solrurl);
}
public String getAdminInterface() {
final InetAddress localhostExternAddress = Domains.myPublicLocalIP();
final String localhostExtern = localhostExternAddress == null ? "127.0.0.1" : localhostExternAddress.getHostAddress();

Loading…
Cancel
Save