minor changes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@487 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent 91163db52e
commit 2d8557cb10

@ -142,8 +142,8 @@ public class CacheAdmin_p {
}
//
prop.put("cachesize", "" + (switchboard.cacheManager.currCacheSize/1024));
prop.put("cachemax", "" + (switchboard.cacheManager.maxCacheSize/1024));
prop.put("cachesize", Long.toString(switchboard.cacheManager.currCacheSize/1024));
prop.put("cachemax", Long.toString(switchboard.cacheManager.maxCacheSize/1024));
prop.put("tree", tree);
prop.put("info", info);
// return rewrite properties

@ -246,7 +246,7 @@ Continue crawling.
#{/crawlProfiles}#
</table>
<br>
<b id="crawlingStarts">Other Peer Crawl Starts (recently started with remote indexing; this is a YaCyNews Service):</b><br>
<b id="crawlingStarts">Recently started remote crawls in progress:</b><br>
<table border="0" cellpadding="2" cellspacing="1" width="100%">
<tr class="TableHeader">
<td class="small"><b>Start Time</b></td>
@ -256,7 +256,7 @@ Continue crawling.
<td class="small"><b>Depth</b></td>
<td class="small"><b>Accept '?'</b></td>
</tr>
#{otherCrawlStart}#
#{otherCrawlStartInProgress}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#" class="small">
<td class="small">#[cre]#</td>
<td class="small">#[peername]#</td>
@ -265,7 +265,29 @@ Continue crawling.
<td class="small">#[generalDepth]#</td>
<td class="small">#(crawlingQ)#no::yes#(/crawlingQ)#</td>
</tr>
#{/otherCrawlStart}#
#{/otherCrawlStartInProgress}#
</table>
<br>
<b>Recently started remote crawls, finished:</b><br>
<table border="0" cellpadding="2" cellspacing="1" width="100%">
<tr class="TableHeader">
<td class="small"><b>Start Time</b></td>
<td class="small"><b>Peer Name</b></td>
<td class="small"><b>Start URL</b></td>
<td class="small"><b>Intention/Description</b></td>
<td class="small"><b>Depth</b></td>
<td class="small"><b>Accept '?'</b></td>
</tr>
#{otherCrawlStartFinished}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#" class="small">
<td class="small">#[cre]#</td>
<td class="small">#[peername]#</td>
<td class="small"><a class="small" href="#[startURL]#">#[startURL]#</a></td>
<td class="small">#[intention]#</td>
<td class="small">#[generalDepth]#</td>
<td class="small">#(crawlingQ)#no::yes#(/crawlingQ)#</td>
</tr>
#{/otherCrawlStartFinished}#
</table>
<br>
<b id="remoteCrawlPeers">Remote Crawling Peers:</b>&nbsp;

