-
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.
Move classes from spark to async-query-core and async-query
Signed-off-by: Tomoyuki Morita <[email protected]>
- Loading branch information
Showing
219 changed files
with
265 additions
and
202 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
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions
13
async-query-core/src/main/java/org/opensearch/sql/asyncquery/Dummy.java
This file was deleted.
Oops, something went wrong.
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.
18 changes: 0 additions & 18 deletions
18
async-query-core/src/test/java/org/opensearch/sql/asyncquery/DummyTest.java
This file was deleted.
Oops, something went wrong.
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.
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.
24 changes: 24 additions & 0 deletions
24
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,24 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.utils; | ||
|
||
import com.google.common.base.Charsets; | ||
import com.google.common.io.Resources; | ||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.util.Objects; | ||
import lombok.SneakyThrows; | ||
import org.opensearch.action.admin.indices.create.CreateIndexRequest; | ||
import org.opensearch.client.Client; | ||
import org.opensearch.common.xcontent.XContentType; | ||
|
||
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
18 changes: 0 additions & 18 deletions
18
async-query/src/main/java/org/opensearch/sql/asyncquery/DummyConsumer.java
This file was deleted.
Oops, something went wrong.
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.
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.
28 changes: 0 additions & 28 deletions
28
async-query/src/test/java/org/opensearch/sql/asyncquery/DummyConsumerTest.java
This file was deleted.
Oops, something went wrong.
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
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.
17 changes: 17 additions & 0 deletions
17
async-query/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,17 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.constants; | ||
|
||
public class TestConstants { | ||
public static final String TEST_DATASOURCE_NAME = "test_datasource_name"; | ||
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 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 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.
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.
Oops, something went wrong.