@Test public void testListAllMysqlDataSources() throws Exception { List<Datasource> datasources = m_metaService.listAllMysqlDataSources(); assertEquals(2, datasources.size()); assertEquals("ds0", datasources.get(0).getId()); assertEquals("ds1", datasources.get(1).getId()); }
@Override public List<Datasource> listAllMysqlDataSources() { Meta meta = getMeta(); final List<Datasource> dataSources = new ArrayList<Datasource>(); meta.accept(new BaseVisitor2() { @Override protected void visitDatasourceChildren(Datasource ds) { Storage storage = getAncestor(2); if (StringUtils.equalsIgnoreCase(Storage.MYSQL, storage.getType())) { dataSources.add(ds); } super.visitDatasourceChildren(ds); } }); return dataSources; }
DefaultMetaService implements MetaService, Initializable { @Override public List<Datasource> listAllMysqlDataSources() { Meta meta = getMeta(); final List<Datasource> dataSources = new ArrayList<Datasource>(); meta.accept(new BaseVisitor2() { @Override protected void visitDatasourceChildren(Datasource ds) { Storage storage = getAncestor(2); if (StringUtils.equalsIgnoreCase(Storage.MYSQL, storage.getType())) { dataSources.add(ds); } super.visitDatasourceChildren(ds); } }); return dataSources; } }
DefaultMetaService implements MetaService, Initializable { @Override public List<Datasource> listAllMysqlDataSources() { Meta meta = getMeta(); final List<Datasource> dataSources = new ArrayList<Datasource>(); meta.accept(new BaseVisitor2() { @Override protected void visitDatasourceChildren(Datasource ds) { Storage storage = getAncestor(2); if (StringUtils.equalsIgnoreCase(Storage.MYSQL, storage.getType())) { dataSources.add(ds); } super.visitDatasourceChildren(ds); } }); return dataSources; }  }
DefaultMetaService implements MetaService, Initializable { @Override public List<Datasource> listAllMysqlDataSources() { Meta meta = getMeta(); final List<Datasource> dataSources = new ArrayList<Datasource>(); meta.accept(new BaseVisitor2() { @Override protected void visitDatasourceChildren(Datasource ds) { Storage storage = getAncestor(2); if (StringUtils.equalsIgnoreCase(Storage.MYSQL, storage.getType())) { dataSources.add(ds); } super.visitDatasourceChildren(ds); } }); return dataSources; }  @Override List<Partition> listPartitionsByTopic(String topicName); @Override Storage findStorageByTopic(String topicName); @Override Partition findPartitionByTopicAndPartition(String topicName, int partitionId); @Override List<Topic> listTopicsByPattern(String topicPattern); @Override Topic findTopicByName(String topicName); @Override int translateToIntGroupId(String topicName, String groupName); @Override List<Datasource> listAllMysqlDataSources(); @Override int getAckTimeoutSecondsByTopicAndConsumerGroup(String topicName, String groupId); @Override LeaseAcquireResponse tryAcquireConsumerLease(Tpg tpg, String sessionId); @Override LeaseAcquireResponse tryRenewConsumerLease(Tpg tpg, Lease lease, String sessionId); @Override LeaseAcquireResponse tryRenewBrokerLease(String topic, int partition, Lease lease, String sessionId,
	      int brokerPort); @Override LeaseAcquireResponse tryAcquireBrokerLease(String topic, int partition, String sessionId, int brokerPort); @Override void initialize(); @Override synchronized Pair<Endpoint, Long> findEndpointByTopicAndPartition(String topic, int partition); @Override RetryPolicy findRetryPolicyByTopicAndGroup(String topicName, String groupId); @Override boolean containsEndpoint(Endpoint endpoint); @Override boolean containsConsumerGroup(String topicName, String groupId); @Override Offset findMessageOffsetByTime(String topic, int partition, long time); @Override Map<Integer, Offset> findMessageOffsetByTime(String topic, long time); @Override List<ZookeeperEnsemble> listAllZookeeperEnsemble(); @Override Idc getPrimaryIdc(); }
DefaultMetaService implements MetaService, Initializable { @Override public List<Datasource> listAllMysqlDataSources() { Meta meta = getMeta(); final List<Datasource> dataSources = new ArrayList<Datasource>(); meta.accept(new BaseVisitor2() { @Override protected void visitDatasourceChildren(Datasource ds) { Storage storage = getAncestor(2); if (StringUtils.equalsIgnoreCase(Storage.MYSQL, storage.getType())) { dataSources.add(ds); } super.visitDatasourceChildren(ds); } }); return dataSources; }  @Override List<Partition> listPartitionsByTopic(String topicName); @Override Storage findStorageByTopic(String topicName); @Override Partition findPartitionByTopicAndPartition(String topicName, int partitionId); @Override List<Topic> listTopicsByPattern(String topicPattern); @Override Topic findTopicByName(String topicName); @Override int translateToIntGroupId(String topicName, String groupName); @Override List<Datasource> listAllMysqlDataSources(); @Override int getAckTimeoutSecondsByTopicAndConsumerGroup(String topicName, String groupId); @Override LeaseAcquireResponse tryAcquireConsumerLease(Tpg tpg, String sessionId); @Override LeaseAcquireResponse tryRenewConsumerLease(Tpg tpg, Lease lease, String sessionId); @Override LeaseAcquireResponse tryRenewBrokerLease(String topic, int partition, Lease lease, String sessionId,
	      int brokerPort); @Override LeaseAcquireResponse tryAcquireBrokerLease(String topic, int partition, String sessionId, int brokerPort); @Override void initialize(); @Override synchronized Pair<Endpoint, Long> findEndpointByTopicAndPartition(String topic, int partition); @Override RetryPolicy findRetryPolicyByTopicAndGroup(String topicName, String groupId); @Override boolean containsEndpoint(Endpoint endpoint); @Override boolean containsConsumerGroup(String topicName, String groupId); @Override Offset findMessageOffsetByTime(String topic, int partition, long time); @Override Map<Integer, Offset> findMessageOffsetByTime(String topic, long time); @Override List<ZookeeperEnsemble> listAllZookeeperEnsemble(); @Override Idc getPrimaryIdc();  }