diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 1928b0d755..82a6659297 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -6,9 +6,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -96,4 +96,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/build.properties b/build.properties index 7c9960e786..c96a472cfa 100644 --- a/build.properties +++ b/build.properties @@ -1,9 +1,9 @@ # defining some compiler arguments -javacSource=1.6 -javacTarget=1.6 +javacSource=1.7 +javacTarget=1.7 # Release Configuration -releaseVersion=1.72 +releaseVersion=1.73 stdReleaseFile=yacy${branch}_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz sourceReleaseFile=yacy_src_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz releaseFileParentDir=yacy diff --git a/htroot/yacy/seedlist.java b/htroot/yacy/seedlist.java index 6821bf8c27..7f3ba082f9 100644 --- a/htroot/yacy/seedlist.java +++ b/htroot/yacy/seedlist.java @@ -50,6 +50,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje boolean nodeonly = post == null || !post.containsKey("node") ? false : post.getBoolean("node"); boolean includeme = post == null || !post.containsKey("me") ? true : post.getBoolean("me"); boolean addressonly = post == null || !post.containsKey("address") ? false : post.getBoolean("address"); + String peername = post == null ? null : post.get("peername"); final ArrayList v = sb.peers.getSeedlist(maxcount, includeme, nodeonly, minversion); final serverObjects prop = new serverObjects(); @@ -67,28 +68,33 @@ public static serverObjects respond(final RequestHeader header, final serverObje prop.put("jsonp-end", ""); } // construct json property lists + int count = 0; for (int i = 0; i < v.size(); i++) { - prop.putJSON("peers_" + i + "_map_0_k", Seed.HASH); - prop.putJSON("peers_" + i + "_map_0_v", v.get(i).hash); - prop.put("peers_" + i + "_map_0_c", 1); Seed seed = v.get(i); + if (peername != null && !peername.equals(seed.getName())) continue; + prop.putJSON("peers_" + count + "_map_0_k", Seed.HASH); + prop.putJSON("peers_" + count + "_map_0_v", seed.hash); + prop.put("peers_" + count + "_map_0_c", 1); Map map = seed.getMap(); int c = 1; if (!addressonly) { for (Map.Entry m: map.entrySet()) { - prop.putJSON("peers_" + i + "_map_" + c + "_k", m.getKey()); - prop.putJSON("peers_" + i + "_map_" + c + "_v", m.getValue()); - prop.put("peers_" + i + "_map_" + c + "_c", 1); + prop.putJSON("peers_" + count + "_map_" + c + "_k", m.getKey()); + prop.putJSON("peers_" + count + "_map_" + c + "_v", m.getValue()); + prop.put("peers_" + count + "_map_" + c + "_c", 1); c++; } } - prop.putJSON("peers_" + i + "_map_" + c + "_k", "Address"); - prop.putJSON("peers_" + i + "_map_" + c + "_v", seed.getPublicAddress()); - prop.put("peers_" + i + "_map_" + c + "_c", 0); - prop.put("peers_" + i + "_map", c + 1); - prop.put("peers_" + i + "_c", i < v.size() - 1 ? 1 : 0); + prop.putJSON("peers_" + count + "_map_" + c + "_k", "Address"); + prop.putJSON("peers_" + count + "_map_" + c + "_v", seed.getPublicAddress()); + prop.put("peers_" + count + "_map_" + c + "_c", 0); + prop.put("peers_" + count + "_map", c + 1); + prop.put("peers_" + count + "_c", 1); + count++; } - prop.put("peers", v.size()); + + prop.put("peers_" + (count - 1) + "_c", 0); + prop.put("peers", count); } else { final StringBuilder encoded = new StringBuilder(1024); for (Seed seed: v) { diff --git a/source/net/yacy/cora/protocol/Domains.java b/source/net/yacy/cora/protocol/Domains.java index b8e987c978..dae80e7b22 100644 --- a/source/net/yacy/cora/protocol/Domains.java +++ b/source/net/yacy/cora/protocol/Domains.java @@ -82,9 +82,9 @@ public class Domains { private static final int CONCURRENCY_LEVEL = Runtime.getRuntime().availableProcessors() * 2; // a dns cache - private static final ARC NAME_CACHE_HIT = new ConcurrentARC(MAX_NAME_CACHE_HIT_SIZE, CONCURRENCY_LEVEL); - private static final ARC NAME_CACHE_MISS = new ConcurrentARC(MAX_NAME_CACHE_MISS_SIZE, CONCURRENCY_LEVEL); - private static final ConcurrentHashMap LOOKUP_SYNC = new ConcurrentHashMap(100, 0.75f, Runtime.getRuntime().availableProcessors() * 2); + private static final ARC NAME_CACHE_HIT = new ConcurrentARC<>(MAX_NAME_CACHE_HIT_SIZE, CONCURRENCY_LEVEL); + private static final ARC NAME_CACHE_MISS = new ConcurrentARC<>(MAX_NAME_CACHE_MISS_SIZE, CONCURRENCY_LEVEL); + private static final ConcurrentHashMap LOOKUP_SYNC = new ConcurrentHashMap<>(100, 0.75f, Runtime.getRuntime().availableProcessors() * 2); private static List nameCacheNoCachingPatterns = Collections.synchronizedList(new LinkedList()); public static long cacheHit_Hit = 0, cacheHit_Miss = 0, cacheHit_Insert = 0; // for statistics only; do not write public static long cacheMiss_Hit = 0, cacheMiss_Miss = 0, cacheMiss_Insert = 0; // for statistics only; do not write