|
|
|
@ -210,7 +210,6 @@ import net.yacy.utils.crypt;
|
|
|
|
|
import com.google.common.io.Files;
|
|
|
|
|
|
|
|
|
|
import net.yacy.http.YaCyHttpServer;
|
|
|
|
|
import net.yacy.http.YaCyLegacyCredential;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final class Switchboard extends serverSwitch {
|
|
|
|
@ -339,9 +338,10 @@ public final class Switchboard extends serverSwitch {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// load values from configs
|
|
|
|
|
final File indexPath =
|
|
|
|
|
getDataPath(SwitchboardConstants.INDEX_PRIMARY_PATH, SwitchboardConstants.INDEX_PATH_DEFAULT);
|
|
|
|
|
final File indexPath = getDataPath(SwitchboardConstants.INDEX_PRIMARY_PATH, SwitchboardConstants.INDEX_PATH_DEFAULT);
|
|
|
|
|
this.log.config("Index Primary Path: " + indexPath.toString());
|
|
|
|
|
final File archivePath = getDataPath(SwitchboardConstants.INDEX_ARCHIVE_PATH, SwitchboardConstants.INDEX_ARCHIVE_DEFAULT);
|
|
|
|
|
this.log.config("Index Archive Path: " + archivePath.toString());
|
|
|
|
|
this.listsPath =
|
|
|
|
|
getDataPath(SwitchboardConstants.LISTS_PATH, SwitchboardConstants.LISTS_PATH_DEFAULT);
|
|
|
|
|
this.log.config("Lists Path: " + this.listsPath.toString());
|
|
|
|
@ -498,7 +498,7 @@ public final class Switchboard extends serverSwitch {
|
|
|
|
|
// initialize index
|
|
|
|
|
ReferenceContainer.maxReferences = getConfigInt("index.maxReferences", 0);
|
|
|
|
|
final File segmentsPath = new File(new File(indexPath, networkName), "SEGMENTS");
|
|
|
|
|
this.index = new Segment(this.log, segmentsPath, solrCollectionConfigurationWork, solrWebgraphConfigurationWork);
|
|
|
|
|
this.index = new Segment(this.log, segmentsPath, archivePath, solrCollectionConfigurationWork, solrWebgraphConfigurationWork);
|
|
|
|
|
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_RWI, true)) try {
|
|
|
|
|
this.index.connectRWI(wordCacheMaxCount, fileSizeMax);
|
|
|
|
|
} catch (final IOException e) {ConcurrentLog.logException(e);}
|
|
|
|
@ -1331,7 +1331,9 @@ public final class Switchboard extends serverSwitch {
|
|
|
|
|
partitionExponent,
|
|
|
|
|
this.useTailCache,
|
|
|
|
|
this.exceed134217727);
|
|
|
|
|
this.index = new Segment(this.log, new File(new File(indexPrimaryPath, networkName), "SEGMENTS"), collectionConfiguration, webgraphConfiguration);
|
|
|
|
|
final File segmentsPath = new File(new File(indexPrimaryPath, networkName), "SEGMENTS");
|
|
|
|
|
final File archivePath = getDataPath(SwitchboardConstants.INDEX_ARCHIVE_PATH, SwitchboardConstants.INDEX_ARCHIVE_DEFAULT);
|
|
|
|
|
this.index = new Segment(this.log, segmentsPath, archivePath, collectionConfiguration, webgraphConfiguration);
|
|
|
|
|
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_RWI, true)) this.index.connectRWI(wordCacheMaxCount, fileSizeMax);
|
|
|
|
|
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_CITATION, true)) this.index.connectCitation(wordCacheMaxCount, fileSizeMax);
|
|
|
|
|
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_FULLTEXT, true)) {
|
|
|
|
@ -2458,7 +2460,7 @@ public final class Switchboard extends serverSwitch {
|
|
|
|
|
startupAction = false;
|
|
|
|
|
|
|
|
|
|
// execute api calls
|
|
|
|
|
final Map<String, Integer> callResult = this.tables.execAPICalls("localhost", (int) getConfigLong("port", 8090), pks, getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, ""));
|
|
|
|
|
final Map<String, Integer> callResult = this.tables.execAPICalls("localhost", (int) getConfigLong("port", 8090), pks, getConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, "admin"), getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, ""));
|
|
|
|
|
for ( final Map.Entry<String, Integer> call : callResult.entrySet() ) {
|
|
|
|
|
this.log.info("Scheduler executed api call, response " + call.getValue() + ": " + call.getKey());
|
|
|
|
|
}
|
|
|
|
@ -3737,7 +3739,7 @@ public final class Switchboard extends serverSwitch {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
scc.incrementAndGet();
|
|
|
|
|
final byte[] content = client.GETbytes(url, null);
|
|
|
|
|
final byte[] content = client.GETbytes(url, null, null);
|
|
|
|
|
Iterator<String> enu = FileUtils.strings(content);
|
|
|
|
|
int lc = 0;
|
|
|
|
|
while ( enu.hasNext() ) {
|
|
|
|
|