mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-03-11 13:21:11 -04:00
added missing @Override annotation
This commit is contained in:
parent
e515dd460d
commit
8b44fcf0f4
htroot
source/net/yacy
cora
date
document/analysis
federate
solr
connector
instance
yacy
language/phonetic
order
protocol
sorting
AbstractScoreMap.javaArray.javaConcurrentScoreMap.javaOrderedScoreMap.javaRating.javaUpDownLatch.java
storage
util
crawler/robots
data
document
content
importer
language
parser/rdfa/impl
gui
http
kelondro
blob
data/navigation
index
io
rwi
table
util
BDecoder.javaGenerationMemoryStrategy.javaNamePrefixThreadFactory.javaReverseMapIterator.javaStandardMemoryStrategy.java
workflow
peers
search
upnp
utils
visualization
yacy.java@ -34,8 +34,6 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
||||
import net.yacy.cora.document.id.Punycode.PunycodeException;
|
||||
import net.yacy.cora.protocol.HeaderFramework;
|
||||
import net.yacy.cora.protocol.RequestHeader;
|
||||
|
@ -591,6 +591,7 @@ public class HostBrowser {
|
||||
this.references_external = (rc_external == null || rc_external.intValue() <= 0) ? 0 : rc_external.intValue();
|
||||
this.references_exthosts = (rc_exthosts == null || rc_exthosts.intValue() <= 0) ? 0 : rc_exthosts.intValue();
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sbi = new StringBuilder();
|
||||
int c = 0;
|
||||
|
@ -43,8 +43,11 @@ public abstract class AbstractFormatter implements DateFormatter {
|
||||
protected long last_time;
|
||||
protected String last_format;
|
||||
|
||||
@Override
|
||||
public abstract Date parse(String s) throws ParseException;
|
||||
@Override
|
||||
public abstract String format(final Date date);
|
||||
@Override
|
||||
public abstract String format();
|
||||
|
||||
}
|
||||
|
@ -191,6 +191,7 @@ public class ISO8601Formatter extends AbstractFormatter implements DateFormatter
|
||||
}
|
||||
return last_format;
|
||||
}
|
||||
@Override
|
||||
public final String format() {
|
||||
long time = System.currentTimeMillis();
|
||||
if (Math.abs(time - last_time) < 1000) return last_format;
|
||||
|
@ -165,6 +165,7 @@ public class EnhancedTextProfileSignature extends Lookup3Signature {
|
||||
}
|
||||
|
||||
private static class TokenComparator implements Comparator<Token> {
|
||||
@Override
|
||||
public int compare(Token t1, Token t2) {
|
||||
return t2.cnt - t1.cnt;
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ public class CachedSolrConnector extends AbstractSolrConnector implements SolrCo
|
||||
return this.solr == null || this.solr.isClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
this.close();
|
||||
}
|
||||
|
@ -158,6 +158,7 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
|
||||
return this.core == null || this.core.isClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
this.close();
|
||||
}
|
||||
@ -339,6 +340,7 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDocumentCountByParams(ModifiableSolrParams params) throws IOException, SolrException {
|
||||
SolrQueryRequest req = this.request(params);
|
||||
SolrQueryResponse response = null;
|
||||
@ -382,6 +384,7 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
|
||||
this.request = null;
|
||||
this.response = null;
|
||||
}
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {close();} finally {super.finalize();}
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
|
||||
* force an explicit merge of segments
|
||||
* @param maxSegments the maximum number of segments. Set to 1 for maximum optimization
|
||||
*/
|
||||
@Override
|
||||
public void optimize(int maxSegments) {
|
||||
if (this.server == null) return;
|
||||
if (getSegmentCount() <= maxSegments) return;
|
||||
@ -321,6 +322,7 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
|
||||
* get the number of segments.
|
||||
* @return the number of segments, or 0 if unknown
|
||||
*/
|
||||
@Override
|
||||
public int getSegmentCount() {
|
||||
if (this.server == null) return 0;
|
||||
try {
|
||||
|
@ -216,6 +216,7 @@ public class EmbeddedInstance implements SolrInstance {
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
this.close();
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param docs the collection of documents
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(Collection<SolrInputDocument> docs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.add(docs);
|
||||
@ -74,6 +75,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(Collection<SolrInputDocument> docs, int commitWithinMs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.add(docs, commitWithinMs);
|
||||
@ -86,6 +88,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param beans the collection of beans
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBeans(Collection<?> beans ) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.addBeans(beans);
|
||||
@ -100,6 +103,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.addBeans(beans, commitWithinMs);
|
||||
@ -112,6 +116,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param doc the input document
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(SolrInputDocument doc) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.add(doc);
|
||||
@ -126,6 +131,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(SolrInputDocument doc, int commitWithinMs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.add(doc, commitWithinMs);
|
||||
@ -138,6 +144,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param obj the input bean
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBean(Object obj) throws IOException, SolrServerException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.addBean(obj);
|
||||
@ -152,6 +159,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.addBean(obj, commitWithinMs);
|
||||
@ -165,6 +173,7 @@ public class ServerMirror extends SolrServer {
|
||||
* waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse commit() throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.commit();
|
||||
@ -180,6 +189,7 @@ public class ServerMirror extends SolrServer {
|
||||
* Note: In most cases it is not required to do explicit optimize
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse optimize() throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.optimize();
|
||||
@ -193,6 +203,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse commit(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.commit(waitFlush, waitSearcher);
|
||||
@ -207,6 +218,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param softCommit makes index changes visible while neither fsync-ing index files nor writing a new index descriptor
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse commit( boolean waitFlush, boolean waitSearcher, boolean softCommit ) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.commit(waitFlush, waitSearcher, softCommit);
|
||||
@ -222,6 +234,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.optimize(waitFlush, waitSearcher);
|
||||
@ -238,6 +251,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param maxSegments optimizes down to at most this number of segments
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher, int maxSegments ) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.optimize(waitFlush, waitSearcher, maxSegments);
|
||||
@ -253,6 +267,7 @@ public class ServerMirror extends SolrServer {
|
||||
* a commit etc.
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse rollback() throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.rollback();
|
||||
@ -265,6 +280,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param id the ID of the document to delete
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(String id) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.deleteById(id);
|
||||
@ -279,6 +295,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since 3.6
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(String id, int commitWithinMs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.deleteById(id, commitWithinMs);
|
||||
@ -291,6 +308,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param ids the list of document IDs to delete
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.deleteById(ids);
|
||||
@ -305,6 +323,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since 3.6
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(List<String> ids, int commitWithinMs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.deleteById(ids, commitWithinMs);
|
||||
@ -317,6 +336,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param query the query expressing what documents to delete
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteByQuery(String query) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.deleteByQuery(query);
|
||||
@ -331,6 +351,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since 3.6
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteByQuery(String query, int commitWithinMs) throws SolrServerException, IOException {
|
||||
UpdateResponse ur = null;
|
||||
if (this.solr0 != null) ur = this.solr0.deleteByQuery(query, commitWithinMs);
|
||||
@ -342,6 +363,7 @@ public class ServerMirror extends SolrServer {
|
||||
* Issues a ping request to check if the server is alive
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public SolrPingResponse ping() throws SolrServerException, IOException {
|
||||
if (this.solr0 != null) return this.solr0.ping();
|
||||
if (this.solr1 != null) return this.solr1.ping();
|
||||
@ -352,6 +374,7 @@ public class ServerMirror extends SolrServer {
|
||||
* Performs a query to the Solr server
|
||||
* @param params an object holding all key/value parameters to send along the request
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse query(SolrParams params) throws SolrServerException {
|
||||
if (this.solr0 != null) return this.solr0.query(params);
|
||||
if (this.solr1 != null) return this.solr1.query(params);
|
||||
@ -363,6 +386,7 @@ public class ServerMirror extends SolrServer {
|
||||
* @param params an object holding all key/value parameters to send along the request
|
||||
* @param method specifies the HTTP method to use for the request, such as GET or POST
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse query(SolrParams params, METHOD method) throws SolrServerException {
|
||||
if (this.solr0 != null) return this.solr0.query(params, method);
|
||||
if (this.solr1 != null) return this.solr1.query(params, method);
|
||||
@ -380,6 +404,7 @@ public class ServerMirror extends SolrServer {
|
||||
*
|
||||
* @since solr 4.0
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse queryAndStreamResponse( SolrParams params, StreamingResponseCallback callback ) throws SolrServerException, IOException {
|
||||
if (this.solr0 != null) return this.solr0.queryAndStreamResponse(params, callback);
|
||||
if (this.solr1 != null) return this.solr1.queryAndStreamResponse(params, callback);
|
||||
@ -389,12 +414,14 @@ public class ServerMirror extends SolrServer {
|
||||
/**
|
||||
* SolrServer implementations need to implement how a request is actually processed
|
||||
*/
|
||||
@Override
|
||||
public NamedList<Object> request( final SolrRequest request ) throws SolrServerException, IOException {
|
||||
if (this.solr0 != null) return this.solr0.request(request);
|
||||
if (this.solr1 != null) return this.solr1.request(request);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentObjectBinder getBinder() {
|
||||
if (this.solr0 != null) return this.solr0.getBinder();
|
||||
if (this.solr1 != null) return this.solr1.getBinder();
|
||||
|
@ -66,6 +66,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param docs the collection of documents
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(Collection<SolrInputDocument> docs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -80,6 +81,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(Collection<SolrInputDocument> docs, int commitWithinMs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -92,6 +94,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param beans the collection of beans
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBeans(Collection<?> beans ) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -106,6 +109,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -118,6 +122,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param doc the input document
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(SolrInputDocument doc) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
return server.get(this.sharding.select(doc)).add(doc);
|
||||
@ -130,6 +135,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse add(SolrInputDocument doc, int commitWithinMs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
return server.get(this.sharding.select(doc)).add(doc, commitWithinMs);
|
||||
@ -140,6 +146,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param obj the input bean
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBean(Object obj) throws IOException, SolrServerException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -154,6 +161,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since solr 3.5
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -167,6 +175,7 @@ public class ServerShard extends SolrServer {
|
||||
* waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse commit() throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -182,6 +191,7 @@ public class ServerShard extends SolrServer {
|
||||
* Note: In most cases it is not required to do explicit optimize
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse optimize() throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -195,6 +205,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse commit(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -209,6 +220,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param softCommit makes index changes visible while neither fsync-ing index files nor writing a new index descriptor
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse commit(boolean waitFlush, boolean waitSearcher, boolean softCommit) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -224,6 +236,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -240,6 +253,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param maxSegments optimizes down to at most this number of segments
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher, int maxSegments) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -255,6 +269,7 @@ public class ServerShard extends SolrServer {
|
||||
* a commit etc.
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse rollback() throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -267,6 +282,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param id the ID of the document to delete
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(String id) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -281,6 +297,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since 3.6
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(String id, int commitWithinMs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -293,6 +310,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param ids the list of document IDs to delete
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -307,6 +325,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since 3.6
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteById(List<String> ids, int commitWithinMs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -319,6 +338,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param query the query expressing what documents to delete
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteByQuery(String query) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -333,6 +353,7 @@ public class ServerShard extends SolrServer {
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
* @since 3.6
|
||||
*/
|
||||
@Override
|
||||
public UpdateResponse deleteByQuery(String query, int commitWithinMs) throws SolrServerException, IOException {
|
||||
if (!this.writeEnabled) return _dummyOKResponse;
|
||||
UpdateResponse ur = null;
|
||||
@ -344,6 +365,7 @@ public class ServerShard extends SolrServer {
|
||||
* Issues a ping request to check if the server is alive
|
||||
* @throws IOException If there is a low-level I/O error.
|
||||
*/
|
||||
@Override
|
||||
public SolrPingResponse ping() throws SolrServerException, IOException {
|
||||
for (SolrServer s: server) {
|
||||
SolrPingResponse spr = s.ping();
|
||||
@ -356,6 +378,7 @@ public class ServerShard extends SolrServer {
|
||||
* Performs a query to the Solr server
|
||||
* @param params an object holding all key/value parameters to send along the request
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse query(final SolrParams params) throws SolrServerException {
|
||||
|
||||
final Collection<QueryResponse> qrl = new ConcurrentLinkedQueue<QueryResponse>();
|
||||
@ -389,6 +412,7 @@ public class ServerShard extends SolrServer {
|
||||
* @param params an object holding all key/value parameters to send along the request
|
||||
* @param method specifies the HTTP method to use for the request, such as GET or POST
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse query(final SolrParams params, final METHOD method) throws SolrServerException {
|
||||
|
||||
final Collection<QueryResponse> qrl = new ConcurrentLinkedQueue<QueryResponse>();
|
||||
@ -429,6 +453,7 @@ public class ServerShard extends SolrServer {
|
||||
*
|
||||
* @since solr 4.0
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse queryAndStreamResponse( SolrParams params, StreamingResponseCallback callback ) throws SolrServerException, IOException {
|
||||
throw new UnsupportedOperationException("stream response not possible with shards");
|
||||
}
|
||||
@ -436,12 +461,14 @@ public class ServerShard extends SolrServer {
|
||||
/**
|
||||
* SolrServer implementations need to implement how a request is actually processed
|
||||
*/
|
||||
@Override
|
||||
public NamedList<Object> request(final SolrRequest request) throws SolrServerException, IOException {
|
||||
ResponseAccumulator acc = new ResponseAccumulator();
|
||||
for (SolrServer s: server) acc.addResponse(s.request(request));
|
||||
return acc.getAccumulatedResponse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentObjectBinder getBinder() {
|
||||
DocumentObjectBinder db;
|
||||
for (SolrServer s: server) {
|
||||
|
@ -111,6 +111,7 @@ public class Peer extends HashMap<Peer.Schema, String> implements Comparable<Pee
|
||||
* get the hash code of the peer.
|
||||
* The hash code is a number that has the same order as the peer order.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
String h = this.get(Schema.hash);
|
||||
return (int) (Base64Order.enhancedCoder.cardinal(h) >> 32);
|
||||
@ -120,6 +121,7 @@ public class Peer extends HashMap<Peer.Schema, String> implements Comparable<Pee
|
||||
* check if two peers are equal:
|
||||
* two peers are equal if they have the same hash.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof Peer)) return false;
|
||||
String h0 = this.get(Schema.hash);
|
||||
|
@ -62,6 +62,7 @@ public class Peers extends TreeMap<byte[], Peer> implements Serializable {
|
||||
if (System.currentTimeMillis() - this.lastBootstrap < 60000) return;
|
||||
lastBootstrap = System.currentTimeMillis();
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
String[] peers = bootstrapList(select(false, false));
|
||||
bootstrap(peers, 1);
|
||||
@ -86,6 +87,7 @@ public class Peers extends TreeMap<byte[], Peer> implements Serializable {
|
||||
for (Integer pn: s) {
|
||||
final String bp = peers[pn.intValue()];
|
||||
Thread t0 = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Peers ps;
|
||||
try {
|
||||
|
@ -387,6 +387,7 @@ public class ColognePhonetic implements StringEncoder {
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object encode(Object object) throws EncoderException {
|
||||
if (!(object instanceof String)) {
|
||||
throw new EncoderException("This method's parameter was expected to be of the type " +
|
||||
@ -398,6 +399,7 @@ public class ColognePhonetic implements StringEncoder {
|
||||
return encode((String) object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String encode(String text) {
|
||||
return colognePhonetic(text);
|
||||
}
|
||||
|
@ -198,6 +198,7 @@ public class DoubleMetaphone implements StringEncoder {
|
||||
* @return An encoded Object (will be of type String)
|
||||
* @throws EncoderException encode parameter is not of type String
|
||||
*/
|
||||
@Override
|
||||
public Object encode(Object obj) throws EncoderException {
|
||||
if (!(obj instanceof String)) {
|
||||
throw new EncoderException("DoubleMetaphone encode parameter is not of type String");
|
||||
@ -211,6 +212,7 @@ public class DoubleMetaphone implements StringEncoder {
|
||||
* @param value String to encode
|
||||
* @return An encoded String
|
||||
*/
|
||||
@Override
|
||||
public String encode(String value) {
|
||||
return doubleMetaphone(value);
|
||||
}
|
||||
|
@ -363,6 +363,7 @@ public class Metaphone implements StringEncoder {
|
||||
* @throws EncoderException if the parameter supplied is not
|
||||
* of type java.lang.String
|
||||
*/
|
||||
@Override
|
||||
public Object encode(Object pObject) throws EncoderException {
|
||||
if (!(pObject instanceof String)) {
|
||||
throw new EncoderException("Parameter supplied to Metaphone encode is not of type java.lang.String");
|
||||
@ -376,6 +377,7 @@ public class Metaphone implements StringEncoder {
|
||||
* @param pString String object to encode
|
||||
* @return The metaphone code corresponding to the String supplied
|
||||
*/
|
||||
@Override
|
||||
public String encode(String pString) {
|
||||
return metaphone(pString);
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ public class Soundex implements StringEncoder {
|
||||
* @throws IllegalArgumentException
|
||||
* if a character is not mapped
|
||||
*/
|
||||
@Override
|
||||
public Object encode(Object pObject) throws EncoderException {
|
||||
if (!(pObject instanceof String)) {
|
||||
throw new EncoderException("Parameter supplied to Soundex encode is not of type java.lang.String");
|
||||
@ -151,6 +152,7 @@ public class Soundex implements StringEncoder {
|
||||
* @throws IllegalArgumentException
|
||||
* if a character is not mapped
|
||||
*/
|
||||
@Override
|
||||
public String encode(String pString) {
|
||||
return soundex(pString);
|
||||
}
|
||||
|
@ -33,19 +33,23 @@ public abstract class AbstractOrder<A> implements Order<A> {
|
||||
@Override
|
||||
abstract public Order<A> clone();
|
||||
|
||||
@Override
|
||||
public A zero() {
|
||||
return this.zero;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void direction(final boolean ascending) {
|
||||
this.asc = ascending;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long partition(final A key, final int forks) {
|
||||
final long d = (Long.MAX_VALUE / forks) + ((Long.MAX_VALUE % forks) + 1) / forks;
|
||||
return cardinal(key) / d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rotate(final A newzero) {
|
||||
this.zero = newzero;
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ public interface Order<A> extends Comparator<A> {
|
||||
*/
|
||||
public long cardinal(A key);
|
||||
|
||||
@Override
|
||||
public int compare(A a, A b);
|
||||
|
||||
public boolean equal(A a, A b);
|
||||
|
@ -269,6 +269,7 @@ public class ConnectionInfo implements Comparable<ConnectionInfo> {
|
||||
return this.id == other.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ConnectionInfo o) {
|
||||
if(o==null) throw new NullPointerException("ConnectionInfo: compare() : passed argument is null \n");
|
||||
if(this.initTime>o.initTime) return 1;
|
||||
|
@ -44,20 +44,24 @@ public class GzipCompressingEntity extends HttpEntityWrapper {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
public Header getContentEncoding() {
|
||||
@Override
|
||||
public Header getContentEncoding() {
|
||||
return new BasicHeader(HTTP.CONTENT_ENCODING, GZIP_CODEC);
|
||||
}
|
||||
|
||||
public long getContentLength() {
|
||||
@Override
|
||||
public long getContentLength() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean isChunked() {
|
||||
@Override
|
||||
public boolean isChunked() {
|
||||
// force content chunking
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(final OutputStream outstream) throws IOException {
|
||||
@Override
|
||||
public void writeTo(final OutputStream outstream) throws IOException {
|
||||
if (outstream == null) {
|
||||
throw new IllegalArgumentException("Output stream may not be null");
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ public class GzipRequestInterceptor implements HttpRequestInterceptor {
|
||||
private static final String ACCEPT_ENCODING = "Accept-Encoding";
|
||||
private static final String GZIP_CODEC = "gzip";
|
||||
|
||||
@Override
|
||||
public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
|
||||
if (!request.containsHeader(ACCEPT_ENCODING)) {
|
||||
request.addHeader(ACCEPT_ENCODING, GZIP_CODEC);
|
||||
|
@ -41,6 +41,7 @@ public class GzipResponseInterceptor implements HttpResponseInterceptor {
|
||||
|
||||
private static final String GZIP_CODEC = "gzip";
|
||||
|
||||
@Override
|
||||
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException {
|
||||
if (context == null) {
|
||||
throw new IllegalArgumentException("HTTP context may not be null");
|
||||
|
@ -690,7 +690,8 @@ public class HTTPClient {
|
||||
final CloseableHttpResponse[] thr = new CloseableHttpResponse[]{null};
|
||||
final Throwable[] te = new Throwable[]{null};
|
||||
Thread t = new Thread() {
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
this.setName("HTTPClient.execute(" + httpUriRequest.getURI() + ")");
|
||||
try {
|
||||
thr[0] = client.execute(httpUriRequest, context);
|
||||
|
@ -55,18 +55,22 @@ public class NonClosingInputStreamEntity extends AbstractHttpEntity {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepeatable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getContentLength() {
|
||||
return this.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getContent() throws IOException {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final OutputStream outstream) throws IOException {
|
||||
if (outstream == null) {
|
||||
throw new IllegalArgumentException("Output stream may not be null");
|
||||
@ -93,6 +97,7 @@ public class NonClosingInputStreamEntity extends AbstractHttpEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStreaming() {
|
||||
return true;
|
||||
}
|
||||
@ -101,6 +106,7 @@ public class NonClosingInputStreamEntity extends AbstractHttpEntity {
|
||||
* @deprecated Either use {@link #getContent()} and call {@link java.io.InputStream#close()} on that;
|
||||
* otherwise call {@link #writeTo(OutputStream)} which is required to free the resources.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public void consumeContent() throws IOException {
|
||||
// If the input stream is from a connection, closing it will read to
|
||||
|
@ -35,6 +35,7 @@ public abstract class AbstractScoreMap<E> implements ScoreMap<E> {
|
||||
/**
|
||||
* apply all E/int mappings from an external ScoreMap to this ScoreMap
|
||||
*/
|
||||
@Override
|
||||
public void inc(ScoreMap<E> map) {
|
||||
if (map == null) return;
|
||||
for (E entry: map) {
|
||||
@ -48,6 +49,7 @@ public abstract class AbstractScoreMap<E> implements ScoreMap<E> {
|
||||
* @param score
|
||||
* @return the objects of the smaller entries from at least 1/2 of the list
|
||||
*/
|
||||
@Override
|
||||
public List<E> lowerHalf() {
|
||||
|
||||
// first calculate the average of the entries
|
||||
@ -75,6 +77,7 @@ public abstract class AbstractScoreMap<E> implements ScoreMap<E> {
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<E> keyList(final boolean up) {
|
||||
List<E> list = new ArrayList<E>(this.size());
|
||||
Iterator<E> i = this.keys(up);
|
||||
|
@ -63,6 +63,7 @@ public class Array {
|
||||
}
|
||||
|
||||
private static class SortJobWorker extends Thread {
|
||||
@Override
|
||||
public void run() {
|
||||
this.setName("Array.SortJobWorker");
|
||||
SortJob<?> job;
|
||||
|
@ -46,10 +46,12 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
this.gcount = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return this.map.keySet().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void clear() {
|
||||
this.map.clear();
|
||||
this.gcount = 0;
|
||||
@ -59,6 +61,7 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
* shrink the cluster to a demanded size
|
||||
* @param maxsize
|
||||
*/
|
||||
@Override
|
||||
public void shrinkToMaxSize(final int maxsize) {
|
||||
if (this.map.size() <= maxsize) return;
|
||||
int minScore = getMinScore();
|
||||
@ -72,6 +75,7 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
* shrink the cluster in such a way that the smallest score is equal or greater than a given minScore
|
||||
* @param minScore
|
||||
*/
|
||||
@Override
|
||||
public void shrinkToMinScore(final int minScore) {
|
||||
final Iterator<Map.Entry<E, AtomicLong>> i = this.map.entrySet().iterator();
|
||||
Map.Entry<E, AtomicLong> entry;
|
||||
@ -85,18 +89,22 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
return this.gcount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return this.map.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sizeSmaller(final int size) {
|
||||
return this.map.size() < size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return this.map.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inc(final E obj) {
|
||||
if (obj == null) return;
|
||||
|
||||
@ -108,6 +116,7 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
this.gcount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dec(final E obj) {
|
||||
if (obj == null) return;
|
||||
|
||||
@ -119,6 +128,7 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
this.gcount--;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(final E obj, final int newScore) {
|
||||
if (obj == null) return;
|
||||
|
||||
@ -130,6 +140,7 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
this.gcount += newScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inc(final E obj, final int incrementScore) {
|
||||
if (obj == null) return;
|
||||
|
||||
@ -141,10 +152,12 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
this.gcount += incrementScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dec(final E obj, final int decrementScore) {
|
||||
inc(obj, -decrementScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(final E obj) {
|
||||
// deletes entry and returns previous score
|
||||
if (obj == null) return 0;
|
||||
@ -156,10 +169,12 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
return score.intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(final E obj) {
|
||||
return this.map.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int get(final E obj) {
|
||||
if (obj == null) return 0;
|
||||
final AtomicLong score = this.map.get(obj);
|
||||
@ -193,6 +208,7 @@ public class ConcurrentScoreMap<E> extends AbstractScoreMap<E> implements ScoreM
|
||||
return this.map.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> keys(final boolean up) {
|
||||
// re-organize entries
|
||||
final TreeMap<Integer, Set<E>> m = new TreeMap<Integer, Set<E>>();
|
||||
|
@ -52,10 +52,12 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return this.map.keySet().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void clear() {
|
||||
this.map.clear();
|
||||
}
|
||||
@ -64,6 +66,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
* shrink the cluster to a demanded size
|
||||
* @param maxsize
|
||||
*/
|
||||
@Override
|
||||
public void shrinkToMaxSize(final int maxsize) {
|
||||
if (this.map.size() <= maxsize) return;
|
||||
int minScore = getMinScore();
|
||||
@ -77,6 +80,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
* shrink the cluster in such a way that the smallest score is equal or greater than a given minScore
|
||||
* @param minScore
|
||||
*/
|
||||
@Override
|
||||
public void shrinkToMinScore(final int minScore) {
|
||||
synchronized (this.map) {
|
||||
final Iterator<Map.Entry<E, AtomicInteger>> i = this.map.entrySet().iterator();
|
||||
@ -88,6 +92,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
synchronized (this.map) {
|
||||
return this.map.size();
|
||||
@ -99,6 +104,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean sizeSmaller(final int size) {
|
||||
if (this.map.size() < size) return true;
|
||||
synchronized (this.map) {
|
||||
@ -106,6 +112,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
if (this.map.isEmpty()) return true;
|
||||
synchronized (this.map) {
|
||||
@ -113,6 +120,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inc(final E obj) {
|
||||
if (obj == null) return;
|
||||
AtomicInteger score = this.map.get(obj);
|
||||
@ -130,6 +138,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
score.incrementAndGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dec(final E obj) {
|
||||
if (obj == null) return;
|
||||
AtomicInteger score;
|
||||
@ -143,6 +152,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
score.decrementAndGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(final E obj, final int newScore) {
|
||||
if (obj == null) return;
|
||||
AtomicInteger score;
|
||||
@ -156,6 +166,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
score.getAndSet(newScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inc(final E obj, final int incrementScore) {
|
||||
if (obj == null) return;
|
||||
AtomicInteger score;
|
||||
@ -169,10 +180,12 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
score.addAndGet(incrementScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dec(final E obj, final int incrementScore) {
|
||||
inc(obj, -incrementScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(final E obj) {
|
||||
// deletes entry and returns previous score
|
||||
if (obj == null) return 0;
|
||||
@ -184,12 +197,14 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
return score.intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(final E obj) {
|
||||
synchronized (this.map) {
|
||||
return this.map.containsKey(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int get(final E obj) {
|
||||
if (obj == null) return 0;
|
||||
final AtomicInteger score;
|
||||
@ -218,6 +233,7 @@ public class OrderedScoreMap<E> extends AbstractScoreMap<E> implements ScoreMap<
|
||||
return minScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> keys(final boolean up) {
|
||||
synchronized (this.map) {
|
||||
// re-organize entries
|
||||
|
@ -52,6 +52,7 @@ public class Rating<A> {
|
||||
|
||||
public static class ScoreComparator implements Comparator<Rating<?>> {
|
||||
|
||||
@Override
|
||||
public int compare(final Rating<?> arg0, final Rating<?> arg1) {
|
||||
if (arg0.getScore() < arg1.getScore()) return -1;
|
||||
if (arg0.getScore() > arg1.getScore()) return 1;
|
||||
@ -61,6 +62,7 @@ public class Rating<A> {
|
||||
|
||||
public static class FoldedScoreComparator<B extends Comparable<B>> implements Comparator<Rating<B>> {
|
||||
|
||||
@Override
|
||||
public int compare(final Rating<B> arg0, final Rating<B> arg1) {
|
||||
final int c = scoreComparator.compare(arg0, arg1);
|
||||
if (c != 0) return c;
|
||||
|
@ -38,10 +38,12 @@ public class UpDownLatch extends AbstractQueuedSynchronizer {
|
||||
return getState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tryAcquireShared(final int acquires) {
|
||||
return getState() == 0? 1 : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tryReleaseShared(final int releases) {
|
||||
// Decrement count; signal when transition to zero
|
||||
for (;;) {
|
||||
|
@ -117,6 +117,7 @@ public interface ARC<K, V> extends Iterable<Map.Entry<K, V>> {
|
||||
* iterator implements the Iterable interface
|
||||
* the method can easily be implemented using the entrySet method
|
||||
*/
|
||||
@Override
|
||||
public Iterator<Map.Entry<K, V>> iterator();
|
||||
|
||||
/**
|
||||
@ -132,5 +133,6 @@ public interface ARC<K, V> extends Iterable<Map.Entry<K, V>> {
|
||||
* a hash code for this ARC
|
||||
* @return a hash code
|
||||
*/
|
||||
@Override
|
||||
int hashCode();
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ public interface ARH<K> extends Iterable<K> {
|
||||
/**
|
||||
* iterator implements the Iterable interface
|
||||
*/
|
||||
@Override
|
||||
public Iterator<K> iterator();
|
||||
|
||||
/**
|
||||
@ -77,5 +78,6 @@ public interface ARH<K> extends Iterable<K> {
|
||||
* a hash code for this ARH
|
||||
* @return a hash code
|
||||
*/
|
||||
@Override
|
||||
int hashCode();
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
|
||||
* @param s
|
||||
* @param v
|
||||
*/
|
||||
@Override
|
||||
public final void insert(final K s, final V v) {
|
||||
this.arc[getPartition(s)].insert(s, v);
|
||||
}
|
||||
@ -100,6 +101,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
|
||||
* @param s
|
||||
* @param v
|
||||
*/
|
||||
@Override
|
||||
public void insertIfAbsent(final K s, final V v) {
|
||||
this.arc[getPartition(s)].insertIfAbsent(s, v);
|
||||
}
|
||||
@ -111,6 +113,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
|
||||
* @param v
|
||||
* @return the value before inserting the new value
|
||||
*/
|
||||
@Override
|
||||
public V putIfAbsent(final K s, final V v) {
|
||||
return this.arc[getPartition(s)].putIfAbsent(s, v);
|
||||
}
|
||||
@ -141,6 +144,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
|
||||
* @param value
|
||||
* @return the keys that have the given value
|
||||
*/
|
||||
@Override
|
||||
public Collection<K> getKeys(final V value) {
|
||||
final ArrayList<K> keys = new ArrayList<K>();
|
||||
for (final ARC<K, V> element : this.arc)
|
||||
@ -192,6 +196,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
|
||||
/**
|
||||
* iterator implements the Iterable interface
|
||||
*/
|
||||
@Override
|
||||
public Iterator<java.util.Map.Entry<K, V>> iterator() {
|
||||
return entrySet().iterator();
|
||||
}
|
||||
|
@ -37,34 +37,42 @@ public class SizeLimitedSet<E> extends AbstractSet<E> implements Set<E>, Cloneab
|
||||
map = new SizeLimitedMap<E,Object>(sizeLimit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return map.keySet().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return map.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return map.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
return map.containsKey(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(E e) {
|
||||
return map.put(e, OBJECT) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
return map.remove(o) == OBJECT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
map.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object clone() {
|
||||
try {
|
||||
|
@ -37,6 +37,7 @@ public abstract class LookAheadIterator<A> implements Iterator<A>, Iterable<A> {
|
||||
public LookAheadIterator() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Iterator<A> iterator() {
|
||||
return this;
|
||||
}
|
||||
@ -54,11 +55,13 @@ public abstract class LookAheadIterator<A> implements Iterator<A>, Iterable<A> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean hasNext() {
|
||||
checkInit();
|
||||
return this.next != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final A next() {
|
||||
checkInit();
|
||||
final A n = this.next;
|
||||
@ -69,6 +72,7 @@ public abstract class LookAheadIterator<A> implements Iterator<A>, Iterable<A> {
|
||||
/**
|
||||
* a remove is not possible with this implementation
|
||||
*/
|
||||
@Override
|
||||
public final void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public class StringBuilderComparator implements Comparator<StringBuilder> {
|
||||
this.caseInsensitive = caseInsensitive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(final StringBuilder sb0, final StringBuilder sb1) {
|
||||
final int l0 = sb0.length();
|
||||
final int l1 = sb1.length();
|
||||
|
@ -199,6 +199,7 @@ public class RobotsTxt {
|
||||
}
|
||||
if (robotsTable == null || robotsTable.containsKey(robotsTable.encodedKey(urlHostPort))) return;
|
||||
Thread t = new Thread() {
|
||||
@Override
|
||||
public void run(){
|
||||
this.setName("Robots.txt:ensureExist(" + theURL.toNormalform(true) + ")");
|
||||
// make or get a synchronization object
|
||||
@ -356,6 +357,7 @@ public class RobotsTxt {
|
||||
final Thread[] threads = new Thread[concurrency];
|
||||
for (int i = 0; i < concurrency; i++) {
|
||||
threads[i] = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
DigestURL u;
|
||||
try {
|
||||
|
@ -238,16 +238,19 @@ public class MessageBoard {
|
||||
nextKey = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return nextKey != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String next() {
|
||||
final String next = nextKey;
|
||||
findNext();
|
||||
return next;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
}
|
||||
|
||||
|
@ -596,6 +596,7 @@ public final class UserDB {
|
||||
//this.nextEntry = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
try {
|
||||
return this.userIter.hasNext();
|
||||
@ -605,6 +606,7 @@ public final class UserDB {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry next() {
|
||||
try {
|
||||
return getEntry(UTF8.String(this.userIter.next()));
|
||||
@ -614,6 +616,7 @@ public final class UserDB {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
// if (this.nextEntry != null) {
|
||||
// try {
|
||||
|
@ -55,7 +55,8 @@ public class YMarkDMOZImporter extends YMarkImporter {
|
||||
this.depth = Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
public void parse() throws Exception {
|
||||
@Override
|
||||
public void parse() throws Exception {
|
||||
xmlReader.parse(new InputSource(bmk_file));
|
||||
}
|
||||
|
||||
@ -78,7 +79,8 @@ public class YMarkDMOZImporter extends YMarkImporter {
|
||||
this.buffer = new StringBuilder(512);
|
||||
}
|
||||
|
||||
public void startElement(final String uri, String localName, final String qName, final Attributes attributes) throws SAXException {
|
||||
@Override
|
||||
public void startElement(final String uri, String localName, final String qName, final Attributes attributes) throws SAXException {
|
||||
// get rid of namespace prefixes
|
||||
if (localName.isEmpty()) {
|
||||
localName = qName.substring(qName.indexOf(':')+1);
|
||||
@ -102,7 +104,8 @@ public class YMarkDMOZImporter extends YMarkImporter {
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(final String uri, String localName, final String qName) throws SAXException {
|
||||
@Override
|
||||
public void endElement(final String uri, String localName, final String qName) throws SAXException {
|
||||
// get rid of namespace prefixes
|
||||
if (localName.isEmpty()) {
|
||||
localName = qName.substring(qName.indexOf(':')+1);
|
||||
@ -141,7 +144,8 @@ public class YMarkDMOZImporter extends YMarkImporter {
|
||||
this.buffer.setLength(0);
|
||||
}
|
||||
|
||||
public void characters(final char ch[], final int start, final int length) throws SAXException {
|
||||
@Override
|
||||
public void characters(final char ch[], final int start, final int length) throws SAXException {
|
||||
// no processing here, as the SAX Parser characters method could be called more than once per tag!
|
||||
if(this.tag != null) {
|
||||
buffer.append(ch, start, length);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// YMarkHTMLImporter.java
|
||||
// (C) 2011 by Stefan Förster, sof@gmx.de, Norderstedt, Germany
|
||||
// (C) 2011 by Stefan F<EFBFBD><EFBFBD>rster, sof@gmx.de, Norderstedt, Germany
|
||||
// first published 2010 on http://yacy.net
|
||||
//
|
||||
// This is a part of YaCy, a peer-to-peer based web search engine
|
||||
@ -59,7 +59,8 @@ public class YMarkHTMLImporter extends YMarkImporter {
|
||||
this(bmk_file, queueSize, targetFolder, "");
|
||||
}
|
||||
|
||||
public void parse() throws Exception {
|
||||
@Override
|
||||
public void parse() throws Exception {
|
||||
htmlParser.parse(bmk_file, new HTMLParser(), true);
|
||||
}
|
||||
|
||||
@ -78,7 +79,8 @@ public class YMarkHTMLImporter extends YMarkImporter {
|
||||
this.prevTag = null;
|
||||
}
|
||||
|
||||
public void handleText(char[] data, int pos) {
|
||||
@Override
|
||||
public void handleText(char[] data, int pos) {
|
||||
switch (state) {
|
||||
case NOTHING:
|
||||
break;
|
||||
@ -103,7 +105,8 @@ public class YMarkHTMLImporter extends YMarkImporter {
|
||||
}
|
||||
}
|
||||
|
||||
public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) {
|
||||
@Override
|
||||
public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) {
|
||||
if (t == HTML.Tag.A) {
|
||||
if (!this.bmk.isEmpty()) {
|
||||
try {
|
||||
@ -158,7 +161,8 @@ public class YMarkHTMLImporter extends YMarkImporter {
|
||||
this.prevTag = t;
|
||||
}
|
||||
|
||||
public void handleEndTag(HTML.Tag t, int pos) {
|
||||
@Override
|
||||
public void handleEndTag(HTML.Tag t, int pos) {
|
||||
// write the last bookmark, as no more <a> tags are following
|
||||
if (t == HTML.Tag.HTML) {
|
||||
if (!this.bmk.isEmpty()) {
|
||||
|
@ -60,13 +60,16 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
this.isFolder = true;
|
||||
}
|
||||
|
||||
public void startJSON() throws ParseException, IOException {
|
||||
@Override
|
||||
public void startJSON() throws ParseException, IOException {
|
||||
}
|
||||
|
||||
public void endJSON() throws ParseException, IOException {
|
||||
@Override
|
||||
public void endJSON() throws ParseException, IOException {
|
||||
}
|
||||
|
||||
public boolean startArray() throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean startArray() throws ParseException, IOException {
|
||||
final String key = this.key.toString();
|
||||
if(key.equals(CHILDREN) && this.isFolder) {
|
||||
if(this.depth > 0) {
|
||||
@ -80,7 +83,8 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean endArray() throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean endArray() throws ParseException, IOException {
|
||||
if(this.isAnnos) {
|
||||
this.isAnnos = false;
|
||||
} else if(this.depth > 0) {
|
||||
@ -93,14 +97,16 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean startObject() throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean startObject() throws ParseException, IOException {
|
||||
if(!this.isAnnos) {
|
||||
this.obj.clear();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean endObject() throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean endObject() throws ParseException, IOException {
|
||||
if(this.isBookmark) {
|
||||
this.bmk.put(YMarkEntry.BOOKMARK.TITLE.key(),obj.get(YMarkEntry.BOOKMARK.TITLE.json_attrb()));
|
||||
this.bmk.put(YMarkEntry.BOOKMARK.URL.key(),obj.get(YMarkEntry.BOOKMARK.URL.json_attrb()));
|
||||
@ -127,7 +133,8 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean startObjectEntry(String key) throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean startObjectEntry(String key) throws ParseException, IOException {
|
||||
if(!this.isAnnos) {
|
||||
this.key.setLength(0);
|
||||
this.key.append(key);
|
||||
@ -135,7 +142,8 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean primitive(Object value) throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean primitive(Object value) throws ParseException, IOException {
|
||||
if(!this.isAnnos) {
|
||||
this.value.setLength(0);
|
||||
if(value instanceof java.lang.String) {
|
||||
@ -149,7 +157,8 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean endObjectEntry() throws ParseException, IOException {
|
||||
@Override
|
||||
public boolean endObjectEntry() throws ParseException, IOException {
|
||||
if(!this.isAnnos) {
|
||||
final String key = this.key.toString();
|
||||
final String value = this.value.toString();
|
||||
@ -165,7 +174,8 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, "JSON Importer run()");
|
||||
this.parser.parse(this.bmk_file, this, true);
|
||||
|
@ -32,7 +32,8 @@ public class YMarkTag implements Comparable<YMarkTag>{
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public int compareTo(YMarkTag tag) {
|
||||
@Override
|
||||
public int compareTo(YMarkTag tag) {
|
||||
if(this.name.equals(tag.name()))
|
||||
return 0;
|
||||
if(tag.size() < this.size)
|
||||
|
@ -101,7 +101,8 @@ public class YMarkXBELImporter extends YMarkImporter {
|
||||
this(bmk_file, queueSize, "", targetFolder);
|
||||
}
|
||||
|
||||
public void parse() throws Exception {
|
||||
@Override
|
||||
public void parse() throws Exception {
|
||||
xmlReader.parse(new InputSource(bmk_file));
|
||||
}
|
||||
|
||||
@ -132,7 +133,8 @@ public class YMarkXBELImporter extends YMarkImporter {
|
||||
this.folder.append(targetFolder);
|
||||
}
|
||||
|
||||
public void endDocument() throws SAXException {
|
||||
@Override
|
||||
public void endDocument() throws SAXException {
|
||||
// put alias references in the bookmark queue to ensure that folders get updated
|
||||
// we do that at endDocument to ensure all referenced bookmarks already exist
|
||||
bookmarks.addAll(this.aliasRef);
|
||||
@ -140,7 +142,8 @@ public class YMarkXBELImporter extends YMarkImporter {
|
||||
this.bmkRef.clear();
|
||||
}
|
||||
|
||||
public void startElement(final String uri, final String name, String tag, final Attributes atts) throws SAXException {
|
||||
@Override
|
||||
public void startElement(final String uri, final String name, String tag, final Attributes atts) throws SAXException {
|
||||
YMarkDate date = new YMarkDate();
|
||||
if (tag == null) return;
|
||||
tag = tag.toLowerCase();
|
||||
@ -207,7 +210,8 @@ public class YMarkXBELImporter extends YMarkImporter {
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(final String uri, final String name, String tag) {
|
||||
@Override
|
||||
public void endElement(final String uri, final String name, String tag) {
|
||||
if (tag == null) return;
|
||||
tag = tag.toLowerCase();
|
||||
if(XBEL.BOOKMARK.tag().equals(tag)) {
|
||||
@ -236,7 +240,8 @@ public class YMarkXBELImporter extends YMarkImporter {
|
||||
}
|
||||
}
|
||||
|
||||
public void characters(final char ch[], final int start, final int length) {
|
||||
@Override
|
||||
public void characters(final char ch[], final int start, final int length) {
|
||||
// TODO move string processing to endElement as characters() could be called more than once per tag
|
||||
if (parse_value) {
|
||||
buffer.append(ch, start, length);
|
||||
|
@ -108,6 +108,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
this.saxParser.parse(this.inputSource, this);
|
||||
@ -131,6 +132,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startElement(final String uri, final String name, String tag, final Attributes atts) throws SAXException {
|
||||
if (tag == null) return;
|
||||
tag = tag.toLowerCase();
|
||||
@ -148,6 +150,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(final String uri, final String name, String tag) {
|
||||
if (tag == null) return;
|
||||
tag = tag.toLowerCase();
|
||||
@ -193,6 +196,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(final char ch[], final int start, final int length) {
|
||||
if (parsingValue) {
|
||||
buffer.append(ch, start, length);
|
||||
|
@ -93,6 +93,7 @@ public class ImportDump {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
close();
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ public interface Importer extends Runnable {
|
||||
/**
|
||||
* the run method from runnable
|
||||
*/
|
||||
@Override
|
||||
public void run();
|
||||
|
||||
}
|
||||
|
@ -241,6 +241,7 @@ public class ResumptionToken extends TreeMap<String, String> {
|
||||
return get("token");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "source = " + this.source + ", expirationDate=" + ISO8601Formatter.FORMATTER.format(getExpirationDate()) + ", completeListSize=" + getCompleteListSize() +
|
||||
", cursor=" + getCursor() + ", token=" + getToken();
|
||||
@ -306,6 +307,7 @@ public class ResumptionToken extends TreeMap<String, String> {
|
||||
cursor="0">1518323588</resumptionToken>
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void startElement(final String uri, final String name, final String tag, final Attributes atts) throws SAXException {
|
||||
if ("record".equals(tag)) {
|
||||
ResumptionToken.this.recordCounter++;
|
||||
@ -316,6 +318,7 @@ public class ResumptionToken extends TreeMap<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(final String uri, final String name, final String tag) {
|
||||
if (tag == null) return;
|
||||
if ("resumptionToken".equals(tag)) {
|
||||
@ -328,6 +331,7 @@ public class ResumptionToken extends TreeMap<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(final char ch[], final int start, final int length) {
|
||||
if (this.parsingValue) {
|
||||
this.buffer.append(ch, start, length);
|
||||
|
@ -31,6 +31,7 @@ class LanguageFilenameFilter implements FilenameFilter {
|
||||
|
||||
private static final String fileExtension = "lng";
|
||||
|
||||
@Override
|
||||
public boolean accept(final File dir, final String name) {
|
||||
if (name.matches(".+\\."+fileExtension)) {
|
||||
return true;
|
||||
|
@ -25,27 +25,33 @@ public class RDFaTripleContent implements IRDFaTriple {
|
||||
this.objectURI = objectURI;
|
||||
}
|
||||
|
||||
public String getSubjectURI() {
|
||||
@Override
|
||||
public String getSubjectURI() {
|
||||
return subjectURI;
|
||||
}
|
||||
|
||||
public String getSubjectNodeURI() {
|
||||
@Override
|
||||
public String getSubjectNodeURI() {
|
||||
return subjectNodeURI;
|
||||
}
|
||||
|
||||
public String getPropertyURI() {
|
||||
@Override
|
||||
public String getPropertyURI() {
|
||||
return propertyURI;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
@Override
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ public class InfoPage implements Layout {
|
||||
|
||||
private class CommitAction extends AbstractAction {
|
||||
private static final long serialVersionUID = 3630229455629476865L;
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
//int pos = SearchBox.getSelectionEnd();
|
||||
Browser.openBrowser("http://" + host + ":" + port + "/yacysearch.html?display=0&verify=true&contentdom=text&nav=all&maximumRecords=10&startRecord=0&resource=global&urlmaskfilter=.*&prefermaskfilter=&indexof=off&meanCount=5&query=" + SearchBox.getText().replace(' ', '+'));
|
||||
@ -75,6 +76,7 @@ public class InfoPage implements Layout {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LayoutManager getPage(JComponent context, DocumentListener listener) {
|
||||
GroupLayout page = new GroupLayout(context);
|
||||
|
||||
|
@ -71,7 +71,8 @@ public final class Tray {
|
||||
if(SystemTray.isSupported()) {
|
||||
final String iconPath = sb.getAppPath().toString() + "/addon/YaCy_TrayIcon.png".replace("/", File.separator);
|
||||
ActionListener al = new ActionListener() {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
doubleClickAction();
|
||||
}
|
||||
};
|
||||
@ -112,7 +113,7 @@ public final class Tray {
|
||||
if (deutsch)
|
||||
label = "Bitte warten bis YaCy gestartet ist.";
|
||||
else if (french)
|
||||
label = "S'il vous plaît attendre jusqu'à YaCy est démarré.";
|
||||
label = "S'il vous pla<EFBFBD><EFBFBD>t attendre jusqu'<27><> YaCy est d<><64>marr<72><72>.";
|
||||
else
|
||||
label = "Please wait until YaCy is started.";
|
||||
//ti.displayMessage("YaCy",label);
|
||||
@ -147,7 +148,8 @@ public final class Tray {
|
||||
label = "YaCy Search";
|
||||
menuItem = new MenuItem(label);
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
openBrowserPage("");
|
||||
}
|
||||
});
|
||||
@ -180,7 +182,8 @@ public final class Tray {
|
||||
label = "Peer Administration";
|
||||
menuItem = new MenuItem(label);
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
openBrowserPage("Status.html");
|
||||
}
|
||||
});
|
||||
@ -193,12 +196,13 @@ public final class Tray {
|
||||
if(deutsch)
|
||||
label = "YaCy Beenden";
|
||||
else if(french)
|
||||
label = "Arrêt YaCy";
|
||||
label = "Arr<EFBFBD><EFBFBD>t YaCy";
|
||||
else
|
||||
label = "Shutdown YaCy";
|
||||
menuItem = new MenuItem(label);
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
sb.terminate("shutdown from tray");
|
||||
}
|
||||
});
|
||||
|
@ -74,14 +74,17 @@ public class Application extends JFrame implements DocumentListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertUpdate(DocumentEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUpdate(DocumentEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
|
||||
}
|
||||
|
@ -27,10 +27,7 @@ package net.yacy.http;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
@ -54,7 +51,6 @@ import org.apache.http.Header;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
|
||||
/**
|
||||
* jetty http handler
|
||||
@ -117,7 +113,8 @@ public class ProxyHandler extends AbstractRemoteHandler implements Handler {
|
||||
final Thread t = new Thread() {
|
||||
final Response yacyResponse = response;
|
||||
final byte[] cacheArray = array;
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
this.setName("ProxyHandler.storeToCache(" + yacyResponse.url() + ")");
|
||||
if (yacyResponse == null) return;
|
||||
|
||||
|
@ -40,7 +40,6 @@ import net.yacy.cora.protocol.HeaderFramework;
|
||||
import net.yacy.cora.util.ConcurrentLog;
|
||||
import net.yacy.data.UserDB;
|
||||
import net.yacy.search.Switchboard;
|
||||
import net.yacy.search.SwitchboardConstants;
|
||||
import net.yacy.search.query.AccessTracker;
|
||||
import net.yacy.search.query.QueryGoal;
|
||||
import net.yacy.search.query.QueryModifier;
|
||||
|
@ -44,11 +44,13 @@ public class TablesColumnRAMIndex extends TablesColumnIndex{
|
||||
this.index = new ConcurrentHashMap<String, Map<String, TreeSet<byte[]>>>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteIndex(final String columnName) {
|
||||
this.index.remove(columnName);
|
||||
}
|
||||
|
||||
protected void insertPK(final String columnName, final String columnValue, final byte[] pk) {
|
||||
@Override
|
||||
protected void insertPK(final String columnName, final String columnValue, final byte[] pk) {
|
||||
Map<String, TreeSet<byte[]>> valueIdxMap;
|
||||
TreeSet<byte[]> PKset;
|
||||
if(this.index.containsKey(columnName)) {
|
||||
@ -68,7 +70,8 @@ public class TablesColumnRAMIndex extends TablesColumnIndex{
|
||||
PKset.add(pk);
|
||||
}
|
||||
|
||||
protected synchronized void removePK(final byte[] pk) {
|
||||
@Override
|
||||
protected synchronized void removePK(final byte[] pk) {
|
||||
for(Map.Entry<String, Map<String, TreeSet<byte[]>>> columnName : this.index.entrySet()) {
|
||||
final Iterator<Map.Entry<String, TreeSet<byte[]>>> viter = columnName.getValue().entrySet().iterator();
|
||||
while(viter.hasNext()) {
|
||||
@ -80,15 +83,18 @@ public class TablesColumnRAMIndex extends TablesColumnIndex{
|
||||
}
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
@Override
|
||||
public void clear() {
|
||||
this.index.clear();
|
||||
}
|
||||
|
||||
public Collection<String> columns() {
|
||||
@Override
|
||||
public Collection<String> columns() {
|
||||
return this.index.keySet();
|
||||
}
|
||||
|
||||
public Set<String> keySet(final String columnName) {
|
||||
@Override
|
||||
public Set<String> keySet(final String columnName) {
|
||||
// a TreeSet is used to get sorted set of keys (e.g. folders)
|
||||
if(this.index.containsKey(columnName)) {
|
||||
return new TreeSet<String>(this.index.get(columnName).keySet());
|
||||
@ -96,29 +102,34 @@ public class TablesColumnRAMIndex extends TablesColumnIndex{
|
||||
return new TreeSet<String>();
|
||||
}
|
||||
|
||||
public boolean containsKey(final String columnName, final String columnValue) {
|
||||
@Override
|
||||
public boolean containsKey(final String columnName, final String columnValue) {
|
||||
if(this.index.containsKey(columnName)) {
|
||||
return this.index.get(columnName).containsKey(columnValue);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasIndex(final String columnName) {
|
||||
@Override
|
||||
public boolean hasIndex(final String columnName) {
|
||||
return this.index.containsKey(columnName);
|
||||
}
|
||||
|
||||
public Collection<byte[]> get(final String columnName, final String key) {
|
||||
@Override
|
||||
public Collection<byte[]> get(final String columnName, final String key) {
|
||||
return this.index.get(columnName).get(key);
|
||||
}
|
||||
|
||||
public int size(final String columnName) {
|
||||
@Override
|
||||
public int size(final String columnName) {
|
||||
if(this.index.containsKey(columnName)) {
|
||||
return this.index.get(columnName).size();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
@Override
|
||||
public int size() {
|
||||
return this.index.size();
|
||||
}
|
||||
}
|
@ -31,12 +31,15 @@ import net.yacy.kelondro.rwi.Reference;
|
||||
|
||||
public interface NavigationReference extends Reference {
|
||||
|
||||
@Override
|
||||
public String toPropertyForm();
|
||||
|
||||
@Override
|
||||
public Entry toKelondroEntry();
|
||||
|
||||
public String navigationHash();
|
||||
|
||||
@Override
|
||||
public byte[] urlhash();
|
||||
|
||||
public byte[] termHash();
|
||||
|
@ -101,35 +101,43 @@ public final class NavigationReferenceRow extends AbstractReference implements N
|
||||
return new NavigationReferenceRow(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toPropertyForm() {
|
||||
return this.entry.toPropertyForm('=', true, true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry toKelondroEntry() {
|
||||
return this.entry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String navigationHash() {
|
||||
return this.entry.getColASCII(col_navhash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] urlhash() {
|
||||
return ASCII.getBytes(navigationHash().substring(12));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] termHash() {
|
||||
return ASCII.getBytes(navigationHash().substring(0, 12));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hitcount() {
|
||||
return (int) this.entry.getColLong(col_count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int position(final int p) {
|
||||
assert p == 0 : "p = " + p;
|
||||
return (int) this.entry.getColLong(col_pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte flags() {
|
||||
return (byte) this.entry.getColLong(col_flags);
|
||||
}
|
||||
@ -153,20 +161,24 @@ public final class NavigationReferenceRow extends AbstractReference implements N
|
||||
return navigationHash().equals(other.navigationHash());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOlder(final Reference other) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// unsupported operations:
|
||||
|
||||
@Override
|
||||
public void join(final Reference oe) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long lastModified() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Integer> positions() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ public interface Index extends Iterable<Row.Entry> {
|
||||
public CloneableIterator<byte[]> keys(boolean up, byte[] firstKey) throws IOException; // iterates only the key
|
||||
public CloneableIterator<Row.Entry> rows(boolean up, byte[] firstKey) throws IOException; // iterates the whole row using the order of the keys
|
||||
public CloneableIterator<Row.Entry> rows() throws IOException; // iterates the whole row without any order
|
||||
@Override
|
||||
public Iterator<Row.Entry> iterator();
|
||||
public void deleteOnExit();
|
||||
public void clear() throws IOException;
|
||||
|
@ -63,6 +63,7 @@ public final class RAMIndexCluster implements Index, Iterable<Row.Entry>, Clonea
|
||||
this.rowdef = rowdef;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void optimize() {
|
||||
for (final RAMIndex i: this.cluster) if (i != null) i.optimize();
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ public final class RowHandleMap implements HandleMap, Iterable<Map.Entry<byte[],
|
||||
this.index.optimize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long mem() {
|
||||
return this.index.mem();
|
||||
}
|
||||
|
@ -33,22 +33,30 @@ public abstract class AbstractReader implements Reader {
|
||||
// logging support
|
||||
protected String name = null;
|
||||
protected File file = null;
|
||||
@Override
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public File file() {
|
||||
return file;
|
||||
}
|
||||
|
||||
// pseudo-native methods:
|
||||
@Override
|
||||
abstract public void readFully(byte[] b, int off, int len) throws IOException;
|
||||
@Override
|
||||
abstract public long length() throws IOException;
|
||||
@Override
|
||||
abstract public long available() throws IOException;
|
||||
@Override
|
||||
abstract public void seek(long pos) throws IOException;
|
||||
@Override
|
||||
abstract public void close() throws IOException;
|
||||
|
||||
|
||||
// derived methods:
|
||||
@Override
|
||||
public final byte[] readFully() throws IOException {
|
||||
long a = this.available();
|
||||
if (a <= 0) return null;
|
||||
@ -58,6 +66,7 @@ public abstract class AbstractReader implements Reader {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final short readShort() throws IOException {
|
||||
byte[] b = new byte[2];
|
||||
this.readFully(b, 0, 2);
|
||||
@ -65,6 +74,7 @@ public abstract class AbstractReader implements Reader {
|
||||
return (short) (((b[0] & 0xFF) << 8) | (b[1] & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int readInt() throws IOException {
|
||||
byte[] b = new byte[4];
|
||||
this.readFully(b, 0, 4);
|
||||
@ -72,6 +82,7 @@ public abstract class AbstractReader implements Reader {
|
||||
return (((b[0] & 0xFF) << 24) | ((b[1] & 0xFF) << 16) | ((b[2] & 0xFF) << 8) | (b[3] & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readLong() throws IOException {
|
||||
return ((long) (readInt()) << 32) | (readInt() & 0xFFFFFFFFL);
|
||||
}
|
||||
|
@ -40,12 +40,15 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
|
||||
|
||||
// pseudo-native methods:
|
||||
@Override
|
||||
abstract public void setLength(long length) throws IOException;
|
||||
@Override
|
||||
abstract public void write(byte[] b, int off, int len) throws IOException;
|
||||
|
||||
// derived methods:
|
||||
|
||||
|
||||
@Override
|
||||
public final void writeShort(final int v) throws IOException {
|
||||
byte[] b = new byte[2];
|
||||
b[0] = (byte) ((v >>> 8) & 0xFF);
|
||||
@ -53,6 +56,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
this.write(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void writeInt(final int v) throws IOException {
|
||||
this.write(int2array(v));
|
||||
}
|
||||
@ -66,6 +70,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void writeLong(final long v) throws IOException {
|
||||
byte[] b = new byte[8];
|
||||
b[0] = (byte) ((v >>> 56) & 0xFF);
|
||||
@ -79,6 +84,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
this.write(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void write(final byte[] b) throws IOException {
|
||||
this.write(b, 0, b.length);
|
||||
}
|
||||
@ -86,6 +92,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
private final static byte cr = 13;
|
||||
private final static byte lf = 10;
|
||||
|
||||
@Override
|
||||
public final void writeLine(final String line) throws IOException {
|
||||
final byte[] b = new byte[line.length() + 2];
|
||||
System.arraycopy(UTF8.getBytes(line), 0, b, 0, line.length());
|
||||
@ -102,6 +109,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
this.write(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void writeMap(final Map<String, String> map, final String comment) throws IOException {
|
||||
this.seek(0);
|
||||
final Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator();
|
||||
@ -119,6 +127,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
bb.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final HashMap<String, String> readMap() throws IOException {
|
||||
this.seek(0);
|
||||
final byte[] b = readFully();
|
||||
@ -137,6 +146,7 @@ public abstract class AbstractWriter extends AbstractReader implements Writer {
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void deleteOnExit() {
|
||||
if (this.file != null) this.file.deleteOnExit();
|
||||
}
|
||||
|
@ -63,18 +63,21 @@ public final class ByteCountOutputStream extends BufferedOutputStream {
|
||||
}
|
||||
|
||||
/** @see java.io.OutputStream#write(byte[]) */
|
||||
@Override
|
||||
public final void write(final byte[] b) throws IOException {
|
||||
super.write(b);
|
||||
this.byteCount += b.length;
|
||||
}
|
||||
|
||||
/** @see java.io.OutputStream#write(byte[], int, int) */
|
||||
@Override
|
||||
public final synchronized void write(final byte[] b, final int off, final int len) throws IOException {
|
||||
super.write(b, off, len);
|
||||
this.byteCount += len;
|
||||
}
|
||||
|
||||
/** @see java.io.OutputStream#write(int) */
|
||||
@Override
|
||||
public final synchronized void write(final int b) throws IOException {
|
||||
super.write(b);
|
||||
this.byteCount++;
|
||||
|
@ -49,14 +49,17 @@ public final class CachedFileReader extends AbstractReader implements Reader {
|
||||
this.cachelen = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final synchronized long available() throws IOException {
|
||||
return this.length() - RAFile.getFilePointer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final synchronized long length() throws IOException {
|
||||
return this.RAFile.length();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final synchronized void readFully(final byte[] b, final int off, int len) throws IOException {
|
||||
long seek = RAFile.getFilePointer();
|
||||
if (cache != null && cachelen - seek >= len) {
|
||||
@ -70,10 +73,12 @@ public final class CachedFileReader extends AbstractReader implements Reader {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final synchronized void seek(final long pos) throws IOException {
|
||||
RAFile.seek(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final synchronized void close() {
|
||||
if (RAFile != null) try {
|
||||
try{RAFile.getChannel().close();} catch (final IOException e) {}
|
||||
|
@ -40,6 +40,7 @@ public abstract class AbstractBufferedIndex<ReferenceType extends Reference> ext
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized TreeSet<ReferenceContainer<ReferenceType>> referenceContainer(byte[] startHash, final boolean rot, final boolean excludePrivate, int count, final boolean ram) throws IOException {
|
||||
// creates a set of indexContainers
|
||||
// this does not use the cache
|
||||
|
@ -88,14 +88,17 @@ public abstract class AbstractReference implements Reference {
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxposition() {
|
||||
return max(positions());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minposition() {
|
||||
return min(positions());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int distance() {
|
||||
if (positions().size() < 2) return 0;
|
||||
int d = 0;
|
||||
@ -109,6 +112,7 @@ public abstract class AbstractReference implements Reference {
|
||||
return d / (positions().size() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOlder(final Reference other) {
|
||||
if (other == null) return false;
|
||||
if (this.lastModified() < other.lastModified()) return true;
|
||||
|
@ -39,6 +39,7 @@ public class ReferenceContainerOrder<ReferenceType extends Reference> extends Ab
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wellformed(final ReferenceContainer<ReferenceType> a) {
|
||||
return embeddedOrder.wellformed(a.getTermHash());
|
||||
}
|
||||
@ -52,10 +53,12 @@ public class ReferenceContainerOrder<ReferenceType extends Reference> extends Ab
|
||||
return this.embeddedOrder.partition(key, forks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(final ReferenceContainer<ReferenceType> a, final ReferenceContainer<ReferenceType> b) {
|
||||
return this.embeddedOrder.compare(a.getTermHash(), b.getTermHash());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equal(ReferenceContainer<ReferenceType> a, ReferenceContainer<ReferenceType> b) {
|
||||
return this.embeddedOrder.equal(a.getTermHash(), b.getTermHash());
|
||||
}
|
||||
@ -66,10 +69,12 @@ public class ReferenceContainerOrder<ReferenceType extends Reference> extends Ab
|
||||
this.zero = new ReferenceContainer<ReferenceType>(this.factory, this.embeddedOrder.zero(), zero);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order<ReferenceContainer<ReferenceType>> clone() {
|
||||
return new ReferenceContainerOrder<ReferenceType>(this.factory, this.embeddedOrder.clone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String signature() {
|
||||
return this.embeddedOrder.signature();
|
||||
}
|
||||
@ -88,7 +93,8 @@ public class ReferenceContainerOrder<ReferenceType extends Reference> extends Ab
|
||||
return this.embeddedOrder.equals(other.embeddedOrder);
|
||||
}
|
||||
|
||||
public long cardinal(final ReferenceContainer<ReferenceType> key) {
|
||||
@Override
|
||||
public long cardinal(final ReferenceContainer<ReferenceType> key) {
|
||||
return this.embeddedOrder.cardinal(key.getTermHash());
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,7 @@ public class ReferenceIterator <ReferenceType extends Reference> extends LookAhe
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
if (this.blobs != null) this.blobs.close();
|
||||
this.blobs = null;
|
||||
|
@ -63,6 +63,7 @@ public class ChunkIterator extends LookAheadIterator<byte[]> implements Iterator
|
||||
this.stream = new DataInputStream(new BufferedInputStream(new FileInputStream(file), 64 * 1024));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] next0() {
|
||||
final byte[] chunk = new byte[chunksize];
|
||||
int r, s;
|
||||
|
@ -72,22 +72,27 @@ public class BDecoder {
|
||||
|
||||
private static abstract class BDfltObject implements BObject {
|
||||
|
||||
@Override
|
||||
public long getInteger() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BObject> getList() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, BObject> getMap() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getString() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BType getType() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@ -116,6 +121,7 @@ public class BDecoder {
|
||||
public String toString() {
|
||||
return UTF8.String(this.b);
|
||||
}
|
||||
@Override
|
||||
public void toStream(OutputStream os) throws IOException {
|
||||
os.write(ASCII.getBytes(Integer.toString(this.b.length)));
|
||||
os.write(_p);
|
||||
@ -156,6 +162,7 @@ public class BDecoder {
|
||||
s.append("]");
|
||||
return s.toString();
|
||||
}
|
||||
@Override
|
||||
public void toStream(OutputStream os) throws IOException {
|
||||
os.write(_l);
|
||||
for (final BObject bo: this.l) bo.toStream(os);
|
||||
@ -185,6 +192,7 @@ public class BDecoder {
|
||||
s.append('}');
|
||||
return s.toString();
|
||||
}
|
||||
@Override
|
||||
public void toStream(OutputStream os) throws IOException {
|
||||
os.write(_d);
|
||||
for (final Map.Entry<String, BObject> e: this.m.entrySet()) {
|
||||
@ -218,6 +226,7 @@ public class BDecoder {
|
||||
public String toString() {
|
||||
return Long.toString(this.i);
|
||||
}
|
||||
@Override
|
||||
public void toStream(OutputStream os) throws IOException {
|
||||
os.write(_i);
|
||||
os.write(ASCII.getBytes(Long.toString(this.i)));
|
||||
|
@ -49,6 +49,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
* memory that is free without increasing of total memory taken from os
|
||||
* @return bytes
|
||||
*/
|
||||
@Override
|
||||
protected final long free() {
|
||||
return getUsage(eden, false).getCommitted() - getUsage(eden, false).getUsed();
|
||||
}
|
||||
@ -58,6 +59,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
* Smallest of both old and young
|
||||
* @return bytes
|
||||
*/
|
||||
@Override
|
||||
protected final long available() {
|
||||
return available(true);
|
||||
}
|
||||
@ -75,6 +77,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
* memory that is currently bound in objects
|
||||
* @return used bytes
|
||||
*/
|
||||
@Override
|
||||
protected final long used() {
|
||||
return heap.getHeapMemoryUsage().getUsed();
|
||||
}
|
||||
@ -83,6 +86,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
* currently allocated memory in the Java virtual machine; may vary over time
|
||||
* @return bytes
|
||||
*/
|
||||
@Override
|
||||
protected final long total() {
|
||||
return heap.getHeapMemoryUsage().getCommitted();
|
||||
}
|
||||
@ -91,6 +95,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
* maximum memory the Java virtual will allocate machine; may vary over time in some cases
|
||||
* @return bytes
|
||||
*/
|
||||
@Override
|
||||
protected final long maxMemory() {
|
||||
return heap.getHeapMemoryUsage().getMax();
|
||||
}
|
||||
@ -103,6 +108,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
* @param force specifies whether ignoring preferred size
|
||||
* @return whether enough memory could be freed (or is free) or not
|
||||
*/
|
||||
@Override
|
||||
protected final boolean request(final long size, final boolean force, AtomicBoolean shortStatus) {
|
||||
if (size == 0l) return true; // does not make sense to check - returning true without setting shortStatus (which also doesn't make sense to me)
|
||||
final boolean unknown = size < 0l; // size < 0 indicate an unknown size - maybe from gziped streams
|
||||
@ -135,6 +141,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
|
||||
*
|
||||
* @return Memory is in proper state
|
||||
*/
|
||||
@Override
|
||||
protected boolean properState() {
|
||||
return properState(false);
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ class NamePrefixThreadFactory implements ThreadFactory {
|
||||
*
|
||||
* @see java.util.concurrent.ThreadFactory#newThread(java.lang.Runnable)
|
||||
*/
|
||||
@Override
|
||||
public Thread newThread(final Runnable r) {
|
||||
final Thread t = defaultFactory.newThread(r);
|
||||
t.setName(this.prefix + "_" + t.getName());
|
||||
|
@ -53,15 +53,18 @@ public class ReverseMapIterator <E, F> implements Iterator<Map.Entry<E, F>> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return !a.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map.Entry<E, F> next() {
|
||||
this.last = a.remove(a.size() - 1);
|
||||
return new Entry0(this.last, this.map.get(this.last));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
this.map.remove(this.last);
|
||||
}
|
||||
@ -74,14 +77,17 @@ public class ReverseMapIterator <E, F> implements Iterator<Map.Entry<E, F>> {
|
||||
this.f = f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E getKey() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public F getValue() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public F setValue(F value) {
|
||||
F f0 = this.f;
|
||||
this.f = value;
|
||||
|
@ -51,6 +51,7 @@ public class StandardMemoryStrategy extends MemoryStrategy {
|
||||
* @param last time which must be passed since lased gc
|
||||
* @param info additional info for log
|
||||
*/
|
||||
@Override
|
||||
protected final synchronized boolean gc(final int last, final String info) { // thq
|
||||
assert last >= 10000; // too many forced GCs will cause bad execution performance
|
||||
final long elapsed = System.currentTimeMillis() - lastGC;
|
||||
|
@ -55,68 +55,81 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
|
||||
this.maxBusySleep = maxBusySleep;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setStartupSleep(final long milliseconds) {
|
||||
// sets a sleep time before execution of the job-loop
|
||||
startup = milliseconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long setIdleSleep(final long milliseconds) {
|
||||
// sets a sleep time for pauses between two jobs
|
||||
idlePause = Math.min(this.maxIdleSleep, Math.max(this.minIdleSleep, milliseconds));
|
||||
return idlePause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getIdleSleep() {
|
||||
return idlePause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long setBusySleep(final long milliseconds) {
|
||||
// sets a sleep time for pauses between two jobs
|
||||
busyPause = Math.min(this.maxBusySleep, Math.max(this.minBusySleep, milliseconds));
|
||||
return busyPause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getBusySleep() {
|
||||
return busyPause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMemPreReqisite(final long freeBytes) {
|
||||
// sets minimum required amount of memory for the job execution
|
||||
memprereq = freeBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double setLoadPreReqisite(final double load) {
|
||||
// sets minimum required amount of memory for the job execution
|
||||
loadprereq = load;
|
||||
return load;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObeyIntermission(final boolean obey) {
|
||||
// defines if the thread should obey the intermission command
|
||||
intermissionObedient = obey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getIdleCycles() {
|
||||
// returns the total number of cycles of job execution with idle-result
|
||||
return this.idleCycles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getBusyCycles() {
|
||||
// returns the total number of cycles of job execution with busy-result
|
||||
return this.busyCycles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutOfMemoryCycles() {
|
||||
// returns the total number of cycles where
|
||||
// a job execution was omitted because of memory shortage
|
||||
return this.outofmemoryCycles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getSleepTime() {
|
||||
// returns the total time that this thread has slept so far
|
||||
return this.idletime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intermission(final long pause) {
|
||||
if (pause == Long.MAX_VALUE)
|
||||
this.intermission = Long.MAX_VALUE;
|
||||
|
@ -360,6 +360,7 @@ public class DHTSelection {
|
||||
this.se = seedDB.seedsConnected(true, false, null, yacyVersion.YACY_POVIDES_REMOTECRAWL_LISTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Seed next0() {
|
||||
Seed s;
|
||||
try {
|
||||
|
@ -1059,6 +1059,7 @@ public final class Protocol {
|
||||
final String address = myseed ? "localhost:" + target.getPort() : target.getPublicAddress();
|
||||
final int solrtimeout = Switchboard.getSwitchboard().getConfigInt(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_TIMEOUT, 6000);
|
||||
Thread remoteRequest = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
this.setName("Protocol.solrQuery(" + solrQuery.getQuery() + " to " + target.hash + ")");
|
||||
try {
|
||||
|
@ -38,6 +38,7 @@ public class yacySeedUploadFtp implements yacySeedUploader {
|
||||
public static final String CONFIG_FTP_PASSWORD = "seedFTPPassword";
|
||||
public static final String CONFIG_FTP_PATH = "seedFTPPath";
|
||||
|
||||
@Override
|
||||
public String uploadSeedFile (final serverSwitch sb, final File seedFile) throws Exception {
|
||||
try {
|
||||
if (sb == null) throw new NullPointerException("Reference to serverSwitch must not be null.");
|
||||
@ -62,6 +63,7 @@ public class yacySeedUploadFtp implements yacySeedUploader {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getConfigurationOptions() {
|
||||
return new String[] {CONFIG_FTP_SERVER,CONFIG_FTP_ACCOUNT,CONFIG_FTP_PASSWORD,CONFIG_FTP_PATH};
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ public class MemoryTracker extends Thread {
|
||||
this.setName("MemoryTracker");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
while (running) {
|
||||
|
@ -1146,6 +1146,7 @@ public final class Switchboard extends serverSwitch {
|
||||
|
||||
// finally start jobs which shall be started after start-up
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Thread.currentThread().setName("Switchboard.setHttpServer");
|
||||
try {Thread.sleep(10000);} catch (final InterruptedException e) {} // needs httpd up
|
||||
@ -2926,6 +2927,7 @@ public final class Switchboard extends serverSwitch {
|
||||
for (DigestURL url: rootURLs) {
|
||||
final DigestURL turl = url;
|
||||
Thread t = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
String failreason;
|
||||
if ((failreason = Switchboard.this.stackUrl(profile, turl)) == null) successurls.add(turl); else failurls.put(turl, failreason);
|
||||
|
@ -1234,6 +1234,7 @@ public final class SearchEvent {
|
||||
} else {
|
||||
final URIMetadataNode node1 = node;
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
SearchEvent.this.oneFeederStarted();
|
||||
try {
|
||||
@ -1260,6 +1261,7 @@ public final class SearchEvent {
|
||||
}
|
||||
} else {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
SearchEvent.this.oneFeederStarted();
|
||||
try {
|
||||
@ -1510,6 +1512,7 @@ public final class SearchEvent {
|
||||
this.height = height;
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.imageUrl.toString();
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
|
||||
* save configuration to file and update enum SolrFields
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void commit() throws IOException {
|
||||
try {
|
||||
super.commit();
|
||||
@ -1046,6 +1047,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
|
||||
for (final AtomicInteger i = new AtomicInteger(0); i.get() < t.length; i.incrementAndGet()) {
|
||||
t[i.get()] = new Thread() {
|
||||
private String name = "CollectionConfiguration.postprocessing.webgraph-" + i.get();
|
||||
@Override
|
||||
public void run() {
|
||||
Thread.currentThread().setName(name);
|
||||
SolrDocument doc; String protocol, urlstub, id; DigestURL url;
|
||||
@ -1238,6 +1240,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
|
||||
public double cr;
|
||||
public int crn, count;
|
||||
public CRV(final int count, final double cr, final int crn) {this.count = count; this.cr = cr; this.crn = crn;}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "count=" + count + ", cr=" + cr + ", crn=" + crn;
|
||||
}
|
||||
|
@ -273,6 +273,7 @@ public enum CollectionSchema implements SchemaDeclaration {
|
||||
* Set a custom Solr field name (and converts it to lower case)
|
||||
* @param theValue = the field name
|
||||
*/
|
||||
@Override
|
||||
public final void setSolrFieldName(String theValue) {
|
||||
// make sure no empty string is assigned
|
||||
if ( (theValue != null) && (!theValue.isEmpty()) ) {
|
||||
@ -317,39 +318,46 @@ public enum CollectionSchema implements SchemaDeclaration {
|
||||
return this.comment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final String value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final Date value) {
|
||||
assert !this.isMultiValued();
|
||||
assert this.type == SolrType.date;
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final int value) {
|
||||
assert !this.isMultiValued();
|
||||
assert this.type == SolrType.num_integer;
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final long value) {
|
||||
assert !this.isMultiValued();
|
||||
assert this.type == SolrType.num_long;
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final String[] value) {
|
||||
assert this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final Integer[] value) {
|
||||
assert this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final List<?> value) {
|
||||
assert this.isMultiValued();
|
||||
if (value == null || value.size() == 0) {
|
||||
@ -375,16 +383,19 @@ public enum CollectionSchema implements SchemaDeclaration {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final float value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final double value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final boolean value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
|
@ -150,6 +150,7 @@ public enum WebgraphSchema implements SchemaDeclaration {
|
||||
* Set a custom Solr field name (and converts it to lower case)
|
||||
* @param theValue = the field name
|
||||
*/
|
||||
@Override
|
||||
public final void setSolrFieldName(String theValue) {
|
||||
// make sure no empty string is assigned
|
||||
if ( (theValue != null) && (!theValue.isEmpty()) ) {
|
||||
@ -194,39 +195,46 @@ public enum WebgraphSchema implements SchemaDeclaration {
|
||||
return this.comment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final String value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final Date value) {
|
||||
assert !this.isMultiValued();
|
||||
assert this.type == SolrType.date;
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final int value) {
|
||||
assert !this.isMultiValued();
|
||||
assert this.type == SolrType.num_integer;
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final long value) {
|
||||
assert !this.isMultiValued();
|
||||
assert this.type == SolrType.num_long;
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final String[] value) {
|
||||
assert this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final Integer[] value) {
|
||||
assert this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final List<?> value) {
|
||||
assert this.isMultiValued();
|
||||
if (value == null || value.size() == 0) {
|
||||
@ -252,16 +260,19 @@ public enum WebgraphSchema implements SchemaDeclaration {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final float value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final double value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void add(final SolrInputDocument doc, final boolean value) {
|
||||
assert !this.isMultiValued();
|
||||
doc.setField(this.getSolrFieldName(), value);
|
||||
|
@ -164,7 +164,8 @@ public class Discovery {
|
||||
|
||||
DiscoveryResultsHandler handler = new DiscoveryResultsHandler() {
|
||||
|
||||
public void discoveredDevice( String usn, String udn, String nt, String maxAge, URL location, String firmware ) {
|
||||
@Override
|
||||
public void discoveredDevice( String usn, String udn, String nt, String maxAge, URL location, String firmware ) {
|
||||
synchronized( devices ) {
|
||||
if ( ! devices.containsKey( usn ) ) {
|
||||
try {
|
||||
|
@ -70,7 +70,8 @@ public class JXPathParser implements XMLParser {
|
||||
|
||||
private char buggyChar = (char)0;
|
||||
|
||||
public Object parseXML( InputStream in ){
|
||||
@Override
|
||||
public Object parseXML( InputStream in ){
|
||||
StringBuilder xml = new StringBuilder();
|
||||
try {
|
||||
byte[] buffer = new byte[512];
|
||||
|
@ -321,7 +321,8 @@ public class ServicesEventing implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
// only the deamon thread is allowed to call such method
|
||||
if ( !Thread.currentThread().getName().equals( "ServicesEventing daemon" ) ) return;
|
||||
try {
|
||||
@ -355,6 +356,7 @@ public class ServicesEventing implements Runnable {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
client.setSoTimeout( 30000 );
|
||||
|
@ -89,7 +89,8 @@ public class StateVariableResponseParser extends org.xml.sax.helpers.DefaultHand
|
||||
return result;
|
||||
}
|
||||
|
||||
public void characters( char[] ch, int start, int length ) {
|
||||
@Override
|
||||
public void characters( char[] ch, int start, int length ) {
|
||||
if ( parseStateVar ) {
|
||||
String origChars = result.stateVariableValue;
|
||||
String newChars = new String( ch, start, length );
|
||||
@ -118,7 +119,8 @@ public class StateVariableResponseParser extends org.xml.sax.helpers.DefaultHand
|
||||
}
|
||||
}
|
||||
|
||||
public void startElement( String uri, String localName, String qName, Attributes attributes ) {
|
||||
@Override
|
||||
public void startElement( String uri, String localName, String qName, Attributes attributes ) {
|
||||
|
||||
if ( faultResponse ) {
|
||||
if ( localName.equals( "faultcode") ) {
|
||||
@ -142,7 +144,8 @@ public class StateVariableResponseParser extends org.xml.sax.helpers.DefaultHand
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement( String uri, String localName, String qName ) throws SAXException {
|
||||
@Override
|
||||
public void endElement( String uri, String localName, String qName ) throws SAXException {
|
||||
// some buggy implementations ( intel sample media server )
|
||||
// do not use the specs compliant return element name but varName ...
|
||||
if ( localName.equals( "return" ) || localName.equals( "varName" ) ) {
|
||||
|
@ -97,7 +97,8 @@ public class ListDirs {
|
||||
return completeList;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.uri;
|
||||
}
|
||||
}
|
||||
|
@ -109,10 +109,12 @@ public class enumerateFiles implements Enumeration<File> {
|
||||
return f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMoreElements() {
|
||||
return buffer != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File nextElement() {
|
||||
final File r = buffer;
|
||||
buffer = nextElement0();
|
||||
|
@ -45,35 +45,42 @@ public abstract class loaderCore implements loaderProcess {
|
||||
protected int completion = 0;
|
||||
|
||||
// steering methods
|
||||
@Override
|
||||
public abstract void feed(byte[] a); // returns true if process was successful; should be always synchronized
|
||||
|
||||
@Override
|
||||
public void terminate() {
|
||||
// if terminated before completion, completed() shows x < 100
|
||||
run = false;
|
||||
}
|
||||
|
||||
// feed-back methods
|
||||
@Override
|
||||
public Properties result() {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int completed() {
|
||||
// guess of completion status. shall be 100 if totally completed.
|
||||
return completion;
|
||||
}
|
||||
|
||||
// error control
|
||||
@Override
|
||||
public int status() {
|
||||
// -1=idle, 0=ready, 1=running, 2=aborted, 3=failed, 4=completed, 9=finalized
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean available() {
|
||||
// true if it is ok to feed with feed()
|
||||
return (status() == STATUS_READY) ||
|
||||
(status() == STATUS_COMPLETED && (result == null || result.isEmpty()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Exception error() {
|
||||
// if in error status: this returnes exception
|
||||
return error;
|
||||
|
@ -31,6 +31,7 @@ public class DemoApplet extends Applet implements Runnable {
|
||||
animator.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (Thread.currentThread() == animator) {
|
||||
final long time = System.currentTimeMillis();
|
||||
|
@ -242,6 +242,7 @@ public final class yacy {
|
||||
final String iframetarget = sb.getConfig("donation.iframetarget", "");
|
||||
final File iframefile = new File(htDocsPath, iframetarget);
|
||||
if (!iframefile.exists()) new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
final ClientIdentification.Agent agent = ClientIdentification.getAgent(ClientIdentification.yacyInternetCrawlerAgentName);
|
||||
Response response;
|
||||
|
Loading…
Reference in New Issue
Block a user