Class UpdateTimer
- java.lang.Object
-
- org.aksw.iguana.cc.worker.impl.update.UpdateTimer
-
public class UpdateTimer extends java.lang.ObjectClass to calculate time between two update queries.- Author:
- f.conrads
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUpdateTimer.StrategyThe possible strategies NONE: updates will be executed immediately after another FIXED: a fixed value in ms will be waited before the next update query DISTRIBUTED: the updates will be equally distributed over the time limit of the task
-
Constructor Summary
Constructors Constructor Description UpdateTimer()Creates the default UpdateTimer All update queries will be executed immediately after anotherUpdateTimer(double fixedValue)Creates a FixedUpdateTimerUpdateTimer(int noOfUpdates, java.lang.Double timeLimit)Creates a distributed UpdateTimer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalculateTime(double timeExceeded, long executedQueries)calculates the time the UPDATEWorker has to wait until the next update queryjava.lang.StringtoString()
-
-
-
Constructor Detail
-
UpdateTimer
public UpdateTimer()
Creates the default UpdateTimer All update queries will be executed immediately after another
-
UpdateTimer
public UpdateTimer(double fixedValue)
Creates a FixedUpdateTimer- Parameters:
fixedValue- the fixed time to wait between queries
-
UpdateTimer
public UpdateTimer(int noOfUpdates, java.lang.Double timeLimit)Creates a distributed UpdateTimer- Parameters:
noOfUpdates- the number of update queriestimeLimit- the timeLimit of the task
-
-
Method Detail
-
calculateTime
public double calculateTime(double timeExceeded, long executedQueries)calculates the time the UPDATEWorker has to wait until the next update query- Parameters:
timeExceeded- The time it took from start of the task to nowexecutedQueries- currently number of executed Update Queries- Returns:
- The time to wait
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-