java/KinesisAggregator/src/main/java/com/amazonaws/kinesis/agg/RecordAggregator.java [200:227]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public AggRecord addUserRecord(String partitionKey, String explicitHashKey, byte[] data) throws Exception {
		boolean success = this.currentRecord.addUserRecord(partitionKey, explicitHashKey, data);

		if (success) {
			// we were able to add the current data to the in-flight record
			return null;
		} else {
			// this record is full, let all the listeners know
			final AggRecord completeRecord = this.currentRecord;
			for (ListenerExecutorPair pair : this.listeners) {
				pair.getExecutor().execute(() -> {
					pair.getListener().recordComplete(completeRecord);
				});
			}

			// current record is full; clear it out, make a new empty one and
			// add the new user record
			clearRecord();
			success = this.currentRecord.addUserRecord(partitionKey, explicitHashKey, data);

			if (!success) {
				throw new Exception(String.format("Unable to add User Record %s, %s with data length %s", partitionKey,
						explicitHashKey, data.length));
			}

			return completeRecord;
		}
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/KinesisAggregatorV2/src/main/java/com/amazonaws/kinesis/agg/RecordAggregator.java [191:218]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public AggRecord addUserRecord(String partitionKey, String explicitHashKey, byte[] data) throws Exception {
		boolean success = this.currentRecord.addUserRecord(partitionKey, explicitHashKey, data);

		if (success) {
			// we were able to add the current data to the in-flight record
			return null;
		} else {
			// this record is full, let all the listeners know
			final AggRecord completeRecord = this.currentRecord;
			for (ListenerExecutorPair pair : this.listeners) {
				pair.getExecutor().execute(() -> {
					pair.getListener().recordComplete(completeRecord);
				});
			}

			// current record is full; clear it out, make a new empty one and
			// add the new user record
			clearRecord();
			success = this.currentRecord.addUserRecord(partitionKey, explicitHashKey, data);

			if (!success) {
				throw new Exception(String.format("Unable to add User Record %s, %s with data length %s", partitionKey,
						explicitHashKey, data.length));
			}

			return completeRecord;
		}
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



