Repository: samza Updated Branches: refs/heads/master 0169912c6 -> ed5be4f92
SAMZA-838 - negative rocksdb.ttl.ms is not handled correctly Project: http://git-wip-us.apache.org/repos/asf/samza/repo Commit: http://git-wip-us.apache.org/repos/asf/samza/commit/ed5be4f9 Tree: http://git-wip-us.apache.org/repos/asf/samza/tree/ed5be4f9 Diff: http://git-wip-us.apache.org/repos/asf/samza/diff/ed5be4f9 Branch: refs/heads/master Commit: ed5be4f927a9e3f5b92641b39b59f10b77cba894 Parents: 0169912 Author: Tao Feng <[email protected]> Authored: Thu Apr 14 23:31:02 2016 -0700 Committer: Navina Ramesh <[email protected]> Committed: Thu Apr 14 23:33:44 2016 -0700 ---------------------------------------------------------------------- .../samza/storage/kv/RocksDbKeyValueStore.scala | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/samza/blob/ed5be4f9/samza-kv-rocksdb/src/main/scala/org/apache/samza/storage/kv/RocksDbKeyValueStore.scala ---------------------------------------------------------------------- diff --git a/samza-kv-rocksdb/src/main/scala/org/apache/samza/storage/kv/RocksDbKeyValueStore.scala b/samza-kv-rocksdb/src/main/scala/org/apache/samza/storage/kv/RocksDbKeyValueStore.scala index 292f158..b896810 100644 --- a/samza-kv-rocksdb/src/main/scala/org/apache/samza/storage/kv/RocksDbKeyValueStore.scala +++ b/samza-kv-rocksdb/src/main/scala/org/apache/samza/storage/kv/RocksDbKeyValueStore.scala @@ -40,14 +40,19 @@ object RocksDbKeyValueStore extends Logging { ttl = storeConfig.getLong("rocksdb.ttl.ms") // RocksDB accepts TTL in seconds, convert ms to seconds - if (ttl < 1000) - { - warn("The ttl values requested for %s is %d, which is less than 1000 (minimum), using 1000 instead", - storeName, - ttl) - ttl = 1000 + if(ttl > 0) { + if (ttl < 1000) + { + warn("The ttl values requested for %s is %d, which is less than 1000 (minimum), using 1000 instead", + storeName, + ttl) + ttl = 1000 + } + ttl = ttl / 1000 + } + else { + warn("Non-positive TTL for RocksDB implies infinite TTL for the data. More Info -https://github.com/facebook/rocksdb/wiki/Time-to-Live") } - ttl = ttl / 1000 useTTL = true if (isLoggedStore)
