You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by cr...@apache.org on 2014/07/09 23:54:39 UTC
git commit: SAMZA-326;
make range inclusive on head and exclusive on tail, rather than
exclusive on both
Repository: incubator-samza
Updated Branches:
refs/heads/0.7.1 ca391273d -> a17592907
SAMZA-326; make range inclusive on head and exclusive on tail, rather than exclusive on both
Project: http://git-wip-us.apache.org/repos/asf/incubator-samza/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-samza/commit/a1759290
Tree: http://git-wip-us.apache.org/repos/asf/incubator-samza/tree/a1759290
Diff: http://git-wip-us.apache.org/repos/asf/incubator-samza/diff/a1759290
Branch: refs/heads/0.7.1
Commit: a17592907057b03c0bf21bae06ec78de36306985
Parents: ca39127
Author: Chinmay Soman <ch...@gmail.com>
Authored: Wed Jul 9 14:54:32 2014 -0700
Committer: Chris Riccomini <cr...@criccomi-mn.linkedin.biz>
Committed: Wed Jul 9 14:54:32 2014 -0700
----------------------------------------------------------------------
build.gradle | 1 +
.../scala/org/apache/samza/storage/kv/LevelDbKeyValueStore.scala | 2 +-
.../scala/org/apache/samza/storage/kv/TestKeyValueStores.scala | 3 ++-
3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/a1759290/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 0e0e0e3..dc5f6ca 100644
--- a/build.gradle
+++ b/build.gradle
@@ -245,6 +245,7 @@ project(":samza-kv_$scalaVersion") {
testCompile "junit:junit:$junitVersion"
// Depend on samza-core's test classes so TestUtils can be used.
testCompile project(":samza-core_$scalaVersion").sourceSets.test.output
+ testCompile "org.scalatest:scalatest_$scalaVersion:$scalaTestVersion"
}
}
http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/a1759290/samza-kv/src/main/scala/org/apache/samza/storage/kv/LevelDbKeyValueStore.scala
----------------------------------------------------------------------
diff --git a/samza-kv/src/main/scala/org/apache/samza/storage/kv/LevelDbKeyValueStore.scala b/samza-kv/src/main/scala/org/apache/samza/storage/kv/LevelDbKeyValueStore.scala
index 72562cf..ced4cf5 100644
--- a/samza-kv/src/main/scala/org/apache/samza/storage/kv/LevelDbKeyValueStore.scala
+++ b/samza-kv/src/main/scala/org/apache/samza/storage/kv/LevelDbKeyValueStore.scala
@@ -207,7 +207,7 @@ class LevelDbKeyValueStore(
val comparator = if (options.comparator == null) lexicographic else options.comparator
iter.seek(from)
override def hasNext() = {
- iter.hasNext() && comparator.compare(iter.peekNext.getKey, to) <= 0
+ iter.hasNext() && comparator.compare(iter.peekNext.getKey, to) < 0
}
}
http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/a1759290/samza-kv/src/test/scala/org/apache/samza/storage/kv/TestKeyValueStores.scala
----------------------------------------------------------------------
diff --git a/samza-kv/src/test/scala/org/apache/samza/storage/kv/TestKeyValueStores.scala b/samza-kv/src/test/scala/org/apache/samza/storage/kv/TestKeyValueStores.scala
index d438a8f..9b0872d 100644
--- a/samza-kv/src/test/scala/org/apache/samza/storage/kv/TestKeyValueStores.scala
+++ b/samza-kv/src/test/scala/org/apache/samza/storage/kv/TestKeyValueStores.scala
@@ -35,6 +35,7 @@ import org.junit.runners.Parameterized.Parameters
import org.apache.samza.serializers.StringSerde
import org.apache.samza.util.TestUtil._
import org.apache.samza.serializers.Serde
+import org.scalatest.Assertions.intercept
@RunWith(value = classOf[Parameterized])
class TestKeyValueStores(typeOfStore: String) {
@@ -151,7 +152,7 @@ class TestKeyValueStores(typeOfStore: String) {
for (letter <- letters)
store.put(b(letter.toString), b(letter.toString))
val iter = store.range(b(letters(from)), b(letters(to)))
- checkRange(letters.slice(from, to + 1), iter)
+ checkRange(letters.slice(from, to), iter)
iter.close()
}