since the solr index is now used for all pages that are indexed locally,

there is no need for the RWI index if the index is not transfered to
another peer. Therefore the creation of RWI index data is now suppressed
if DHT is disabled. This applies for all intranet and portal mode
configurations, but not for public robinson modes. A robinson may switch
back to public mode and then transmit its data. That means if someone
wants to switch never to DHT mode, it would be more appropriate to
choose the portal mode.
pull/1/head
Michael Peter Christen 13 years ago
parent 554db5608b
commit bd769de604

@ -235,7 +235,7 @@ public class ConfigNetwork_p
prop.putHTML("network.unit.name", sb.getConfig(SwitchboardConstants.NETWORK_NAME, ""));
prop.putHTML("network.unit.description", sb.getConfig("network.unit.description", ""));
prop.putHTML("network.unit.domain", sb.getConfig(SwitchboardConstants.NETWORK_DOMAIN, ""));
prop.putHTML("network.unit.dht", sb.getConfig("network.unit.dht", ""));
prop.putHTML("network.unit.dht", sb.getConfig(SwitchboardConstants.DHT_ENABLED, ""));
networkBootstrapLocations.remove(sb.getConfig("network.unit.definition", ""));
int c = 0;
for ( final String s : networkBootstrapLocations ) {

@ -1177,7 +1177,7 @@ public final class Switchboard extends serverSwitch
ClientIdentification.generateYaCyBot(getConfig(SwitchboardConstants.NETWORK_NAME, "")
+ (isRobinsonMode() ? "-" : "/")
+ getConfig(SwitchboardConstants.NETWORK_DOMAIN, "global"));
if ( !getConfigBool("network.unit.dht", false)
if ( !getConfigBool(SwitchboardConstants.DHT_ENABLED, false)
&& getConfig("network.unit.tenant.agent", "").length() > 0 ) {
newagent = getConfig("network.unit.tenant.agent", "").trim();
this.log.logInfo("new user agent: '" + newagent + "'");
@ -2600,7 +2600,8 @@ public final class Switchboard extends serverSwitch
document,
condenser,
searchEvent,
sourceName);
sourceName,
getConfigBool(SwitchboardConstants.DHT_ENABLED, false));
final RSSFeed feed =
EventChannel.channels(queueEntry.initiator() == null
? EventChannel.PROXY
@ -2980,7 +2981,7 @@ public final class Switchboard extends serverSwitch
if ( this.peers.noDHTActivity() ) {
return "no DHT distribution: network too small";
}
if ( !getConfigBool("network.unit.dht", true) ) {
if ( !getConfigBool(SwitchboardConstants.DHT_ENABLED, true) ) {
return "no DHT distribution: disabled by network.unit.dht";
}
if ( getConfig(SwitchboardConstants.INDEX_DIST_ALLOW, "false").equalsIgnoreCase("false") ) {

@ -282,6 +282,8 @@ public final class SwitchboardConstants {
public static final String CLUSTER_MODE_PRIVATE_PEER = "privatepeer";
public static final String CLUSTER_PEERS_IPPORT = "cluster.peers.ipport";
public static final String DHT_ENABLED = "network.unit.dht";
public static final String DHT_BURST_ROBINSON = "network.unit.dht.burst.robinson";
public static final String DHT_BURST_MULTIWORD = "network.unit.dht.burst.multiword";

@ -177,7 +177,8 @@ public class DocumentIndex extends Segment {
document,
condenser,
null,
DocumentIndex.class.getName() + ".add");
DocumentIndex.class.getName() + ".add",
false);
}
return rows;
}

@ -351,7 +351,8 @@ public class Segment {
final Document document,
final Condenser condenser,
final SearchEvent searchEvent,
final String sourceName
final String sourceName,
final boolean storeToRWI
) {
final long startTime = System.currentTimeMillis();
@ -411,6 +412,7 @@ public class Segment {
final int urlComps = MultiProtocolURI.urlComps(url.toString()).length;
// create a word prototype which is re-used for all entries
if ((this.termIndex != null && storeToRWI) || searchEvent != null) {
final int len = (document == null) ? urlLength : document.dc_title().length();
final WordReferenceRow ientry = new WordReferenceRow(
url.hash(),
@ -433,7 +435,7 @@ public class Segment {
assert (wprop.flags != null);
ientry.setWord(wprop);
wordhash = Word.word2hash(word);
if (this.termIndex != null) try {
if (this.termIndex != null && storeToRWI) try {
this.termIndex.add(wordhash, ientry);
} catch (final Exception e) {
Log.logException(e);
@ -465,6 +467,7 @@ public class Segment {
} catch (final Exception e) {
Log.logException(e);
}
}
// STORE PAGE REFERENCES INTO CITATION INDEX
final int refs = addCitationIndex(url, modDate, document.getAnchors());

Loading…
Cancel
Save