Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
reger committed May 8, 2014
2 parents f7b6ca1 + b9c1a61 commit 6122f8d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions 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
Expand Down
30 changes: 18 additions & 12 deletions htroot/yacy/seedlist.java
Expand Up @@ -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<Seed> v = sb.peers.getSeedlist(maxcount, includeme, nodeonly, minversion);
final serverObjects prop = new serverObjects();

Expand All @@ -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<String, String> map = seed.getMap();
int c = 1;
if (!addressonly) {
for (Map.Entry<String, String> 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) {
Expand Down
6 changes: 3 additions & 3 deletions source/net/yacy/cora/protocol/Domains.java
Expand Up @@ -82,9 +82,9 @@ public class Domains {
private static final int CONCURRENCY_LEVEL = Runtime.getRuntime().availableProcessors() * 2;

// a dns cache
private static final ARC<String, InetAddress> NAME_CACHE_HIT = new ConcurrentARC<String, InetAddress>(MAX_NAME_CACHE_HIT_SIZE, CONCURRENCY_LEVEL);
private static final ARC<String, String> NAME_CACHE_MISS = new ConcurrentARC<String, String>(MAX_NAME_CACHE_MISS_SIZE, CONCURRENCY_LEVEL);
private static final ConcurrentHashMap<String, Object> LOOKUP_SYNC = new ConcurrentHashMap<String, Object>(100, 0.75f, Runtime.getRuntime().availableProcessors() * 2);
private static final ARC<String, InetAddress> NAME_CACHE_HIT = new ConcurrentARC<>(MAX_NAME_CACHE_HIT_SIZE, CONCURRENCY_LEVEL);
private static final ARC<String, String> NAME_CACHE_MISS = new ConcurrentARC<>(MAX_NAME_CACHE_MISS_SIZE, CONCURRENCY_LEVEL);
private static final ConcurrentHashMap<String, Object> LOOKUP_SYNC = new ConcurrentHashMap<>(100, 0.75f, Runtime.getRuntime().availableProcessors() * 2);
private static List<Pattern> nameCacheNoCachingPatterns = Collections.synchronizedList(new LinkedList<Pattern>());
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
Expand Down

0 comments on commit 6122f8d

Please sign in to comment.