-
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.
[Feature] Flint query scheduler part1 - integrate job scheduler plugin
Signed-off-by: Louis Chu <[email protected]>
- Loading branch information
Showing
23 changed files
with
955 additions
and
35 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
16 changes: 16 additions & 0 deletions
16
async-query-core/src/main/java/org/opensearch/sql/spark/scheduler/AsyncQueryScheduler.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,16 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.scheduler; | ||
|
||
public interface AsyncQueryScheduler { | ||
void scheduleJob(AsyncQuerySchedulerJobRequest request); | ||
|
||
void unscheduleJob(AsyncQuerySchedulerJobRequest request); | ||
|
||
void removeJob(AsyncQuerySchedulerJobRequest request); | ||
|
||
void updateJob(AsyncQuerySchedulerJobRequest request); | ||
} |
8 changes: 8 additions & 0 deletions
8
...c-query-core/src/main/java/org/opensearch/sql/spark/scheduler/AsyncQuerySchedulerJob.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,8 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.scheduler; | ||
|
||
public interface AsyncQuerySchedulerJob {} |
79 changes: 79 additions & 0 deletions
79
...-core/src/main/java/org/opensearch/sql/spark/scheduler/AsyncQuerySchedulerJobRequest.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,79 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.scheduler; | ||
|
||
public abstract class AsyncQuerySchedulerJobRequest { | ||
private final String id; | ||
private final String jobName; | ||
private final String jobType; | ||
private final String schedule; | ||
private final boolean enabled; | ||
|
||
protected AsyncQuerySchedulerJobRequest(Builder<?> builder) { | ||
this.id = builder.id; | ||
this.jobName = builder.jobName; | ||
this.jobType = builder.jobType; | ||
this.schedule = builder.schedule; | ||
this.enabled = builder.enabled; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getJobName() { | ||
return jobName; | ||
} | ||
|
||
public String getJobType() { | ||
return jobType; | ||
} | ||
|
||
public String getRawSchedule() { | ||
return schedule; | ||
} | ||
|
||
public boolean isEnabled() { | ||
return enabled; | ||
} | ||
|
||
public abstract static class Builder<T extends Builder<T>> { | ||
private String id; | ||
private String jobName; | ||
private String jobType; | ||
private String schedule; | ||
private boolean enabled; | ||
|
||
public T withId(String id) { | ||
this.id = id; | ||
return self(); | ||
} | ||
|
||
public T withJobName(String jobName) { | ||
this.jobName = jobName; | ||
return self(); | ||
} | ||
|
||
public T withJobType(String jobType) { | ||
this.jobType = jobType; | ||
return self(); | ||
} | ||
|
||
public T withSchedule(String schedule) { | ||
this.schedule = schedule; | ||
return self(); | ||
} | ||
|
||
public T withEnabled(boolean enabled) { | ||
this.enabled = enabled; | ||
return self(); | ||
} | ||
|
||
protected abstract T self(); | ||
|
||
public abstract AsyncQuerySchedulerJobRequest build(); | ||
} | ||
} |
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.