Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements w.r.t #928 & Releasing a newer version #932

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ public class EventProducer implements DatastreamEventProducer {
* @param customCheckpointing decides whether producer should use custom checkpointing or the datastream server
* provided checkpointing.
*/
public EventProducer(DatastreamTask task, TransportProvider transportProvider, CheckpointProvider checkpointProvider,
Properties config, boolean customCheckpointing) {
this(task, transportProvider, checkpointProvider, config, customCheckpointing, (t) -> Collections.emptySet());
}

/**
* Construct an EventProducer instance.
* @param transportProvider the transport provider
* @param checkpointProvider the checkpoint provider
* @param config the config options
* @param customCheckpointing decides whether producer should use custom checkpointing or the datastream server
* provided checkpointing.
* @param throughputViolatingTopicsProvider function parameter per task to find the throughput violating topics
*/
public EventProducer(DatastreamTask task, TransportProvider transportProvider, CheckpointProvider checkpointProvider,
Properties config, boolean customCheckpointing,
Function<DatastreamTask, Set<String>> throughputViolatingTopicsProvider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.lang.reflect.Field;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;

Expand Down Expand Up @@ -71,8 +70,8 @@ public void send(String destination, DatastreamProducerRecord record, SendCallba
}
};

EventProducer eventProducer = new EventProducer(task, transport,
new NoOpCheckpointProvider(), new Properties(), false, (t) -> new HashSet<>());
EventProducer eventProducer =
new EventProducer(task, transport, new NoOpCheckpointProvider(), new Properties(), false);

int eventCount = 5;
for (int i = 0; i < eventCount; i++) {
Expand Down Expand Up @@ -122,8 +121,8 @@ public void send(String destination, DatastreamProducerRecord record, SendCallba
}
};

EventProducer eventProducer = new EventProducer(task, transport,
new NoOpCheckpointProvider(), new Properties(), false, (t) -> new HashSet<>());
EventProducer eventProducer =
new EventProducer(task, transport, new NoOpCheckpointProvider(), new Properties(), false);

int eventCount = 5;
for (int i = 0; i < eventCount; i++) {
Expand All @@ -143,8 +142,7 @@ public void testPerDatastreamMetrics() {

Properties props = new Properties();
props.put(EventProducer.CONFIG_ENABLE_PER_TOPIC_METRICS, Boolean.FALSE.toString());
EventProducer eventProducer =
new EventProducer(task, transport, new NoOpCheckpointProvider(), props, false, (t) -> new HashSet<>());
EventProducer eventProducer = new EventProducer(task, transport, new NoOpCheckpointProvider(), props, false);

eventProducer.send(createDatastreamProducerRecord(), (m, e) -> {
});
Expand Down
2 changes: 1 addition & 1 deletion gradle/maven.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
allprojects {
version = "5.2.8-SNAPSHOT"
version = "5.3.0-SNAPSHOT"
}

subprojects {
Expand Down