Class UpdateTimer
- java.lang.Object
-
- org.aksw.iguana.cc.worker.impl.update.UpdateTimer
-
public class UpdateTimer extends java.lang.Object
Class to calculate time between two update queries.- Author:
- f.conrads
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UpdateTimer.Strategy
The 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 double
calculateTime(double timeExceeded, long executedQueries)
calculates the time the UPDATEWorker has to wait until the next update queryjava.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
-