/** * Class invariant. Checked after construction or deserialization. */ public HCatEventMessage checkValid() { if (getServer() == null || getServicePrincipal() == null) { throw new IllegalStateException("Server-URL/Service-Principal shouldn't be null."); } if (getEventType() == null) { throw new IllegalStateException("Event-type unset."); } if (getDB() == null) { throw new IllegalArgumentException("DB-name unset."); } return this; } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); } }
Message msg = session.get().createTextMessage(hCatEventMessage.toString()); msg.setStringProperty(HCatConstants.HCAT_EVENT, hCatEventMessage.getEventType().toString()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_VERSION, messageFactory.getVersion()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_FORMAT, messageFactory.getMessageFormat()); " event: " + hCatEventMessage.getEventType() + " after retries: " + NUM_RETRIES, e);
Message msg = session.get().createTextMessage(hCatEventMessage.toString()); msg.setStringProperty(HCatConstants.HCAT_EVENT, hCatEventMessage.getEventType().toString()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_VERSION, messageFactory.getVersion()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_FORMAT, messageFactory.getMessageFormat()); " event: " + hCatEventMessage.getEventType() + " after retries: " + NUM_RETRIES, e);
/** * Class invariant. Checked after construction or deserialization. */ public HCatEventMessage checkValid() { if (getServer() == null || getServicePrincipal() == null) throw new IllegalStateException("Server-URL/Service-Principal shouldn't be null."); if (getEventType() == null) throw new IllegalStateException("Event-type unset."); if (getDB() == null) throw new IllegalArgumentException("DB-name unset."); return this; } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); } }
Message msg = session.get().createTextMessage(hCatEventMessage.toString()); msg.setStringProperty(HCatConstants.HCAT_EVENT, hCatEventMessage.getEventType().toString()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_VERSION, messageFactory.getVersion()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_FORMAT, messageFactory.getMessageFormat()); " event: " + hCatEventMessage.getEventType() + " after retries: " + NUM_RETRIES, e);
/** * Class invariant. Checked after construction or deserialization. */ public HCatEventMessage checkValid() { if (getServer() == null || getServicePrincipal() == null) throw new IllegalStateException("Server-URL/Service-Principal shouldn't be null."); if (getEventType() == null) throw new IllegalStateException("Event-type unset."); if (getDB() == null) throw new IllegalArgumentException("DB-name unset."); return this; } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); }
Message msg = session.get().createTextMessage(hCatEventMessage.toString()); msg.setStringProperty(HCatConstants.HCAT_EVENT, hCatEventMessage.getEventType().toString()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_VERSION, messageFactory.getVersion()); msg.setStringProperty(HCatConstants.HCAT_MESSAGE_FORMAT, messageFactory.getMessageFormat()); " event: " + hCatEventMessage.getEventType() + " after retries: " + NUM_RETRIES, e);
/** * Class invariant. Checked after construction or deserialization. */ public HCatEventMessage checkValid() { if (getServer() == null || getServicePrincipal() == null) { throw new IllegalStateException("Server-URL/Service-Principal shouldn't be null."); } if (getEventType() == null) { throw new IllegalStateException("Event-type unset."); } if (getDB() == null) { throw new IllegalArgumentException("DB-name unset."); } return this; } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); } }
/** * 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); } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); if (getKeyValues() == null) throw new IllegalStateException("Partition values unset"); return super.checkValid(); } }
/** * 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); } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); if (getPartitions() == null) throw new IllegalStateException("Partition-list unset."); return super.checkValid(); } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); if (getPartitions() == null) throw new IllegalStateException("Partition-list unset."); return super.checkValid(); } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); } }
@Override public HCatEventMessage checkValid() { if (getTable() == null) throw new IllegalStateException("Table name unset."); return super.checkValid(); } }