Java Code Examples for com.amazonaws.services.kinesis.clientlibrary.types.UserRecord#deaggregate()

The following examples show how to use com.amazonaws.services.kinesis.clientlibrary.types.UserRecord#deaggregate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShardConsumer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
protected static List<UserRecord> deaggregateRecords(List<Record> records, String startingHashKey, String endingHashKey) {
	return UserRecord.deaggregate(records, new BigInteger(startingHashKey), new BigInteger(endingHashKey));
}
 
Example 2
Source File: ShardConsumer.java    From flink with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
protected static List<UserRecord> deaggregateRecords(List<Record> records, String startingHashKey, String endingHashKey) {
	return UserRecord.deaggregate(records, new BigInteger(startingHashKey), new BigInteger(endingHashKey));
}
 
Example 3
Source File: ShardConsumer.java    From flink with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
protected static List<UserRecord> deaggregateRecords(List<Record> records, String startingHashKey, String endingHashKey) {
	return UserRecord.deaggregate(records, new BigInteger(startingHashKey), new BigInteger(endingHashKey));
}
 
Example 4
Source File: RecordDeaggregator.java    From kinesis-aggregation with Apache License 2.0 3 votes vote down vote up
/**
 * Method to process a set of Kinesis user records from a Stream of Kinesis
 * Event Records using the Java 8 Streams API
 * 
 * @param inputStream    The Kinesis Records provided by AWS Lambda or the
 *                       Kinesis SDK
 * @param streamConsumer Instance implementing the Consumer interface to process
 *                       the deaggregated UserRecords
 * @return Void
 */
public Void stream(Stream<T> inputStream, Consumer<UserRecord> streamConsumer) {
	// deaggregate UserRecords from the Kinesis Records

	List<T> streamList = inputStream.collect(Collectors.toList());
	List<UserRecord> deaggregatedRecords = UserRecord.deaggregate(convertType(streamList));
	deaggregatedRecords.stream().forEachOrdered(streamConsumer);

	return null;
}
 
Example 5
Source File: RecordDeaggregator.java    From kinesis-aggregation with Apache License 2.0 2 votes vote down vote up
/**
 * Method to deaggregate a single Kinesis record into a List of UserRecords
 * 
 * @param inputRecord The Kinesis Record provided by AWS Lambda or Kinesis SDK
 * @return A list of Kinesis UserRecord objects obtained by deaggregating the
 *         input list of KinesisEventRecords
 */
public List<UserRecord> deaggregate(T inputRecord) {
	return UserRecord.deaggregate(convertType(Arrays.asList(inputRecord)));
}