Пример #1
0
        public void RegisterStateStoreAndGetUnknown()
        {
            TaskId id = new TaskId {
                Id = 1, Partition = 0, Topic = "topic"
            };
            TopicPartition        partition = new TopicPartition("topic", 0);
            ProcessorStateManager stateMgt  = new ProcessorStateManager(id, partition);

            stateMgt.Register(new TestStateStore("state-store1"), null);
            var store = stateMgt.GetStore("sdfdfre1");

            Assert.IsNull(store);
        }
        public void RegisterStateStoreAndGetIt()
        {
            TaskId id = new TaskId {
                Id = 1, Partition = 0
            };
            TopicPartition        partition = new TopicPartition("topic", 0);
            ProcessorStateManager stateMgt  = new ProcessorStateManager(id, new List <TopicPartition> {
                partition
            });

            stateMgt.Register(new TestStateStore("state-store1"), null);
            var store = stateMgt.GetStore("state-store1");

            Assert.IsNotNull(store);
            Assert.AreEqual("state-store1", store.Name);
        }