Skip to content
Open
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 @@ -38,6 +38,18 @@ public enum Key {
PPL_JOIN_SUBSEARCH_MAXOUT("plugins.ppl.join.subsearch_maxout"),
PPL_REST_ALLOWED_ENDPOINTS("plugins.ppl.rest.allowed_endpoints"),

/** Maximum number of asynchronous PPL queries running concurrently on one node. */
PPL_ASYNC_NODE_CONCURRENT_RUNNING_QUERIES("plugins.ppl.async.node_concurrent_running_queries"),

/** Maximum number of asynchronous PPL jobs retained on one node. */
PPL_ASYNC_MAX_RETAINED_JOBS("plugins.ppl.async.max_retained_jobs"),

/** Maximum accepted submit wait-for-completion timeout. */
PPL_ASYNC_MAX_WAIT_FOR_COMPLETION_TIMEOUT("plugins.ppl.async.max_wait_for_completion_timeout"),

/** Maximum accepted asynchronous PPL job lease. */
PPL_ASYNC_MAX_KEEP_ALIVE("plugins.ppl.async.max_keep_alive"),

/** Enable Calcite as execution engine */
CALCITE_ENGINE_ENABLED("plugins.calcite.enabled"),
CALCITE_FALLBACK_ALLOWED("plugins.calcite.fallback.allowed"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.sql.executor;

import java.util.Optional;
import java.util.concurrent.CompletionStage;
import org.opensearch.sql.executor.ExecutionEngine.QueryResponse;

/**
* Lifecycle-facing handle for one asynchronous query execution.
*
* <p>The execution module owns result production and execution-specific resources. The lifecycle
* module owns this handle after submission and uses it to read the current result, observe terminal
* completion, and release those resources.
*
* <p>On successful completion, the authoritative final result must be visible through {@link
* #currentResult()} before {@link #completion()} completes normally. Implementations must make
* {@link #close()} idempotent and safe to call concurrently with {@link #currentResult()}.
*/
public interface AsyncQueryExecution extends AutoCloseable {

/** Returns the complete result currently visible, or empty before a result is available. */
Optional<QueryResponse> currentResult();

/** Completes normally on query success and exceptionally on query failure. */
CompletionStage<Void> completion();

/** Releases execution-owned result resources. */
@Override
void close();
}
Loading
Loading