Skip to content

Commit

Permalink
removing listeners from ksql engine:
Browse files Browse the repository at this point in the history
  • Loading branch information
lct45 committed Aug 24, 2021
1 parent f196cbf commit ed287ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public void setUp() throws IOException {
a -> new MetricName(a.getArgument(0), a.getArgument(1), "", a.getArgument(2)));
when(metrics.metricName(any(), any())).thenAnswer(
a -> new MetricName(a.getArgument(0), a.getArgument(1), "", Collections.emptyMap()));
final File f = new File("/tmp/cat/");
final File f = new File("/tmp/storage-test/");
f.getParentFile().mkdirs();
f.createNewFile();
listener.configure(ImmutableMap.of("state.dir", "/tmp/cat/"));
listener.configure(ImmutableMap.of("state.dir", "/tmp/storage-test/"));
}

@After
Expand Down Expand Up @@ -95,7 +95,7 @@ public void shouldOnlyAddNodeMetricsOnce() {
// Given:

// When:
listener.configure(ImmutableMap.of("state.dir", "/tmp/cat/"));
listener.configure(ImmutableMap.of("state.dir", "/tmp//"));

// Then:
// did not throw error for duplicate metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -135,7 +134,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
Expand Down Expand Up @@ -702,20 +700,14 @@ static KsqlRestApplication buildApplication(
final SpecificQueryIdGenerator specificQueryIdGenerator =
new SpecificQueryIdGenerator();

final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1,
new ThreadFactoryBuilder()
.setNameFormat("ksql-csu-metrics-reporter-%d")
.build()
);

final KsqlEngine ksqlEngine = new KsqlEngine(
serviceContext,
processingLogContext,
functionRegistry,
ServiceInfo.create(ksqlConfig, metricsPrefix),
specificQueryIdGenerator,
new KsqlConfig(restConfig.getKsqlConfigProperties()),
new ArrayList<>()
Collections.emptyList()
);

UserFunctionLoader.newInstance(ksqlConfig, functionRegistry, ksqlInstallDir).load();
Expand Down

0 comments on commit ed287ab

Please sign in to comment.