/** * Process JMS message produced by HCat. * * @param msg : to be processed */ @Override public void process(Message msg) { try { HCatEventMessage hcatMsg = MessagingUtils.getMessage(msg); if (hcatMsg.getEventType().equals(HCatEventMessage.EventType.ADD_PARTITION)) { // Parse msg components AddPartitionMessage partMsg = (AddPartitionMessage) hcatMsg; String db = partMsg.getDB(); String table = partMsg.getTable(); LOG.info("Partition available event: db [{0}] table [{1}] partitions [{2}]", db, table, partMsg.getPartitions()); List<Map<String, String>> partitions = partMsg.getPartitions(); for (int i = 0; i < partitions.size(); i++) { pdmService.partitionAvailable(this.server, db, table, partitions.get(i)); } } else { LOG.debug("Ignoring message of event type [{0}] ", hcatMsg.getEventType()); } } catch (Exception e) { LOG.warn("Error processing JMS message", e); } }
/** * Process JMS message produced by HCat. * * @param msg : to be processed */ @Override public void process(Message msg) { try { HCatEventMessage hcatMsg = MessagingUtils.getMessage(msg); if (hcatMsg.getEventType().equals(HCatEventMessage.EventType.ADD_PARTITION)) { // Parse msg components AddPartitionMessage partMsg = (AddPartitionMessage) hcatMsg; String db = partMsg.getDB(); String table = partMsg.getTable(); LOG.info("Partition available event: db [{0}] table [{1}] partitions [{2}]", db, table, partMsg.getPartitions()); List<Map<String, String>> partitions = partMsg.getPartitions(); for (int i = 0; i < partitions.size(); i++) { pdmService.partitionAvailable(this.server, db, table, partitions.get(i)); } } else { LOG.debug("Ignoring message of event type [{0}] ", hcatMsg.getEventType()); } } catch (Exception e) { LOG.warn("Error processing JMS message", e); } }