Пример #1
0
 public List<com.ctrip.hermes.meta.entity.Partition> findPartitions(
     com.ctrip.hermes.metaservice.model.Topic topicModel) throws DalException {
   List<com.ctrip.hermes.metaservice.model.Partition> models =
       partitionDao.findByTopic(topicModel.getId());
   List<com.ctrip.hermes.meta.entity.Partition> entities = new ArrayList<>();
   for (com.ctrip.hermes.metaservice.model.Partition model : models) {
     com.ctrip.hermes.meta.entity.Partition entity = ModelToEntityConverter.convert(model);
     entities.add(entity);
   }
   return entities;
 }
Пример #2
0
 public List<Partition> findPartitionsByTopic(Long topicId) {
   List<com.ctrip.hermes.meta.entity.Partition> entities = new ArrayList<>();
   try {
     List<com.ctrip.hermes.metaservice.model.Partition> models = partitionDao.findByTopic(topicId);
     for (com.ctrip.hermes.metaservice.model.Partition model : models) {
       com.ctrip.hermes.meta.entity.Partition entity = ModelToEntityConverter.convert(model);
       entities.add(entity);
     }
   } catch (DalException e) {
     e.printStackTrace();
   }
   return entities;
 }