Introduce a time threshold for user state recomputations.
authorChristos KK Loverdos <loverdos@gmail.com>
Thu, 22 Dec 2011 12:52:32 +0000 (14:52 +0200)
committerChristos KK Loverdos <loverdos@gmail.com>
Thu, 22 Dec 2011 12:52:32 +0000 (14:52 +0200)
src/main/resources/aquarium.properties
src/main/scala/gr/grnet/aquarium/MasterConf.scala

index dcf1e5b..379e92a 100644 (file)
@@ -61,6 +61,9 @@ user.actor.LRU.lower.mark=800
 # The upper mark for the UserActors' LRU, managed by UserActorManager.
 user.actors.LRU.upper.mark=1000
 
+# A time period in milliseconds for which we can tolerate stale data regarding user state.
+user.state.timestamp.threshold=10000
+
 # Comma separated list of exchanges known to aquarium
 amqp.exchanges=aquarium
 
index f522feb..0ec5e61 100644 (file)
@@ -403,5 +403,16 @@ object MasterConf {
      *  The DB schema to use
      */
     final val persistence_db = "persistence.db"
+
+    /**
+     * A time period in milliseconds for which we can tolerate stale data regarding user state.
+     *
+     * The smaller the value, the more accurate the user credits and other state data are.
+     *
+     * If a request for user state (e.g. balance) is received and the request timestamp exceeds
+     * the timestamp of the last known balance amount by this value, then a re-computation for
+     * the balance is triggered.
+     */
+    final val user_state_timestamp_threshold = "user.state.timestamp.threshold"
   }
 }
\ No newline at end of file