kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: add test to make sure ProcessorStateManager can handle State Stores with logging disabled
Date Wed, 28 Sep 2016 00:43:48 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.10.1 aef1c13a3 -> 1fcf9fd62


MINOR: add test to make sure ProcessorStateManager can handle State Stores with logging disabled

Adding the test so we know that the State Stores with logging disabled or without a topic
don't throw any exceptions.

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1916 from dguy/state-store-logging-disabled

(cherry picked from commit c526c0c3f6f153ef8f84a3e66d9f997d8c31e20c)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/1fcf9fd6
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/1fcf9fd6
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/1fcf9fd6

Branch: refs/heads/0.10.1
Commit: 1fcf9fd6287db7de1abd9be9a73f1fa8a4ecd402
Parents: aef1c13
Author: Damian Guy <damian.guy@gmail.com>
Authored: Tue Sep 27 17:43:36 2016 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Sep 27 17:43:45 2016 -0700

----------------------------------------------------------------------
 .../processor/internals/ProcessorStateManagerTest.java      | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/1fcf9fd6/streams/src/test/java/org/apache/kafka/streams/processor/internals/ProcessorStateManagerTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/processor/internals/ProcessorStateManagerTest.java
b/streams/src/test/java/org/apache/kafka/streams/processor/internals/ProcessorStateManagerTest.java
index 5802b29..7c22202 100644
--- a/streams/src/test/java/org/apache/kafka/streams/processor/internals/ProcessorStateManagerTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/processor/internals/ProcessorStateManagerTest.java
@@ -48,6 +48,7 @@ import java.util.Map;
 import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
@@ -461,4 +462,12 @@ public class ProcessorStateManagerTest {
         assertEquals(new Long(123L + 1L), checkpointedOffsets.get(new TopicPartition(persistentStoreTopicName,
1)));
     }
 
+    @Test
+    public void shouldRegisterStoreWithoutLoggingEnabledAndNotBackedByATopic() throws Exception
{
+        MockStateStoreSupplier.MockStateStore mockStateStore = new MockStateStoreSupplier.MockStateStore(nonPersistentStoreName,
false);
+        ProcessorStateManager stateMgr = new ProcessorStateManager(applicationId, new TaskId(0,
1), noPartitions, new MockRestoreConsumer(), false, stateDirectory, null, Collections.<StateStore,
ProcessorNode>emptyMap());
+        stateMgr.register(mockStateStore, false, mockStateStore.stateRestoreCallback);
+        assertNotNull(stateMgr.getStore(nonPersistentStoreName));
+    }
+
 }


Mime
View raw message