public void RepartitionAs() { SetupTest((builder) => { builder .Stream <string, string>("topic") .Repartition(Repartitioned <string, string> .As("repartition-processor")) .To("output"); }); }
public void RepartitionCreateWithSerDes() { SetupTest((builder) => { builder .Stream <string, string>("topic") .Repartition(Repartitioned <string, string> .Create <StringSerDes, StringSerDes>()) .To("output"); }); }
public void RepartitionWithExplicitSerDes() { SetupTest((builder) => { builder .Stream <string, string>("topic") .Repartition(Repartitioned <string, string> .With(new StringSerDes(), new StringSerDes())) .To("output"); }); }
public void RepartitionWithPartitioner() { var records = SetupTest((builder) => { builder .Stream <string, string>("topic") .Repartition(Repartitioned <string, string> .Empty().WithStreamPartitioner((t, k, v) => 0)) .To("output"); }, TopologyTestDriver.Mode.ASYNC_CLUSTER_IN_MEMORY, 10); Assert.AreEqual(0, records.ToList()[0].Partition.Value); Assert.AreEqual(0, records.ToList()[1].Partition.Value); Assert.AreEqual(0, records.ToList()[2].Partition.Value); }
public void RepartitionWithPartitionNumber() { var records = SetupTest((builder) => { builder .Stream <string, string>("topic") .Repartition(Repartitioned <string, string> .Empty().WithNumberOfPartitions(20)) .To("output"); }, TopologyTestDriver.Mode.ASYNC_CLUSTER_IN_MEMORY); // topic - 1 partitions // repartitionTopic - 20 partitions // output - 1 partitions Assert.AreEqual(0, records.ToList()[0].Partition.Value); Assert.AreEqual(0, records.ToList()[1].Partition.Value); Assert.AreEqual(0, records.ToList()[2].Partition.Value); }