@ -371,20 +371,45 @@ public class IndexCreate_p {
if (record.category().equals("crwlstrt")) {
peer = yacyCore.seedDB.get(record.originator());
if (peer == null) peername = record.originator(); else peername = peer.getName();
prop.put("otherCrawlStart_" + showedCrawl + "_dark", ((dark) ? 1 : 0));
prop.put("otherCrawlStart_" + showedCrawl + "_cre", record.created());
prop.put("otherCrawlStart_" + showedCrawl + "_peername", peername);
prop.put("otherCrawlStart_" + showedCrawl + "_startURL", record.attributes().get("startURL"));
prop.put("otherCrawlStart_" + showedCrawl + "_intention", record.attributes().get("intention"));
prop.put("otherCrawlStart_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStart_" + showedCrawl + "_crawlingQ", (record.attributes().get("crawlingQ").equals("true")) ? 1 : 0);
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_dark", ((dark) ? 1 : 0));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_cre", record.created());
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_peername", peername);
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_startURL", record.attributes().get("startURL"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_intention", record.attributes().get("intention"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_crawlingQ", (record.attributes().get("crawlingQ").equals("true")) ? 1 : 0);
showedCrawl++;
if (showedCrawl > 20) break;
}
}
} catch (IOException e) {}
prop.put("otherCrawlStart", showedCrawl);
prop.put("otherCrawlStartInProgress", showedCrawl);
// finished remote crawls
availableNews = yacyCore.newsPool.size(yacyNewsPool.PROCESSED_DB);
showedCrawl = 0;
try {
for (int c = 0; c < availableNews; c++) {
record = yacyCore.newsPool.get(yacyNewsPool.PROCESSED_DB, c);
if (record == null) continue;
if (record.category().equals("crwlstrt")) {
peer = yacyCore.seedDB.get(record.originator());
if (peer == null) peername = record.originator(); else peername = peer.getName();
prop.put("otherCrawlStartFinished_" + showedCrawl + "_dark", ((dark) ? 1 : 0));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_cre", record.created());
prop.put("otherCrawlStartFinished_" + showedCrawl + "_peername", peername);
prop.put("otherCrawlStartFinished_" + showedCrawl + "_startURL", record.attributes().get("startURL"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_intention", record.attributes().get("intention"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_crawlingQ", (record.attributes().get("crawlingQ").equals("true")) ? 1 : 0);
showedCrawl++;
if (showedCrawl > 20) break;
}
}
} catch (IOException e) {}
prop.put("otherCrawlStartFinished", showedCrawl);
// remote crawl peers

@ -65,8 +65,8 @@ public class IndexShare_p {
prop.put("wordfreq", switchboard.getConfig("defaultWordReceiveFrequency","10"));
prop.put("dtable", "");
prop.put("rtable", "");
prop.put("wcount", "" + switchboard.wordIndex.size());
prop.put("ucount", "" + switchboard.urlPool.loadedURL.size());
prop.put("wcount", Integer.toString(switchboard.wordIndex.size()));
prop.put("ucount", Integer.toString(switchboard.urlPool.loadedURL.size()));
return prop; // be save
}
@ -78,8 +78,8 @@ public class IndexShare_p {
}
// insert constants
prop.put("wcount", "" + switchboard.wordIndex.size());
prop.put("ucount", "" + switchboard.urlPool.loadedURL.size());
prop.put("wcount", Integer.toString(switchboard.wordIndex.size()));
prop.put("ucount", Integer.toString(switchboard.urlPool.loadedURL.size()));
// return rewrite properties
return prop;
}

