You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/12/08 08:53:02 UTC

[GitHub] yanghua commented on a change in pull request #7262: [FLINK-10478] Kafka Producer wrongly formats % for transaction ID

yanghua commented on a change in pull request #7262: [FLINK-10478] Kafka Producer wrongly formats % for transaction ID
URL: https://github.com/apache/flink/pull/7262#discussion_r239998555
 
 

 ##########
 File path: flink-connectors/flink-connector-kafka-0.11/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/TransactionalIdsGeneratorTest.java
 ##########
 @@ -45,6 +45,24 @@ public void testGenerateIdsToUse() {
 			generator.generateIdsToUse(36));
 	}
 
+	@Test
+	public void testGenerateIdsWithPercentageToUse() {
+		TransactionalIdsGenerator generator = new TransactionalIdsGenerator("test%", 2, SUBTASKS_COUNT, POOL_SIZE, SAFE_SCALE_DOWN_FACTOR);
+
+		assertEquals(
+			new HashSet<>(Arrays.asList("test%-42", "test%-43", "test%-44")),
+			generator.generateIdsToUse(36));
+	}
+
+	@Test
+	public void testGenerateIdsWithMultiplePercentageToUse() {
+		TransactionalIdsGenerator generator = new TransactionalIdsGenerator("test%%", 2, SUBTASKS_COUNT, POOL_SIZE, SAFE_SCALE_DOWN_FACTOR);
 
 Review comment:
   ditto

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services