@Override public void run() throws Exception { MessagingServiceUtils.getSystemTopics(cConf, false); LOG.info("Messaging System configurations verified."); } }
@Override protected void startUp() throws Exception { Queue<TopicId> asyncCreationTopics = new LinkedList<>(); Set<TopicId> systemTopics = MessagingServiceUtils.getSystemTopics(cConf, true); for (TopicId topic : systemTopics) { createSystemTopic(topic, asyncCreationTopics); } if (!asyncCreationTopics.isEmpty()) { startAsyncTopicCreation(asyncCreationTopics, 5, TimeUnit.SECONDS); } LOG.info("Core Messaging Service started"); }
@Override protected void startUp() throws Exception { Queue<TopicId> asyncCreationTopics = new LinkedList<>(); Set<TopicId> systemTopics = MessagingServiceUtils.getSystemTopics(cConf, true); for (TopicId topic : systemTopics) { createSystemTopic(topic, asyncCreationTopics); } if (!asyncCreationTopics.isEmpty()) { startAsyncTopicCreation(asyncCreationTopics, 5, TimeUnit.SECONDS); } LOG.info("Core Messaging Service started"); }
Set<TopicId> systemTopics = MessagingServiceUtils.getSystemTopics(cConf, true); if (cacheSize > 0 && !systemTopics.isEmpty()) { MessageTableEntryWeigher weigher = new MessageTableEntryWeigher();
Set<TopicId> systemTopics = MessagingServiceUtils.getSystemTopics(cConf, true); if (cacheSize > 0 && !systemTopics.isEmpty()) { MessageTableEntryWeigher weigher = new MessageTableEntryWeigher();
@Test public void testSystemTopics() { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.MessagingSystem.SYSTEM_TOPICS, " topic-1, topic_2 ,prefix:10,invalid.name"); Set<TopicId> topics = MessagingServiceUtils.getSystemTopics(cConf, true); Set<TopicId> expected = new LinkedHashSet<>(); expected.add(NamespaceId.SYSTEM.topic("topic-1")); expected.add(NamespaceId.SYSTEM.topic("topic_2")); for (int i = 0; i < 10; i++) { expected.add(NamespaceId.SYSTEM.topic("prefix" + i)); } Assert.assertEquals(expected, topics); } }