-
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.
[Backport 2.x] Move classes from spark to async-query-core and async-…
…query (#2737) (#2750) * Move classes from spark to async-query-core and async-query Signed-off-by: Tomoyuki Morita <[email protected]> (cherry picked from commit d5c2fed) * Fix build.gradle Signed-off-by: Tomoyuki Morita <[email protected]> (cherry picked from commit 61091c1) * Adjust build.gradle Signed-off-by: Tomoyuki Morita <[email protected]> (cherry picked from commit ebb07ef) * Fix copyrights Signed-off-by: Tomoyuki Morita <[email protected]> (cherry picked from commit 084a3c8)
- Loading branch information
Showing
214 changed files
with
277 additions
and
170 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
async-query-core/src/test/java/org/opensearch/sql/spark/constants/TestConstants.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,23 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.constants; | ||
|
||
public class TestConstants { | ||
public static final String QUERY = "select 1"; | ||
public static final String EMR_JOB_ID = "job-123xxx"; | ||
public static final String EMRS_APPLICATION_ID = "app-xxxxx"; | ||
public static final String EMRS_EXECUTION_ROLE = "execution_role"; | ||
public static final String EMRS_JOB_NAME = "job_name"; | ||
public static final String SPARK_SUBMIT_PARAMETERS = "--conf org.flint.sql.SQLJob"; | ||
public static final String TEST_CLUSTER_NAME = "TEST_CLUSTER"; | ||
public static final String MOCK_SESSION_ID = "s-0123456"; | ||
public static final String MOCK_STATEMENT_ID = "st-0123456"; | ||
public static final String ENTRY_POINT_START_JAR = | ||
"file:///home/hadoop/.ivy2/jars/org.opensearch_opensearch-spark-sql-application_2.12-0.3.0-SNAPSHOT.jar"; | ||
public static final String DEFAULT_RESULT_INDEX = "query_execution_result_ds1"; | ||
public static final String US_EAST_REGION = "us-east-1"; | ||
public static final String US_WEST_REGION = "us-west-1"; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
...est/java/org/opensearch/sql/spark/leasemanager/ConcurrencyLimitExceededExceptionTest.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,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.leasemanager; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class ConcurrencyLimitExceededExceptionTest { | ||
@Test | ||
public void test() { | ||
ConcurrencyLimitExceededException e = new ConcurrencyLimitExceededException("Test"); | ||
|
||
assertEquals("Test", e.getMessage()); | ||
} | ||
} |
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
async-query-core/src/test/java/org/opensearch/sql/spark/utils/IDUtilsTest.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,33 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.utils; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class IDUtilsTest { | ||
public static final String DATASOURCE_NAME = "DATASOURCE_NAME"; | ||
|
||
@Test | ||
public void encodeAndDecode() { | ||
String id = IDUtils.encode(DATASOURCE_NAME); | ||
String decoded = IDUtils.decode(id); | ||
|
||
assertTrue(id.length() > IDUtils.PREFIX_LEN); | ||
assertEquals(DATASOURCE_NAME, decoded); | ||
} | ||
|
||
@Test | ||
public void generateUniqueIds() { | ||
String id1 = IDUtils.encode(DATASOURCE_NAME); | ||
String id2 = IDUtils.encode(DATASOURCE_NAME); | ||
|
||
assertNotEquals(id1, id2); | ||
} | ||
} |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
async-query-core/src/test/java/org/opensearch/sql/spark/utils/RealTimeProviderTest.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,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.utils; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class RealTimeProviderTest { | ||
@Test | ||
public void testCurrentEpochMillis() { | ||
RealTimeProvider realTimeProvider = new RealTimeProvider(); | ||
|
||
assertTrue(realTimeProvider.currentEpochMillis() > 0); | ||
} | ||
} |
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
async-query-core/src/test/java/org/opensearch/sql/spark/utils/TestUtils.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,17 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.utils; | ||
|
||
import java.io.IOException; | ||
import java.util.Objects; | ||
|
||
public class TestUtils { | ||
public static String getJson(String filename) throws IOException { | ||
ClassLoader classLoader = TestUtils.class.getClassLoader(); | ||
return new String( | ||
Objects.requireNonNull(classLoader.getResourceAsStream(filename)).readAllBytes()); | ||
} | ||
} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
async-query-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
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 @@ | ||
mock-maker-inline |
12 changes: 12 additions & 0 deletions
12
async-query-core/src/test/resources/select_query_response.json
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,12 @@ | ||
{ | ||
"data": { | ||
"result": [ | ||
"{'1':1}" | ||
], | ||
"schema": [ | ||
"{'column_name':'1','data_type':'integer'}" | ||
], | ||
"stepId": "s-123456789", | ||
"applicationId": "application-abc" | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...enSearchSparkSubmitParameterModifier.java → ...enSearchSparkSubmitParameterModifier.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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...arkExecutionEngineConfigSupplierImpl.java → ...arkExecutionEngineConfigSupplierImpl.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions
6
...t/TransportGetAsyncQueryResultAction.java → ...t/TransportGetAsyncQueryResultAction.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
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions
6
.../model/CancelAsyncQueryActionRequest.java → .../model/CancelAsyncQueryActionRequest.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
6 changes: 2 additions & 4 deletions
6
...model/CancelAsyncQueryActionResponse.java → ...model/CancelAsyncQueryActionResponse.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
6 changes: 2 additions & 4 deletions
6
.../model/CreateAsyncQueryActionRequest.java → .../model/CreateAsyncQueryActionRequest.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
6 changes: 2 additions & 4 deletions
6
...model/CreateAsyncQueryActionResponse.java → ...model/CreateAsyncQueryActionResponse.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
6 changes: 2 additions & 4 deletions
6
...del/GetAsyncQueryResultActionRequest.java → ...del/GetAsyncQueryResultActionRequest.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
6 changes: 2 additions & 4 deletions
6
...el/GetAsyncQueryResultActionResponse.java → ...el/GetAsyncQueryResultActionResponse.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...k/asyncquery/IndexQuerySpecAlterTest.java → ...k/asyncquery/IndexQuerySpecAlterTest.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...xecutionEngineConfigSupplierImplTest.java → ...xecutionEngineConfigSupplierImplTest.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
Oops, something went wrong.