flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #2759: [FLINK-5020] Make the GenericWriteAheadSink rescal...
Date Mon, 07 Nov 2016 11:24:50 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2759#discussion_r86756773
  
    --- Diff: flink-streaming-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java
---
    @@ -318,6 +312,46 @@ protected void verifyResultsDataDiscardingUponRestore(
     		Assert.assertTrue("The following ID's were not found in the ResultSet: " + list.toString(),
list.isEmpty());
     	}
     
    +	@Override
    +	protected void verifyResultsWhenScalingDown(CassandraTupleWriteAheadSink<Tuple3<String,
Integer, Integer>> sink) throws Exception {
    +
    +		ArrayList<Integer> list = new ArrayList<>();
    +		for (int x = 1; x < 34; x++) {
    +			list.add(x);
    +		}
    +
    +		ResultSet result = session.execute(SELECT_DATA_QUERY);
    +		for (Row s : result) {
    +			list.remove(new Integer(s.getInt("counter")));
    +		}
    +		Assert.assertTrue(list.isEmpty());
    +	}
    +
    +	@Override
    +	protected void verifyResultsWhenScalingUp(
    +		CassandraTupleWriteAheadSink<Tuple3<String, Integer, Integer>> sink, int
startElementCounter, int endElementCounter) {
    +
    +		// IMPORTANT NOTE:
    +		//
    +		// for cassandra we always have to start from 1 because
    +		// all operators will share the same final db
    +
    +		ArrayList<Integer> list = new ArrayList<>();
    +		for (int i = 1; i <= endElementCounter; i++) {
    +			list.add(i);
    +		}
    +
    +		ArrayList<Integer> expected = new ArrayList<>();
    +		ResultSet result = session.execute(SELECT_DATA_QUERY);
    +		for (Row s : result) {
    +			expected.add(s.getInt("counter"));
    +		}
    +
    +		Collections.sort(expected);
    +
    +		Assert.assertArrayEquals(list.toArray(), expected.toArray());
    --- End diff --
    
    why does this test follow a different approach to testing than `verifyResultsWhenScalingDown`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message