@ -114,8 +114,8 @@ public class Network {
prop.put("table_my-uptime", serverDate.intervalToString(60000 * Long.parseLong(seed.get("Uptime", ""))));
prop.put("table_my-links", groupDigits(links));
prop.put("table_my-words", groupDigits(words));
prop.put("table_my-acceptcrawl", "" + (seed.getFlagAcceptRemoteCrawl() ? 1 : 0) );
prop.put("table_my-acceptindex", "" + (seed.getFlagAcceptRemoteIndex() ? 1 : 0) );
prop.put("table_my-acceptcrawl", Integer.toString(seed.getFlagAcceptRemoteCrawl() ? 1 : 0) );
prop.put("table_my-acceptindex", Integer.toString(seed.getFlagAcceptRemoteIndex() ? 1 : 0) );
prop.put("table_my-sI", seed.get("sI", "-"));
prop.put("table_my-sU", seed.get("sU", "-"));
prop.put("table_my-rI", seed.get("rI", "-"));
@ -351,11 +351,11 @@ public class Network {
} catch (java.text.ParseException e) {
l = 999;
}
if (l == 999) return "-"; else return "" + l;
if (l == 999) return "-"; else return Long.toString(l);
}
private static String groupDigits(long Number) {
String s = "" + Number;
String s = Long.toString(Number);
String t = "";
for (int i = 0; i < s.length(); i++) t = s.charAt(s.length() - i - 1) + (((i % 3) == 0) ? "," : "") + t;
return t.substring(0, t.length() - 1);

@ -100,7 +100,7 @@ public class Performance_p {
prop.put("table_" + c + "_shortdescr", (thread.getMonitorURL() == null) ? thread.getShortDescription() : "<a href=\"" + thread.getMonitorURL() + "\" class=?\"small\">" + thread.getShortDescription() + "</a>");
prop.put("table_" + c + "_longdescr", thread.getLongDescription());
queuesize = thread.getJobCount();
prop.put("table_" + c + "_queuesize", (queuesize == Integer.MAX_VALUE) ? "unlimited" : ("" + queuesize));
prop.put("table_" + c + "_queuesize", (queuesize == Integer.MAX_VALUE) ? "unlimited" : Integer.toString(queuesize));
blocktime = thread.getBlockTime();
sleeptime = thread.getSleepTime();
@ -109,17 +109,17 @@ public class Performance_p {
busyCycles = thread.getBusyCycles();
memshortageCycles = thread.getOutOfMemoryCycles();
prop.put("table_" + c + "_blocktime", blocktime / 1000);
prop.put("table_" + c + "_blockpercent", "" + (100 * blocktime / blocktime_total));
prop.put("table_" + c + "_blockpercent", Long.toString(100 * blocktime / blocktime_total));
prop.put("table_" + c + "_sleeptime", sleeptime / 1000);
prop.put("table_" + c + "_sleeppercent", "" + (100 * sleeptime / sleeptime_total));
prop.put("table_" + c + "_sleeppercent", Long.toString(100 * sleeptime / sleeptime_total));
prop.put("table_" + c + "_exectime", exectime / 1000);
prop.put("table_" + c + "_execpercent", "" + (100 * exectime / exectime_total));
prop.put("table_" + c + "_totalcycles", "" + (idleCycles + busyCycles + memshortageCycles));
prop.put("table_" + c + "_idlecycles", "" + idleCycles);
prop.put("table_" + c + "_busycycles", "" + busyCycles);
prop.put("table_" + c + "_memscycles", "" + memshortageCycles);
prop.put("table_" + c + "_sleeppercycle", ((idleCycles + busyCycles) == 0) ? "-" : ("" + (sleeptime / (idleCycles + busyCycles))));
prop.put("table_" + c + "_execpercycle", (busyCycles == 0) ? "-" : ("" + (exectime / busyCycles)));
prop.put("table_" + c + "_execpercent", Long.toString(100 * exectime / exectime_total));
prop.put("table_" + c + "_totalcycles", Long.toString(idleCycles + busyCycles + memshortageCycles));
prop.put("table_" + c + "_idlecycles", Long.toString(idleCycles));
prop.put("table_" + c + "_busycycles", Long.toString(busyCycles));
prop.put("table_" + c + "_memscycles", Long.toString(memshortageCycles));
prop.put("table_" + c + "_sleeppercycle", ((idleCycles + busyCycles) == 0) ? "-" : Long.toString(sleeptime / (idleCycles + busyCycles)));
prop.put("table_" + c + "_execpercycle", (busyCycles == 0) ? "-" : Long.toString(exectime / busyCycles));
if ((post != null) && (post.containsKey("submitdelay"))) {
// load with new values
@ -171,10 +171,10 @@ public class Performance_p {
if ((post != null) && (post.containsKey("cacheSizeSubmit"))) {
int wordCacheMax = Integer.parseInt((String) post.get("wordCacheMax", "10000"));
switchboard.setConfig("wordCacheMax", "" + wordCacheMax);
switchboard.setConfig("wordCacheMax", Integer.toString(wordCacheMax));
switchboard.wordIndex.setMaxWords(wordCacheMax);
int maxWaitingWordFlush = Integer.parseInt((String) post.get("maxWaitingWordFlush", "180"));
switchboard.setConfig("maxWaitingWordFlush", "" + maxWaitingWordFlush);
switchboard.setConfig("maxWaitingWordFlush", Integer.toString(maxWaitingWordFlush));
}
if ((post != null) && (post.containsKey("poolConfig"))) {
@ -224,7 +224,7 @@ public class Performance_p {
if ((post != null) && (post.containsKey("proxyControlSubmit"))) {
int onlineCautionDelay = Integer.parseInt((String) post.get("onlineCautionDelay", "30000"));
switchboard.setConfig("onlineCautionDelay", "" + onlineCautionDelay);
switchboard.setConfig("onlineCautionDelay", Integer.toString(onlineCautionDelay));
}
// table cache settings

@ -56,7 +56,7 @@ Please delete that file and restart.</b><br>
#(/info)#
<p>You can see a snapshot of recently indexed pages
on the <a href="http://localhost:8000/IndexMonitor.html?process=4">Proxy Index Monitor</a> Page.
on the <a href="/IndexMonitor.html?process=4">Proxy Index Monitor</a> Page.
</p>
#[footer]#

@ -337,7 +337,7 @@ public class SettingsAck_p {
httpdProxyHandler.remoteProxyNoProxy = (String) post.get("remoteProxyNoProxy", "");
httpdProxyHandler.remoteProxyNoProxyPatterns = httpdProxyHandler.remoteProxyNoProxy.split(",");
env.setConfig("remoteProxyHost", httpdProxyHandler.remoteProxyHost);
env.setConfig("remoteProxyPort", "" + httpdProxyHandler.remoteProxyPort);
env.setConfig("remoteProxyPort", Integer.toString(httpdProxyHandler.remoteProxyPort));
env.setConfig("remoteProxyNoProxy", httpdProxyHandler.remoteProxyNoProxy);
env.setConfig("remoteProxyUse", (httpdProxyHandler.remoteProxyUse) ? "true" : "false");
prop.put("info", 15); // The remote-proxy setting has been changed

@ -60,8 +60,8 @@
<tr><td class="MenuHeader">&nbsp;Peer&nbsp;Control</td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/Status.html" accesskey="t" class="MenuItemLink">Status</a></td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/News.html" accesskey="n" class="MenuItemLink">News</a></td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/Network.html" accesskey="w" class="MenuItemLink">Network</a></td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/News.html" accesskey="n" class="MenuItemLink">News</a></td></tr>
<tr><td class="MenuItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;<a href="/ViewLog_p.html" class="MenuItemLink">Log</a></td></tr>
<tr><td class="MenuItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;<a href="/Settings_p.html" class="MenuItemLink">Settings</a></td></tr>
<tr><td class="MenuItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;<a href="/Performance_p.html" class="MenuItemLink">Performance</a></td></tr>

@ -88,7 +88,7 @@ public class search {
}
long timestamp = System.currentTimeMillis();
prop = switchboard.searchFromRemote(keyhashes, count, global, duetime);
prop.put("searchtime", "" + (System.currentTimeMillis() - timestamp));
prop.put("searchtime", Long.toString(System.currentTimeMillis() - timestamp));
int links = Integer.parseInt(prop.get("linkcount","0"));
yacyCore.seedDB.mySeed.incSI(links);

@ -87,7 +87,7 @@ public class messageBoard {
}
private String snString() {
String s = "" + sn;
String s = Integer.toString(sn);
if (s.length() == 1) s = "0" + s;
sn++;
if (sn > 99) sn = 0;

@ -730,7 +730,7 @@ public final class httpc {
clientOutput.write(buffer, 0, c);
len += c;
}
requestHeader.put(httpHeader.CONTENT_LENGTH, "" + len);
requestHeader.put(httpHeader.CONTENT_LENGTH, Integer.toString(len));
}
clientOutput.flush();
return new response(false);
@ -809,7 +809,7 @@ public final class httpc {
byte[] body = buf.toByteArray();
//System.out.println("DEBUG: PUT BODY=" + new String(body));
// size of that body
requestHeader.put(httpHeader.CONTENT_LENGTH, "" + body.length);
requestHeader.put(httpHeader.CONTENT_LENGTH, Integer.toString(body.length));
// send the header
//System.out.println("header=" + requestHeader);
send(httpHeader.METHOD_POST, path, requestHeader, false);

@ -698,7 +698,7 @@ public final class httpd implements serverHandler {
// prepare to pass values
Properties prop = new Properties();
prop.setProperty("HOST", arg);
prop.setProperty("PORT", "" + port);
prop.setProperty("PORT", Integer.toString(port));
prop.setProperty("HTTP", httpVersion);
// pass to proxy
@ -989,7 +989,7 @@ public final class httpd implements serverHandler {
line = readLine(p, buffer);
pos = nextPos;
}
header.put("ARGC", ("" + argc)); // store argument count
header.put("ARGC", Integer.toString(argc)); // store argument count
return files;
}
@ -1150,7 +1150,7 @@ public final class httpd implements serverHandler {
httpHeader header = new httpHeader();
header.put(httpHeader.DATE, httpc.dateString(httpc.nowDate()));
header.put(httpHeader.CONTENT_TYPE, "text/html");
header.put(httpHeader.CONTENT_LENGTH, "" + result.length);
header.put(httpHeader.CONTENT_LENGTH, Integer.toString(result.length));
header.put(httpHeader.PRAGMA, "no-cache");
sendRespondHeader(conProp,respond,httpVersion,httpStatusCode,httpStatusText,header);

@ -66,7 +66,7 @@ public abstract class httpdAbstractHandler {
new SimpleDateFormat("yyyyMMddHHmmss");
protected static String uniqueDateString() {
String c = "" + fileCounter;
String c = Integer.toString(fileCounter);
fileCounter++; if (fileCounter>9999) fileCounter = 0;
while (c.length() < 4) { c = "0" + c; }
return "FILE" + DateFileNameFormatter.format(httpc.nowDate()) + c;

@ -882,7 +882,7 @@ cd ..
else s = s + "?";
if (inode.canRead()) s = s + "r"; else s = s + "-";
if (inode.canWrite()) s = s + "w"; else s = s + "-";
s = s + " " + lenformatted("" + inode.length(),9);
s = s + " " + lenformatted(Long.toString(inode.length()),9);
DateFormat df = DateFormat.getDateTimeInstance();
s = s + " " + df.format(new Date(inode.lastModified()));
s = s + " " + inode.getName();

@ -123,12 +123,12 @@ public class plasmaCondenser {
this.hash = new HashSet();
}
public void inc() {count++;}
public void check(int i) {hash.add("" + i);}
public void check(int i) {hash.add(Integer.toString(i));}
}
public static String intString(int number, int length) {
String s = "" + number;
public String intString(int number, int length) {
String s = Integer.toString(number);
while (s.length() < length) s = "0" + s;
return s;
}

@ -169,15 +169,15 @@ public class plasmaCrawlProfile {
boolean storeHTCache, boolean storeTXCache,
boolean localIndexing, boolean remoteIndexing,
boolean xsstopw, boolean xdstopw, boolean xpstopw) {
String handle = serverCodings.encodeMD5B64("" + System.currentTimeMillis(), true).substring(0, plasmaURL.urlCrawlProfileHandleLength);
String handle = serverCodings.encodeMD5B64(Long.toString(System.currentTimeMillis()), true).substring(0, plasmaURL.urlCrawlProfileHandleLength);
mem = new HashMap();
mem.put("handle", handle);
mem.put("name", name);
mem.put("startURL", startURL);
mem.put("generalFilter", generalFilter);
mem.put("specificFilter", specificFilter);
mem.put("generalDepth", "" + generalDepth);
mem.put("specificDepth", "" + specificDepth);
mem.put("generalDepth", Integer.toString(generalDepth));
mem.put("specificDepth", Integer.toString(specificDepth));
mem.put("crawlingQ", (crawlingQ) ? "true" : "false"); // crawling of urls with '?'
mem.put("storeHTCache", (storeHTCache) ? "true" : "false");
mem.put("storeTXCache", (storeTXCache) ? "true" : "false");

@ -893,8 +893,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
log.logDebug("processResourceStack processCase=" + processCase +
", depth=" + entry.depth() +
", maxDepth=" + ((entry.profile() == null) ? "null" : "" + entry.profile().generalDepth()) +
", filter=" + ((entry.profile() == null) ? "null" : "" + entry.profile().generalFilter()) +
", maxDepth=" + ((entry.profile() == null) ? "null" : Integer.toString(entry.profile().generalDepth())) +
", filter=" + ((entry.profile() == null) ? "null" : entry.profile().generalFilter()) +
", initiatorHash=" + initiatorHash +
", responseHeader=" + ((entry.responseHeader() == null) ? "null" : entry.responseHeader().toString()) +
", url=" + entry.url()); // DEBUG
@ -1321,7 +1321,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
prop.put("totalcount", "0");
prop.put("linkcount", "0");
} else {
prop.put("totalcount", "" + acc.sizeOrdered());
prop.put("totalcount", Integer.toString(acc.sizeOrdered()));
int i = 0;
int p;
URL url;
@ -1414,8 +1414,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
System.out.println(" all words = " + ref.getElementCount() + ", total count = " + ref.getTotalCount());
*/
prop.put("references", ws);
prop.put("linkcount", "" + i);
prop.put("results", "" + i);
prop.put("linkcount", Integer.toString(i));
prop.put("results", Integer.toString(i));
}
// log
@ -1446,7 +1446,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
prop.put("linkcount", "0");
prop.put("references", "");
} else {
prop.put("totalcount", "" + acc.sizeOrdered());
prop.put("totalcount", Integer.toString(acc.sizeOrdered()));
int i = 0;
StringBuffer links = new StringBuffer();
String resource = "";
@ -1471,7 +1471,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
}
}
prop.put("links", links.toString());
prop.put("linkcount", "" + i);
prop.put("linkcount", Integer.toString(i));
// prepare reference hints
Object[] ws = acc.getReferences(16);
@ -1502,7 +1502,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
if (actionName.equals("urlcount")) {
serverObjects result = new serverObjects();
result.put("urls","" + urlPool.loadedURL.size());
result.put("urls", Integer.toString(urlPool.loadedURL.size()));
return result;
}

@ -82,7 +82,7 @@ public final class plasmaWordIndexAssortment {
private int bufferStructureLength;
private static String intx(int x) {
String s = "" + x;
String s = Integer.toString(x);
while (s.length() < 3) s = "0" + s;
return s;
}

@ -215,6 +215,7 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
while (i-- > 0) {
// get out one entry
row = dumpArray.get(i);
if (row[0] == null) continue;
wordHash = new String(row[0]);
creationTime = kelondroRecords.bytes2long(row[2]);
wordEntry = new plasmaWordIndexEntry(new String(row[3]), new String(row[4]));

@ -132,7 +132,7 @@ public abstract class serverAbstractSwitch implements serverSwitch {
}
public void setConfig(String key, long value) {
setConfig(key, "" + value);
setConfig(key, Long.toString(value));
}
public void setConfig(String key, String value) {

@ -219,14 +219,6 @@ public final class serverDate {
return new String(result);
}
/*
private static String format(int c, int len) {
String s = "" + c;
while (s.length() < len) s = "0" + s;
return s;
}
*/
// the following is only here to compare the kelondroDate with java-Date:
private static TimeZone GMTTimeZone = TimeZone.getTimeZone("GMT");
private static Calendar gregorian = new GregorianCalendar(GMTTimeZone);

@ -105,7 +105,7 @@ public final class serverObjects extends Hashtable implements Cloneable {
// long variant
public long put(String key, long value) {
String result = this.put(key, "" + value);
String result = this.put(key, Long.toString(value));
if (result == null) return 0; else try {
return Long.parseLong(result);
} catch (NumberFormatException e) {
@ -118,7 +118,7 @@ public final class serverObjects extends Hashtable implements Cloneable {
String c = (String) super.get(key);
if (c == null) c = "0";
long l = Long.parseLong(c) + 1;
super.put(key, "" + l);
super.put(key, Long.toString(l));
return l;
}

@ -55,7 +55,7 @@ public class disorderHeap {
// create a disorder heap with numbers in it
// the numbers are 0..numbers-1
this();
for (int i = 0; i < numbers; i++) add("" + i);
for (int i = 0; i < numbers; i++) add(Integer.toString(i));
}
public synchronized void add(Object element) {

@ -307,7 +307,7 @@ public class yacyClient {
obj.put("resource", ((global) ? "global" : "local"));
obj.put("query", wordhashes);
obj.put("ttl", "0");
obj.put("duetime", "" + duetime);
obj.put("duetime", Long.toString(duetime));
obj.put("mytime", yacyCore.universalDateShortString());
//yacyCore.log.logDebug("yacyClient.search url=" + url);
long timestamp = System.currentTimeMillis();
@ -376,7 +376,7 @@ public class yacyClient {
// generate statistics
long searchtime;
try {
searchtime = Integer.parseInt("" + (String) result.get("searchtime"));
searchtime = Integer.parseInt((String) result.get("searchtime"));
} catch (NumberFormatException e) {
searchtime = totalrequesttime;
}
@ -617,7 +617,7 @@ public class yacyClient {
post.put("key", key);
post.put("iam", yacyCore.seedDB.mySeed.hash);
post.put("youare", targetSeed.hash);
post.put("wordc", "" + indexes.length);
post.put("wordc", Integer.toString(indexes.length));
int indexcount = 0;
String entrypost = "";
Enumeration eenum;
@ -666,7 +666,7 @@ public class yacyClient {
}
}
post.put("entryc", "" + indexcount);
post.put("entryc", Integer.toString(indexcount));
post.put("indexes", entrypost);
try {
Vector v = httpc.wput(new URL("http://" + address + "/yacy/transferRWI.html"), 60000, null, null,
@ -678,7 +678,7 @@ public class yacyClient {
HashMap result = nxTools.table(v);
result.put("$URLCACHE$", urlCache);
result.put("$UNKNOWNC$", "" + unknownURLs.size());
result.put("$UNKNOWNC$", Integer.toString(unknownURLs.size()));
return result;
} catch (Exception e) {
yacyCore.log.logError("yacyClient.transferRWI error:" + e.getMessage());
@ -707,7 +707,7 @@ public class yacyClient {
}
}
}
post.put("urlc", "" + urlc);
post.put("urlc", Integer.toString(urlc));
try {
Vector v = httpc.wput(new URL("http://" + address + "/yacy/transferURL.html"), 60000, null, null,
yacyCore.seedDB.sb.remoteProxyHost, yacyCore.seedDB.sb.remoteProxyPort, post);

@ -105,7 +105,7 @@ public class yacyNewsRecord {
if (this.category != null) attributes.put("cat", this.category);
if (this.created != null) attributes.put("cre", yacyCore.universalDateShortString(this.created));
if (this.received != null) attributes.put("rec", yacyCore.universalDateShortString(this.received));
attributes.put("dis", "" + this.distributed);
attributes.put("dis", Integer.toString(this.distributed));
String theString = attributes.toString();
removeStandards();
return theString;

@ -107,13 +107,13 @@ public class yacyPeerActions {
}
long uptime = ((yacyCore.universalTime() - Long.parseLong(sb.getConfig("startupTime", "0"))) / 1000) / 60;
long indexedc = sb.getThread("80_indexing").getBusyCycles();
seedDB.mySeed.put("ISpeed", ((indexedc == 0) || (uptime == 0)) ? "unknown" : ("" + (indexedc / uptime))); // the speed of indexing (pages/minute) of the peer
seedDB.mySeed.put("Uptime", "" + uptime); // the number of minutes that the peer is up in minutes/day (moving average MA30)
seedDB.mySeed.put("LCount", "" + sb.urlPool.loadedURL.size()); // the number of links that the peer has stored (LURL's)
seedDB.mySeed.put("NCount", "" + sb.urlPool.noticeURL.stackSize()); // the number of links that the peer has noticed, but not loaded (NURL's)
seedDB.mySeed.put("ICount", "" + sb.cacheSizeMin()); // the minimum number of words that the peer has indexed (as it says)
seedDB.mySeed.put("SCount", "" + seedDB.sizeConnected()); // the number of seeds that the peer has stored
seedDB.mySeed.put("CCount", "" + (((int) ((seedDB.sizeConnected() + seedDB.sizeDisconnected() + seedDB.sizePotential()) * 60.0 / (uptime + 1.01)) * 100) / 100.0)); // the number of clients that the peer connects (as connects/hour)
seedDB.mySeed.put("ISpeed", ((indexedc == 0) || (uptime == 0)) ? "unknown" : Long.toString(indexedc / uptime)); // the speed of indexing (pages/minute) of the peer
seedDB.mySeed.put("Uptime", Long.toString(uptime)); // the number of minutes that the peer is up in minutes/day (moving average MA30)
seedDB.mySeed.put("LCount", Integer.toString(sb.urlPool.loadedURL.size())); // the number of links that the peer has stored (LURL's)
seedDB.mySeed.put("NCount", Integer.toString(sb.urlPool.noticeURL.stackSize())); // the number of links that the peer has noticed, but not loaded (NURL's)
seedDB.mySeed.put("ICount", Integer.toString(sb.cacheSizeMin())); // the minimum number of words that the peer has indexed (as it says)
seedDB.mySeed.put("SCount", Integer.toString(seedDB.sizeConnected())); // the number of seeds that the peer has stored
seedDB.mySeed.put("CCount", Double.toString(((int) ((seedDB.sizeConnected() + seedDB.sizeDisconnected() + seedDB.sizePotential()) * 60.0 / (uptime + 1.01)) * 100) / 100.0)); // the number of clients that the peer connects (as connects/hour)
seedDB.mySeed.put("Version", sb.getConfig("version", ""));
if (seedDB.mySeed.get("PeerType","").equals("principal")) {
// attach information about seed location

@ -164,19 +164,19 @@ public class yacySeed {
public void incSI(int count) {
String v = (String) dna.get("sI"); if (v == null) v = "0";
dna.put("sI", "" + (Integer.parseInt(v) + count));
dna.put("sI", Integer.toString(Integer.parseInt(v) + count));
}
public void incRI(int count) {
String v = (String) dna.get("rI"); if (v == null) v = "0";
dna.put("rI", "" + (Integer.parseInt(v) + count));
dna.put("rI", Integer.toString(Integer.parseInt(v) + count));
}
public void incSU(int count) {
String v = (String) dna.get("sU"); if (v == null) v = "0";
dna.put("sU", "" + (Integer.parseInt(v) + count));
dna.put("sU", Integer.toString(Integer.parseInt(v) + count));
}
public void incRU(int count) {
String v = (String) dna.get("rU"); if (v == null) v = "0";
dna.put("rU", "" + (Integer.parseInt(v) + count));
dna.put("rU", Integer.toString(Integer.parseInt(v) + count));
}
// 12 * 6 bit = 72 bit = 9 byte
@ -317,7 +317,7 @@ public class yacySeed {
sp.getProperty("java.version","") +
sp.getProperty("os.version","") +
sb.getConfig("peerName", "noname");
String fast = "" + System.currentTimeMillis();
String fast = Long.toString(System.currentTimeMillis());
// the resultinh hash does not have any information than can be used to reconstruct the
// original system information that has been collected here to create the hash
// We simply distinuguish three parts of the hash: slow, medium and fast changing character of system idenfification

@ -140,11 +140,11 @@ public final class yacy {
long svn;
try {svn = (long) (100000000.0 * Double.parseDouble(s));} catch (NumberFormatException ee) {svn = 0;}
double version = (Math.floor((double) svn / (double) 100000) / (double) 1000);
String vStr = (version < 0.11) ? "dev" : "" + version;
String vStr = (version < 0.11) ? "dev" : Double.toString(version);
//while (vStr.length() < 5) vStr = vStr + "0";
svn = svn % 100000;
if (svn > 4000) svn=svn / 10; // fix a previous bug online
String svnStr = "" + svn;
String svnStr = Long.toString(svn);
while (svnStr.length() < 5) svnStr = "0" + svnStr;
return vStr + "/" + svnStr;
}
@ -235,10 +235,10 @@ public final class yacy {
System.err.println("Unable to determine the currently used SVN revision number.");
}
sb.setConfig("version", "" + version);
sb.setConfig("version", Float.toString(version));
sb.setConfig("vdate", vDATE);
sb.setConfig("applicationRoot", homePath);
sb.setConfig("startupTime", "" + startup);
sb.setConfig("startupTime", Long.toString(startup));
serverLog.logSystem("STARTUP", "YACY Version: " + version + ", Built " + vDATE);
yacyCore.latestVersion = (float) version;

Loading…
Cancel
Save