- add javadoc to busythread with hint about the init parameter useage

- remove obsolete 10_httpd config parameter
pull/1/head
reger 10 years ago
parent 4144c7cc52
commit 8e751d754a

@ -180,7 +180,6 @@ public class PerformanceQueues_p {
// check values to prevent short-cut loops // check values to prevent short-cut loops
if (idlesleep < 1000) idlesleep = 1000; if (idlesleep < 1000) idlesleep = 1000;
if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; loadprereq = 9; }
sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq); sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq);
idlesleep = sb.getConfigLong(threadName + "_idlesleep", idlesleep); idlesleep = sb.getConfigLong(threadName + "_idlesleep", idlesleep);
@ -194,7 +193,6 @@ public class PerformanceQueues_p {
loadprereq = Double.parseDouble(d(defaultSettings.get(threadName + "_loadprereq"), String.valueOf(memprereq))); loadprereq = Double.parseDouble(d(defaultSettings.get(threadName + "_loadprereq"), String.valueOf(memprereq)));
// check values to prevent short-cut loops // check values to prevent short-cut loops
if (idlesleep < 1000) idlesleep = 1000; if (idlesleep < 1000) idlesleep = 1000;
if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; loadprereq = 9; }
//if (threadName.equals(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) && (busysleep < 50)) busysleep = 50; //if (threadName.equals(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) && (busysleep < 50)) busysleep = 50;
sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq); sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq);
} }
@ -204,7 +202,6 @@ public class PerformanceQueues_p {
prop.put("table_" + c + "_loadprereq", loadprereq); prop.put("table_" + c + "_loadprereq", loadprereq);
// disallow setting of memprereq for indexer to prevent db from throwing OOMs // disallow setting of memprereq for indexer to prevent db from throwing OOMs
// prop.put("table_" + c + "_disabled", /*(threadName.endsWith("_indexing")) ? 1 :*/ "0"); // prop.put("table_" + c + "_disabled", /*(threadName.endsWith("_indexing")) ? 1 :*/ "0");
prop.put("table_" + c + "_disabled", threadName.equals("10_httpd") ? "1" : "0" ); // httpd hardcoded defaults
prop.put("table_" + c + "_recommendation", threadName.endsWith("_indexing") ? "1" : "0"); prop.put("table_" + c + "_recommendation", threadName.endsWith("_indexing") ? "1" : "0");
prop.putNum("table_" + c + "_recommendation_value", rwi == null ? 0 : threadName.endsWith("_indexing") ? (rwi.minMem() / 1024) : 0); prop.putNum("table_" + c + "_recommendation_value", rwi == null ? 0 : threadName.endsWith("_indexing") ? (rwi.minMem() / 1024) : 0);
c++; c++;

@ -41,13 +41,23 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
private boolean intermissionObedient = true; private boolean intermissionObedient = true;
private final Object syncObject = new Object(); private final Object syncObject = new Object();
private long idleSleep = Long.MIN_VALUE; private final long idleSleep; // min allowed idle sleep
private long busySleep = Long.MIN_VALUE; private final long busySleep; // min allowed busy sleep
public AbstractBusyThread(long idleSleep, long busySleep) { /**
* Initializes the AbstractBusyThread with min allowed sleep time (in milliseconds)
* and sets the actual sleep time to this values.
*
* @param minidleSleep defines min idle sleep time that can be set via setIdleSleep()
* @param minbusySleep defines min busy sleep time that can be set via setBusySleep()
*/
public AbstractBusyThread(long minidleSleep, long minbusySleep) {
super(); super();
this.idleSleep = idleSleep; this.idleSleep = minidleSleep; // set min allowed
this.busySleep = busySleep; this.busySleep = minbusySleep;
this.idlePause = minidleSleep; // initialized actual (might be changed ba set methodes)
this.busyPause = minbusySleep; // init here makes sure getIdleSleep() returns at least min allowed
} }
@Override @Override
@ -55,7 +65,14 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
// sets a sleep time before execution of the job-loop // sets a sleep time before execution of the job-loop
startup = milliseconds; startup = milliseconds;
} }
/**
* Set the delay between idle cycles to the larger of the input argument
* and the min allowed delay defined on init
*
* @param milliseconds
* @return the actually set sleep time
*/
@Override @Override
public final long setIdleSleep(final long milliseconds) { public final long setIdleSleep(final long milliseconds) {
// sets a sleep time for pauses between two jobs // sets a sleep time for pauses between two jobs
@ -67,7 +84,14 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
public final long getIdleSleep() { public final long getIdleSleep() {
return idlePause; return idlePause;
} }
/**
* Set the delay between busy cycles to the larger of the input argument
* and the min allowed delay defined on init
*
* @param milliseconds
* @return the actually set sleep time
*/
@Override @Override
public final long setBusySleep(final long milliseconds) { public final long setBusySleep(final long milliseconds) {
// sets a sleep time for pauses between two jobs // sets a sleep time for pauses between two jobs

Loading…
Cancel
Save