|
|
@ -403,35 +403,42 @@ public class plasmaCrawlProfile {
|
|
|
|
profileTable.set(handle(), mem);
|
|
|
|
profileTable.set(handle(), mem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public void domInc(String domain, String referrer, int depth) {
|
|
|
|
public void domInc(String domain, String referrer, int depth) {
|
|
|
|
DomProfile dp = (DomProfile) doms.get(domain);
|
|
|
|
synchronized (domain.intern()) {
|
|
|
|
if (dp == null) {
|
|
|
|
DomProfile dp = (DomProfile) doms.get(domain);
|
|
|
|
// new domain
|
|
|
|
if (dp == null) {
|
|
|
|
doms.put(domain, new DomProfile(referrer, depth));
|
|
|
|
// new domain
|
|
|
|
} else {
|
|
|
|
doms.put(domain, new DomProfile(referrer, depth));
|
|
|
|
// increase counter
|
|
|
|
} else {
|
|
|
|
dp.inc();
|
|
|
|
// increase counter
|
|
|
|
doms.put(domain, dp);
|
|
|
|
dp.inc();
|
|
|
|
|
|
|
|
doms.put(domain, dp);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
domsCache.put(this.mem.get("handle"), doms);
|
|
|
|
domsCache.put(this.mem.get("handle"), doms);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public boolean grantedDomAppearance(String domain) {
|
|
|
|
public boolean grantedDomAppearance(String domain) {
|
|
|
|
int max = domFilterDepth();
|
|
|
|
int max = domFilterDepth();
|
|
|
|
if (max == Integer.MAX_VALUE) return true;
|
|
|
|
if (max == Integer.MAX_VALUE) return true;
|
|
|
|
DomProfile dp = (DomProfile) doms.get(domain);
|
|
|
|
synchronized (domain.intern()) {
|
|
|
|
if (dp == null) {
|
|
|
|
DomProfile dp = (DomProfile) doms.get(domain);
|
|
|
|
return 0 < max;
|
|
|
|
if (dp == null) {
|
|
|
|
} else {
|
|
|
|
return 0 < max;
|
|
|
|
return dp.depth < max;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return dp.depth < max;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean grantedDomCount(String domain) {
|
|
|
|
public boolean grantedDomCount(String domain) {
|
|
|
|
int max = domMaxPages();
|
|
|
|
int max = domMaxPages();
|
|
|
|
if (max == Integer.MAX_VALUE) return true;
|
|
|
|
if (max == Integer.MAX_VALUE) return true;
|
|
|
|
DomProfile dp = (DomProfile) doms.get(domain);
|
|
|
|
synchronized (domain.intern()) {
|
|
|
|
if (dp == null) {
|
|
|
|
DomProfile dp = (DomProfile) doms.get(domain);
|
|
|
|
return 0 < max;
|
|
|
|
if (dp == null) {
|
|
|
|
} else {
|
|
|
|
return 0 < max;
|
|
|
|
return dp.count < max;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return dp.count < max;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public int domSize() {
|
|
|
|
public int domSize() {
|
|
|
|