mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
reverted bf55f69176
to have a fall-back option in case that memory problems as reported in http://forum.yacy-websuche.de/viewtopic.php?p=26901#p26901 for full-solr installation are too strong and we have to work with an 'small memory footprint' peer system.
This commit is contained in:
parent
0904afe8fb
commit
cc47a0876e
|
@ -41,6 +41,7 @@ import net.yacy.cora.services.federated.solr.SolrConnector;
|
||||||
import net.yacy.cora.sorting.ConcurrentScoreMap;
|
import net.yacy.cora.sorting.ConcurrentScoreMap;
|
||||||
import net.yacy.cora.sorting.ScoreMap;
|
import net.yacy.cora.sorting.ScoreMap;
|
||||||
import net.yacy.cora.storage.HandleSet;
|
import net.yacy.cora.storage.HandleSet;
|
||||||
|
import net.yacy.cora.util.SpaceExceededException;
|
||||||
import net.yacy.document.parser.html.CharacterCoding;
|
import net.yacy.document.parser.html.CharacterCoding;
|
||||||
import net.yacy.kelondro.data.meta.DigestURI;
|
import net.yacy.kelondro.data.meta.DigestURI;
|
||||||
import net.yacy.kelondro.data.meta.URIMetadata;
|
import net.yacy.kelondro.data.meta.URIMetadata;
|
||||||
|
@ -263,14 +264,31 @@ public final class Fulltext implements Iterable<byte[]> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putMetadata(final URIMetadata entry) throws IOException {
|
public void putMetadata(final URIMetadata entry) throws IOException {
|
||||||
if (!this.connectedSolr()) return;
|
if (this.connectedSolr()) {
|
||||||
try {
|
try {
|
||||||
SolrDocument sd = getSolr().get(ASCII.String(entry.url().hash()));
|
SolrDocument sd = getSolr().get(ASCII.String(entry.url().hash()));
|
||||||
if (sd == null || !entry.isOlder(new URIMetadataNode(sd))) {
|
if (sd == null || !entry.isOlder(new URIMetadataNode(sd))) {
|
||||||
getSolr().add(getSolrScheme().metadata2solr(entry));
|
getSolr().add(getSolrScheme().metadata2solr(entry));
|
||||||
}
|
}
|
||||||
} catch (SolrException e) {
|
} catch (SolrException e) {
|
||||||
throw new IOException(e.getMessage(), e);
|
throw new IOException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
} else if (this.urlIndexFile != null && entry instanceof URIMetadataRow) {
|
||||||
|
URIMetadata oldEntry = null;
|
||||||
|
try {
|
||||||
|
final Row.Entry oe = this.urlIndexFile.get(entry.hash(), false);
|
||||||
|
oldEntry = (oe == null) ? null : new URIMetadataRow(oe, null, 0);
|
||||||
|
} catch (final Throwable e) {
|
||||||
|
Log.logException(e);
|
||||||
|
oldEntry = null;
|
||||||
|
}
|
||||||
|
if (oldEntry == null || !entry.isOlder(oldEntry)) {
|
||||||
|
try {
|
||||||
|
this.urlIndexFile.put(((URIMetadataRow) entry).toRowEntry());
|
||||||
|
} catch (final SpaceExceededException e) {
|
||||||
|
throw new IOException("RowSpaceExceededException in " + this.urlIndexFile.filename() + ": " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.statsDump = null;
|
this.statsDump = null;
|
||||||
if (MemoryControl.shortStatus()) clearCache();
|
if (MemoryControl.shortStatus()) clearCache();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user