Java Code Examples for org.apache.flink.shaded.guava18.com.google.common.collect.Iterables#size()

The following examples show how to use org.apache.flink.shaded.guava18.com.google.common.collect.Iterables#size() . 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: IntervalJoinOperatorTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private void assertOutput(
	Iterable<StreamRecord<Tuple2<TestElem, TestElem>>> expectedOutput,
	Queue<Object> actualOutput) {

	int actualSize = actualOutput.stream()
		.filter(elem -> elem instanceof StreamRecord)
		.collect(Collectors.toList())
		.size();

	int expectedSize = Iterables.size(expectedOutput);

	Assert.assertEquals(
		"Expected and actual size of stream records different",
		expectedSize,
		actualSize
	);

	for (StreamRecord<Tuple2<TestElem, TestElem>> record : expectedOutput) {
		Assert.assertTrue(actualOutput.contains(record));
	}
}
 
Example 2
Source File: IntervalJoinOperatorTest.java    From flink with Apache License 2.0 6 votes vote down vote up
private void assertOutput(
	Iterable<StreamRecord<Tuple2<TestElem, TestElem>>> expectedOutput,
	Queue<Object> actualOutput) {

	int actualSize = actualOutput.stream()
		.filter(elem -> elem instanceof StreamRecord)
		.collect(Collectors.toList())
		.size();

	int expectedSize = Iterables.size(expectedOutput);

	Assert.assertEquals(
		"Expected and actual size of stream records different",
		expectedSize,
		actualSize
	);

	for (StreamRecord<Tuple2<TestElem, TestElem>> record : expectedOutput) {
		Assert.assertTrue(actualOutput.contains(record));
	}
}
 
Example 3
Source File: IntervalJoinOperatorTest.java    From flink with Apache License 2.0 6 votes vote down vote up
private void assertOutput(
	Iterable<StreamRecord<Tuple2<TestElem, TestElem>>> expectedOutput,
	Queue<Object> actualOutput) {

	int actualSize = actualOutput.stream()
		.filter(elem -> elem instanceof StreamRecord)
		.collect(Collectors.toList())
		.size();

	int expectedSize = Iterables.size(expectedOutput);

	Assert.assertEquals(
		"Expected and actual size of stream records different",
		expectedSize,
		actualSize
	);

	for (StreamRecord<Tuple2<TestElem, TestElem>> record : expectedOutput) {
		Assert.assertTrue(actualOutput.contains(record));
	}
}
 
Example 4
Source File: SharedBuffer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public int getEventsBufferSize() throws Exception {
	return Iterables.size(eventsBuffer.entries());
}
 
Example 5
Source File: SharedBuffer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public int getSharedBufferNodeSize() throws Exception {
	return Iterables.size(entries.entries());
}
 
Example 6
Source File: QsStateProducer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void flatMap(Email value, Collector<Object> out) throws Exception {
	state.put(value.getEmailId(), new EmailInformation(value));
	count = Iterables.size(state.keys());
}
 
Example 7
Source File: IntervalJoinOperatorTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private void assertEmpty(MapState<Long, ?> state) throws Exception {
	boolean stateIsEmpty = Iterables.size(state.keys()) == 0;
	Assert.assertTrue("state not empty", stateIsEmpty);
}
 
Example 8
Source File: SharedBuffer.java    From flink with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public int getEventsBufferSize() throws Exception {
	return Iterables.size(eventsBuffer.entries());
}
 
Example 9
Source File: SharedBuffer.java    From flink with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public int getSharedBufferNodeSize() throws Exception {
	return Iterables.size(entries.entries());
}
 
Example 10
Source File: QsStateProducer.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void flatMap(Email value, Collector<Object> out) throws Exception {
	state.put(value.getEmailId(), new EmailInformation(value));
	count = Iterables.size(state.keys());
}
 
Example 11
Source File: IntervalJoinOperatorTest.java    From flink with Apache License 2.0 4 votes vote down vote up
private void assertEmpty(MapState<Long, ?> state) throws Exception {
	boolean stateIsEmpty = Iterables.size(state.keys()) == 0;
	Assert.assertTrue("state not empty", stateIsEmpty);
}
 
Example 12
Source File: SharedBuffer.java    From flink with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public int getEventsBufferSize() throws Exception {
	return Iterables.size(eventsBuffer.entries());
}
 
Example 13
Source File: SharedBuffer.java    From flink with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public int getSharedBufferNodeSize() throws Exception {
	return Iterables.size(entries.entries());
}
 
Example 14
Source File: QsStateProducer.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void flatMap(Email value, Collector<Object> out) throws Exception {
	state.put(value.getEmailId(), new EmailInformation(value));
	count = Iterables.size(state.keys());
}
 
Example 15
Source File: IntervalJoinOperatorTest.java    From flink with Apache License 2.0 4 votes vote down vote up
private void assertEmpty(MapState<Long, ?> state) throws Exception {
	boolean stateIsEmpty = Iterables.size(state.keys()) == 0;
	Assert.assertTrue("state not empty", stateIsEmpty);
}