-
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: Vamsi Manohar <[email protected]>
- Loading branch information
Showing
10 changed files
with
455 additions
and
182 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
37 changes: 37 additions & 0 deletions
37
spark/src/main/java/org/opensearch/sql/spark/dispatcher/model/JobType.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,37 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.dispatcher.model; | ||
|
||
public enum JobType { | ||
INTERACTIVE("interactive"), | ||
STREAMING("streaming"), | ||
BATCH("batch"); | ||
|
||
private String text; | ||
|
||
JobType(String text) { | ||
this.text = text; | ||
} | ||
|
||
public String getText() { | ||
return this.text; | ||
} | ||
|
||
/** | ||
* Get JobType from text. | ||
* | ||
* @param text text. | ||
* @return JobType {@link JobType}. | ||
*/ | ||
public static JobType fromString(String text) { | ||
for (JobType JobType : JobType.values()) { | ||
if (JobType.text.equalsIgnoreCase(text)) { | ||
return JobType; | ||
} | ||
} | ||
throw new IllegalArgumentException("No JobType with text " + text + " found"); | ||
} | ||
} |
Oops, something went wrong.