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

IGNITE-23736 Sql. Provide ability to catch start/finish events for query #4977

Merged
merged 18 commits into from
Jan 10, 2025
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 @@ -28,7 +28,9 @@ public enum IgniteEventType {
USER_AUTHENTICATION_SUCCESS,
USER_AUTHENTICATION_FAILURE,
CLIENT_CONNECTION_ESTABLISHED,
CLIENT_CONNECTION_CLOSED;
CLIENT_CONNECTION_CLOSED,
QUERY_STARTED,
QUERY_FINISHED;

static {
// Without the following line, the IgniteEventType enum will not be registered in the EventTypeRegistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public final class IgniteEvents implements EventFactory {

public static final IgniteEvents CLIENT_CONNECTION_ESTABLISHED = new IgniteEvents(IgniteEventType.CLIENT_CONNECTION_ESTABLISHED);
public static final IgniteEvents CLIENT_CONNECTION_CLOSED = new IgniteEvents(IgniteEventType.CLIENT_CONNECTION_CLOSED);
public static final IgniteEvents QUERY_STARTED = new IgniteEvents(IgniteEventType.QUERY_STARTED);
public static final IgniteEvents QUERY_FINISHED = new IgniteEvents(IgniteEventType.QUERY_FINISHED);

private final IgniteEventType type;

Expand Down
1 change: 1 addition & 0 deletions modules/runner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ dependencies {
integrationTestImplementation project(':ignite-configuration-root')
integrationTestImplementation project(':ignite-configuration-system')
integrationTestImplementation project(':ignite-system-disaster-recovery')
integrationTestImplementation project(':ignite-eventlog')
integrationTestImplementation testFixtures(project(":ignite-api"))
integrationTestImplementation testFixtures(project(':ignite-core'))
integrationTestImplementation testFixtures(project(':ignite-configuration'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
import org.apache.ignite.internal.disaster.system.ClusterIdService;
import org.apache.ignite.internal.disaster.system.SystemDisasterRecoveryStorage;
import org.apache.ignite.internal.distributionzones.DistributionZoneManager;
import org.apache.ignite.internal.eventlog.api.Event;
import org.apache.ignite.internal.eventlog.api.EventLog;
import org.apache.ignite.internal.failure.NoOpFailureManager;
import org.apache.ignite.internal.hlc.ClockService;
import org.apache.ignite.internal.hlc.ClockServiceImpl;
Expand Down Expand Up @@ -772,6 +774,18 @@ public CompletableFuture<Set<String>> dataNodes(long causalityToken, int catalog
lowWatermark
);

EventLog noopEventLog = new EventLog() {
@Override
public void log(Event event) {
// No-op.
}

@Override
public void log(String type, Supplier<Event> eventProvider) {
// No-op.
}
};

SqlQueryProcessor qryEngine = new SqlQueryProcessor(
clusterSvc,
logicalTopologyService,
Expand All @@ -793,7 +807,8 @@ public CompletableFuture<Set<String>> dataNodes(long causalityToken, int catalog
txManager,
lowWatermark,
threadPoolsManager.commonScheduler(),
new KillCommandHandler(name, logicalTopologyService, clusterSvc.messagingService())
new KillCommandHandler(name, logicalTopologyService, clusterSvc.messagingService()),
noopEventLog
);

sqlRef.set(new IgniteSqlImpl(qryEngine, HybridTimestampTracker.atomicTracker(null)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,8 @@ public class IgniteImpl implements Ignite {
txManager,
lowWatermark,
threadPoolsManager.commonScheduler(),
killCommandHandler
killCommandHandler,
eventLog
);

systemViewManager.register(qryEngine);
Expand Down
4 changes: 4 additions & 0 deletions modules/sql-engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dependencies {
implementation project(':ignite-partition-distribution')
implementation project(':ignite-low-watermark')
implementation project(':ignite-sql-engine-api')
implementation project(':ignite-eventlog')
implementation libs.jetbrains.annotations
implementation libs.fastutil.core
implementation libs.caffeine
Expand Down Expand Up @@ -133,6 +134,7 @@ dependencies {
integrationTestImplementation project(':ignite-metrics')
integrationTestImplementation project(":ignite-network-api")
integrationTestImplementation project(':ignite-sql-engine-api')
integrationTestImplementation project(':ignite-eventlog')
integrationTestImplementation testFixtures(project(':ignite-core'))
integrationTestImplementation testFixtures(project(':ignite-schema'))
integrationTestImplementation testFixtures(project(':ignite-sql-engine'))
Expand Down Expand Up @@ -162,4 +164,6 @@ integrationTest {
it.excludeTags "sqllogic"
}
}

systemProperty "buildDirPath", project.buildDir.path
}
Loading