@Test public void testPersist() { ConsumerFilterManager filterManager = gen(10, 10); try { filterManager.persist(); ConsumerFilterData filterData = filterManager.get("topic9", "CID_9"); assertThat(filterData).isNotNull(); assertThat(filterData.isDead()).isFalse(); ConsumerFilterManager loadFilter = new ConsumerFilterManager(); assertThat(loadFilter.load()).isTrue(); filterData = loadFilter.get("topic9", "CID_9"); assertThat(filterData).isNotNull(); assertThat(filterData.isDead()).isTrue(); assertThat(filterData.getCompiledExpression()).isNotNull(); } finally { UtilAll.deleteFile(new File("./unit_test")); } }
public ConsumerFilterData get(final String topic, final String consumerGroup) { if (!this.filterDataByTopic.containsKey(topic)) { return null; } if (this.filterDataByTopic.get(topic).getGroupFilterData().isEmpty()) { return null; } return this.filterDataByTopic.get(topic).getGroupFilterData().get(consumerGroup); }
ConsumerFilterManager extends ConfigManager { public ConsumerFilterData get(final String topic, final String consumerGroup) { if (!this.filterDataByTopic.containsKey(topic)) { return null; } if (this.filterDataByTopic.get(topic).getGroupFilterData().isEmpty()) { return null; } return this.filterDataByTopic.get(topic).getGroupFilterData().get(consumerGroup); } }
ConsumerFilterManager extends ConfigManager { public ConsumerFilterData get(final String topic, final String consumerGroup) { if (!this.filterDataByTopic.containsKey(topic)) { return null; } if (this.filterDataByTopic.get(topic).getGroupFilterData().isEmpty()) { return null; } return this.filterDataByTopic.get(topic).getGroupFilterData().get(consumerGroup); } ConsumerFilterManager();  ConsumerFilterManager(BrokerController brokerController); }
ConsumerFilterManager extends ConfigManager { public ConsumerFilterData get(final String topic, final String consumerGroup) { if (!this.filterDataByTopic.containsKey(topic)) { return null; } if (this.filterDataByTopic.get(topic).getGroupFilterData().isEmpty()) { return null; } return this.filterDataByTopic.get(topic).getGroupFilterData().get(consumerGroup); } ConsumerFilterManager();  ConsumerFilterManager(BrokerController brokerController); static ConsumerFilterData build(final String topic, final String consumerGroup,
        final String expression, final String type,
        final long clientVersion); void register(final String consumerGroup, final Collection<SubscriptionData> subList); boolean register(final String topic, final String consumerGroup, final String expression,
        final String type, final long clientVersion); void unRegister(final String consumerGroup); ConsumerFilterData get(final String topic, final String consumerGroup); Collection<ConsumerFilterData> getByGroup(final String consumerGroup); final Collection<ConsumerFilterData> get(final String topic); BloomFilter getBloomFilter(); @Override String encode(); @Override String configFilePath(); @Override void decode(final String jsonString); @Override String encode(final boolean prettyFormat); void clean(); ConcurrentMap<String, FilterDataMapByTopic> getFilterDataByTopic(); void setFilterDataByTopic(final ConcurrentHashMap<String, FilterDataMapByTopic> filterDataByTopic); }
ConsumerFilterManager extends ConfigManager { public ConsumerFilterData get(final String topic, final String consumerGroup) { if (!this.filterDataByTopic.containsKey(topic)) { return null; } if (this.filterDataByTopic.get(topic).getGroupFilterData().isEmpty()) { return null; } return this.filterDataByTopic.get(topic).getGroupFilterData().get(consumerGroup); } ConsumerFilterManager();  ConsumerFilterManager(BrokerController brokerController); static ConsumerFilterData build(final String topic, final String consumerGroup,
        final String expression, final String type,
        final long clientVersion); void register(final String consumerGroup, final Collection<SubscriptionData> subList); boolean register(final String topic, final String consumerGroup, final String expression,
        final String type, final long clientVersion); void unRegister(final String consumerGroup); ConsumerFilterData get(final String topic, final String consumerGroup); Collection<ConsumerFilterData> getByGroup(final String consumerGroup); final Collection<ConsumerFilterData> get(final String topic); BloomFilter getBloomFilter(); @Override String encode(); @Override String configFilePath(); @Override void decode(final String jsonString); @Override String encode(final boolean prettyFormat); void clean(); ConcurrentMap<String, FilterDataMapByTopic> getFilterDataByTopic(); void setFilterDataByTopic(final ConcurrentHashMap<String, FilterDataMapByTopic> filterDataByTopic);  }