-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tomoyuki Morita <[email protected]>
- Loading branch information
Showing
24 changed files
with
180 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.../src/main/java/org/opensearch/sql/spark/dispatcher/DatasourceEmbeddedQueryIdProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.dispatcher; | ||
|
||
import org.opensearch.sql.spark.asyncquery.model.AsyncQueryId; | ||
import org.opensearch.sql.spark.dispatcher.model.DispatchQueryRequest; | ||
|
||
/** Generates QueryId by embedding Datasource name and random UUID */ | ||
public class DatasourceEmbeddedQueryIdProvider implements QueryIdProvider { | ||
|
||
@Override | ||
public String getQueryId(DispatchQueryRequest dispatchQueryRequest) { | ||
return AsyncQueryId.newAsyncQueryId(dispatchQueryRequest.getDatasource()).getId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
spark/src/main/java/org/opensearch/sql/spark/dispatcher/QueryIdProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.dispatcher; | ||
|
||
import org.opensearch.sql.spark.dispatcher.model.DispatchQueryRequest; | ||
|
||
/** Interface for extension point to specify queryId. Called when new query is executed. */ | ||
public interface QueryIdProvider { | ||
String getQueryId(DispatchQueryRequest dispatchQueryRequest); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 3 additions & 24 deletions
27
spark/src/main/java/org/opensearch/sql/spark/dispatcher/model/DispatchQueryResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,16 @@ | ||
package org.opensearch.sql.spark.dispatcher.model; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.opensearch.sql.spark.asyncquery.model.AsyncQueryId; | ||
|
||
@Getter | ||
@Builder | ||
public class DispatchQueryResponse { | ||
private final AsyncQueryId queryId; | ||
private final String queryId; | ||
private final String jobId; | ||
private final String resultIndex; | ||
private final String sessionId; | ||
private final String datasourceName; | ||
private final JobType jobType; | ||
private final String indexName; | ||
|
||
public DispatchQueryResponse( | ||
AsyncQueryId queryId, String jobId, String resultIndex, String sessionId) { | ||
this(queryId, jobId, resultIndex, sessionId, null, JobType.INTERACTIVE, null); | ||
} | ||
|
||
public DispatchQueryResponse( | ||
AsyncQueryId queryId, | ||
String jobId, | ||
String resultIndex, | ||
String sessionId, | ||
String datasourceName, | ||
JobType jobType, | ||
String indexName) { | ||
this.queryId = queryId; | ||
this.jobId = jobId; | ||
this.resultIndex = resultIndex; | ||
this.sessionId = sessionId; | ||
this.datasourceName = datasourceName; | ||
this.jobType = jobType; | ||
this.indexName = indexName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.