/** * Creates a StreamProcess if it doesn't exist already. Once the stream processor is created, it's started and then * described to know the result of the stream processor. */ public void process() { // Creates a stream processor if it doesn't already exist and start. try { final DescribeStreamProcessorResult result = describeStreamProcessor(); if (!result.getStatus().equals(StreamProcessorStatus.RUNNING.toString())) { startStreamProcessor(); } } catch (final ResourceNotFoundException e) { log.info("StreamProcessor with name : {} doesnt exist. Creating...", streamProcessorName); createStreamProcessor(); startStreamProcessor(); } // Describe the Stream Processor results to log the status. describeStreamProcessor(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getStreamProcessorArn() == null) ? 0 : getStreamProcessorArn().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastUpdateTimestamp() == null) ? 0 : getLastUpdateTimestamp().hashCode()); hashCode = prime * hashCode + ((getInput() == null) ? 0 : getInput().hashCode()); hashCode = prime * hashCode + ((getOutput() == null) ? 0 : getOutput().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getSettings() == null) ? 0 : getSettings().hashCode()); return hashCode; }
if (other.getStreamProcessorArn() != null && other.getStreamProcessorArn().equals(this.getStreamProcessorArn()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null)
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getStreamProcessorArn() == null) ? 0 : getStreamProcessorArn().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastUpdateTimestamp() == null) ? 0 : getLastUpdateTimestamp().hashCode()); hashCode = prime * hashCode + ((getInput() == null) ? 0 : getInput().hashCode()); hashCode = prime * hashCode + ((getOutput() == null) ? 0 : getOutput().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getSettings() == null) ? 0 : getSettings().hashCode()); return hashCode; }
&& other.getStreamProcessorArn().equals(this.getStreamProcessorArn()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null)
public DescribeStreamProcessorResult describeStreamProcessor() { final DescribeStreamProcessorResult describeStreamProcessorResult = rekognitionClient.describeStreamProcessor(new DescribeStreamProcessorRequest().withName(streamProcessorName)); log.info("Arn : {}", describeStreamProcessorResult.getStreamProcessorArn()); log.info("Input kinesisVideo stream : {} ", describeStreamProcessorResult.getInput().getKinesisVideoStream().getArn()); log.info("Output kinesisData stream {} ", describeStreamProcessorResult.getOutput().getKinesisDataStream().getArn()); log.info("RoleArn {} ", describeStreamProcessorResult.getRoleArn()); log.info("CollectionId {} ", describeStreamProcessorResult.getSettings().getFaceSearch().getCollectionId()); log.info("Status {} ", describeStreamProcessorResult.getStatus()); log.info("Status message {} ", describeStreamProcessorResult.getStatusMessage()); log.info("Creation timestamp {} ", describeStreamProcessorResult.getCreationTimestamp()); log.info("Last update timestamp {} ", describeStreamProcessorResult.getLastUpdateTimestamp()); return describeStreamProcessorResult; }