flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/model/KinesisStreamShard.java
/**
	 * Utility function to convert {@link KinesisStreamShard} into the new {@link StreamShardMetadata} model.
	 *
	 * @param kinesisStreamShard the {@link KinesisStreamShard} to be converted
	 * @return the converted {@link StreamShardMetadata}
	 */
Utility function to convert  KinesisStreamShard into the new  StreamShardMetadata model.
@param kinesisStreamShard the  KinesisStreamShard to be converted
@return the converted  StreamShardMetadata
Utility function to convert KinesisStreamShard into the new StreamShardMetadata model . @param kinesisStreamShard the KinesisStreamShard to be converted @return the converted StreamShardMetadata
public static StreamShardMetadata convertToStreamShardMetadata(KinesisStreamShard kinesisStreamShard) {
		StreamShardMetadata streamShardMetadata = new StreamShardMetadata();
		streamShardMetadata.setStreamName(kinesisStreamShard.getStreamName());
		streamShardMetadata.setShardId(kinesisStreamShard.getShard().getShardId());
		streamShardMetadata.setParentShardId(kinesisStreamShard.getShard().getParentShardId());
		streamShardMetadata.setAdjacentParentShardId(kinesisStreamShard.getShard().getAdjacentParentShardId());
		if (kinesisStreamShard.getShard().getHashKeyRange() != null) {
			streamShardMetadata.setStartingHashKey(kinesisStreamShard.getShard().getHashKeyRange().getStartingHashKey());
			streamShardMetadata.setEndingHashKey(kinesisStreamShard.getShard().getHashKeyRange().getEndingHashKey());
		}
		if (kinesisStreamShard.getShard().getSequenceNumberRange() != null) {
			streamShardMetadata.setStartingSequenceNumber(kinesisStreamShard.getShard().getSequenceNumberRange().getStartingSequenceNumber());
			streamShardMetadata.setEndingSequenceNumber(kinesisStreamShard.getShard().getSequenceNumberRange().getEndingSequenceNumber());
		}
		return streamShardMetadata;
	}
public static StreamShardMetadata convertToStreamShardMetadata ( KinesisStreamShard kinesisStreamShard ) { StreamShardMetadata streamShardMetadata = new StreamShardMetadata ( ) ; streamShardMetadata . setStreamName ( kinesisStreamShard . getStreamName ( ) ) ; streamShardMetadata . setShardId ( kinesisStreamShard . getShard ( ) . getShardId ( ) ) ; streamShardMetadata . setParentShardId ( kinesisStreamShard . getShard ( ) . getParentShardId ( ) ) ; streamShardMetadata . setAdjacentParentShardId ( kinesisStreamShard . getShard ( ) . getAdjacentParentShardId ( ) ) ; if ( kinesisStreamShard . getShard ( ) . getHashKeyRange ( ) != null ) { streamShardMetadata . setStartingHashKey ( kinesisStreamShard . getShard ( ) . getHashKeyRange ( ) . getStartingHashKey ( ) ) ; streamShardMetadata . setEndingHashKey ( kinesisStreamShard . getShard ( ) . getHashKeyRange ( ) . getEndingHashKey ( ) ) ; } if ( kinesisStreamShard . getShard ( ) . getSequenceNumberRange ( ) != null ) { streamShardMetadata . setStartingSequenceNumber ( kinesisStreamShard . getShard ( ) . getSequenceNumberRange ( ) . getStartingSequenceNumber ( ) ) ; streamShardMetadata . setEndingSequenceNumber ( kinesisStreamShard . getShard ( ) . getSequenceNumberRange ( ) . getEndingSequenceNumber ( ) ) ; } return streamShardMetadata ; }
Utility function to convert {@link KinesisStreamShard} into the new {@link StreamShardMetadata} model.
Utility function to convert { @link KinesisStreamShard } into the new { @link StreamShardMetadata } model .