Skip to content

Commit

Permalink
Rename module and package from MemSQL to SingleStore
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr authored and hashhar committed Mar 16, 2022
1 parent 784d3d1 commit b1337f8
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 97 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ jobs:
!:trino-jdbc,!:trino-base-jdbc,!:trino-thrift,!:trino-memory,
!:trino-docs,!:trino-server,!:trino-server-rpm,
!:trino-test-jdbc-compatibility-old-server,
!:trino-memsql,
!:trino-singlestore,
!:trino-bigquery'
- name: Upload test results
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -396,7 +396,7 @@ jobs:
- { modules: plugin/trino-mysql }
- { modules: plugin/trino-postgresql }
- { modules: plugin/trino-sqlserver }
- { modules: plugin/trino-memsql }
- { modules: plugin/trino-singlestore }
- { modules: plugin/trino-oracle }
# TODO: re-enable kudu tests after this issue is resolved: https://github.com/trinodb/trino/issues/11203
# - { modules: plugin/trino-kudu }
Expand Down Expand Up @@ -434,14 +434,14 @@ jobs:
run: echo "::add-matcher::.github/problem-matcher.json"
- name: Cleanup node
# This is required as a virtual environment update 20210219.1 left too little space for MemSQL to work
if: matrix.modules == 'plugin/trino-memsql'
if: matrix.modules == 'plugin/trino-singlestore'
run: .github/bin/cleanup-node.sh
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY $MAVEN install ${MAVEN_FAST_INSTALL} -am -pl "${{ matrix.modules }}"
- name: Maven Tests
if: matrix.modules != 'plugin/trino-memsql'
if: matrix.modules != 'plugin/trino-singlestore'
run: $MAVEN test ${MAVEN_TEST} -pl ${{ matrix.modules }} ${{ matrix.profile != '' && format('-P {0}', matrix.profile) || '' }}
# Additional tests for selected modules
- name: Cloud Delta Lake Tests
Expand All @@ -464,9 +464,9 @@ jobs:
- name: Memsql Tests
env:
MEMSQL_LICENSE: ${{ secrets.MEMSQL_LICENSE }}
if: matrix.modules == 'plugin/trino-memsql' && env.MEMSQL_LICENSE != ''
if: matrix.modules == 'plugin/trino-singlestore' && env.MEMSQL_LICENSE != ''
run: |
$MAVEN test ${MAVEN_TEST} -pl :trino-memsql -Dmemsql.license=${MEMSQL_LICENSE}
$MAVEN test ${MAVEN_TEST} -pl :trino-singlestore -Dmemsql.license=${MEMSQL_LICENSE}
- name: Cloud BigQuery Tests
env:
BIGQUERY_CREDENTIALS_KEY: ${{ secrets.BIGQUERY_CREDENTIALS_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions core/trino-server/src/main/provisio/trino.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
</artifact>
</artifactSet>

<artifactSet to="plugin/memsql">
<artifact id="${project.groupId}:trino-memsql:zip:${project.version}">
<artifactSet to="plugin/singlestore">
<artifact id="${project.groupId}:trino-singlestore:zip:${project.version}">
<unpack />
</artifact>
</artifactSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>trino-memsql</artifactId>
<description>Trino - MemSQL Connector</description>
<artifactId>trino-singlestore</artifactId>
<description>Trino - SingleStore Connector</description>
<packaging>trino-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -143,10 +143,10 @@
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.joining;

public class MemSqlClient
public class SingleStoreClient
extends BaseJdbcClient
{
private static final Logger log = Logger.get(MemSqlClient.class);
private static final Logger log = Logger.get(SingleStoreClient.class);

static final int MEMSQL_DATE_TIME_MAX_PRECISION = 6;
static final int MEMSQL_VARCHAR_MAX_LENGTH = 21844;
Expand All @@ -158,7 +158,7 @@ public class MemSqlClient
private final Type jsonType;

@Inject
public MemSqlClient(BaseJdbcConfig config, ConnectionFactory connectionFactory, QueryBuilder queryBuilder, TypeManager typeManager, IdentifierMapping identifierMapping)
public SingleStoreClient(BaseJdbcConfig config, ConnectionFactory connectionFactory, QueryBuilder queryBuilder, TypeManager typeManager, IdentifierMapping identifierMapping)
{
super(config, "`", connectionFactory, queryBuilder, identifierMapping);
requireNonNull(typeManager, "typeManager is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import com.google.inject.Binder;
import com.google.inject.Module;
Expand All @@ -31,21 +31,21 @@

import static io.airlift.configuration.ConfigBinder.configBinder;

public class MemSqlClientModule
public class SingleStoreClientModule
implements Module
{
@Override
public void configure(Binder binder)
{
binder.bind(JdbcClient.class).annotatedWith(ForBaseJdbc.class).to(MemSqlClient.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(MemSqlConfig.class);
binder.bind(JdbcClient.class).annotatedWith(ForBaseJdbc.class).to(SingleStoreClient.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(SingleStoreConfig.class);
binder.install(new DecimalModule());
}

@Provides
@Singleton
@ForBaseJdbc
public static ConnectionFactory createConnectionFactory(BaseJdbcConfig config, CredentialProvider credentialProvider, MemSqlConfig memsqlConfig)
public static ConnectionFactory createConnectionFactory(BaseJdbcConfig config, CredentialProvider credentialProvider, SingleStoreConfig memsqlConfig)
{
Properties connectionProperties = new Properties();
// we don't want to interpret tinyInt type (with cardinality as 2) as boolean/bit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import io.airlift.configuration.Config;
import io.airlift.units.Duration;
Expand All @@ -21,7 +21,7 @@

import java.util.concurrent.TimeUnit;

public class MemSqlConfig
public class SingleStoreConfig
{
private boolean autoReconnect = true;
private Duration connectionTimeout = new Duration(10, TimeUnit.SECONDS);
Expand All @@ -32,7 +32,7 @@ public boolean isAutoReconnect()
}

@Config("memsql.auto-reconnect")
public MemSqlConfig setAutoReconnect(boolean autoReconnect)
public SingleStoreConfig setAutoReconnect(boolean autoReconnect)
{
this.autoReconnect = autoReconnect;
return this;
Expand All @@ -45,7 +45,7 @@ public Duration getConnectionTimeout()
}

@Config("memsql.connection-timeout")
public MemSqlConfig setConnectionTimeout(Duration connectionTimeout)
public SingleStoreConfig setConnectionTimeout(Duration connectionTimeout)
{
this.connectionTimeout = connectionTimeout;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import com.google.common.collect.ImmutableList;
import io.airlift.log.Logger;
Expand All @@ -28,10 +28,10 @@

import static io.airlift.configuration.ConfigurationAwareModule.combine;

public class MemSqlPlugin
public class SingleStorePlugin
implements Plugin
{
private static final Logger log = Logger.get(MemSqlPlugin.class);
private static final Logger log = Logger.get(SingleStorePlugin.class);

@Override
public Iterable<ConnectorFactory> getConnectorFactories()
Expand Down Expand Up @@ -65,7 +65,7 @@ public SingleStoreConnectorFactory(String name)
combine(
new CredentialProviderModule(),
new ExtraCredentialsBasedIdentityCacheMappingModule(),
new MemSqlClientModule()));
new SingleStoreClientModule()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import com.google.common.collect.ImmutableMap;
import io.airlift.log.Logger;
Expand All @@ -29,14 +29,14 @@
import static io.trino.testing.QueryAssertions.copyTpchTables;
import static io.trino.testing.TestingSession.testSessionBuilder;

public class MemSqlQueryRunner
public class SingleStoreQueryRunner
{
private MemSqlQueryRunner() {}
private SingleStoreQueryRunner() {}

private static final String TPCH_SCHEMA = "tpch";

public static DistributedQueryRunner createMemSqlQueryRunner(
TestingMemSqlServer server,
public static DistributedQueryRunner createSingleStoreQueryRunner(
TestingSingleStoreServer server,
Map<String, String> extraProperties,
Map<String, String> connectorProperties,
Iterable<TpchTable<?>> tables)
Expand All @@ -54,8 +54,8 @@ public static DistributedQueryRunner createMemSqlQueryRunner(

server.execute("CREATE SCHEMA tpch");

queryRunner.installPlugin(new MemSqlPlugin());
queryRunner.createCatalog("memsql", "memsql", connectorProperties);
queryRunner.installPlugin(new SingleStorePlugin());
queryRunner.createCatalog("singlestore", "singlestore", connectorProperties);

copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);

Expand All @@ -70,7 +70,7 @@ public static DistributedQueryRunner createMemSqlQueryRunner(
private static Session createSession()
{
return testSessionBuilder()
.setCatalog("memsql")
.setCatalog("singlestore")
.setSchema(TPCH_SCHEMA)
.build();
}
Expand All @@ -81,13 +81,13 @@ public static void main(String[] args)
Logging.initialize();

// You need to set 'memsql.license' to VM options
DistributedQueryRunner queryRunner = createMemSqlQueryRunner(
new TestingMemSqlServer(),
DistributedQueryRunner queryRunner = createSingleStoreQueryRunner(
new TestingSingleStoreServer(),
ImmutableMap.of("http-server.http.port", "8080"),
ImmutableMap.of(),
TpchTable.getTables());

Logger log = Logger.get(MemSqlQueryRunner.class);
Logger log = Logger.get(SingleStoreQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
Expand All @@ -23,26 +23,26 @@
import java.nio.file.Path;

import static io.trino.plugin.jdbc.mapping.RuleBasedIdentifierMappingUtils.createRuleBasedIdentifierMappingFile;
import static io.trino.plugin.memsql.MemSqlQueryRunner.createMemSqlQueryRunner;
import static io.trino.plugin.singlestore.SingleStoreQueryRunner.createSingleStoreQueryRunner;
import static java.util.Objects.requireNonNull;

// With case-insensitive-name-matching enabled colliding schema/table names are considered as errors.
// Some tests here create colliding names which can cause any other concurrent test to fail.
@Test(singleThreaded = true)
public class TestMemSqlCaseInsensitiveMapping
public class TestSingleStoreCaseInsensitiveMapping
extends BaseCaseInsensitiveMappingTest
{
protected Path mappingFile;
protected TestingMemSqlServer memSqlServer;
protected TestingSingleStoreServer singleStoreServer;

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
mappingFile = createRuleBasedIdentifierMappingFile();
memSqlServer = closeAfterClass(new TestingMemSqlServer());
return createMemSqlQueryRunner(
memSqlServer,
singleStoreServer = closeAfterClass(new TestingSingleStoreServer());
return createSingleStoreQueryRunner(
singleStoreServer,
ImmutableMap.of(),
ImmutableMap.<String, String>builder()
.put("case-insensitive-name-matching", "true")
Expand All @@ -61,7 +61,7 @@ protected Path getMappingFile()
@Override
protected SqlExecutor onRemoteDatabase()
{
return requireNonNull(memSqlServer, "memSqlServer is null")::execute;
return requireNonNull(singleStoreServer, "singleStoreServer is null")::execute;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.memsql;
package io.trino.plugin.singlestore;

import com.google.common.collect.ImmutableMap;
import io.airlift.units.Duration;
Expand All @@ -24,12 +24,12 @@
import static io.airlift.configuration.testing.ConfigAssertions.assertRecordedDefaults;
import static io.airlift.configuration.testing.ConfigAssertions.recordDefaults;

public class TestMemSqlConfig
public class TestSingleStoreConfig
{
@Test
public void testDefaults()
{
assertRecordedDefaults(recordDefaults(MemSqlConfig.class)
assertRecordedDefaults(recordDefaults(SingleStoreConfig.class)
.setAutoReconnect(true)
.setConnectionTimeout(new Duration(10, TimeUnit.SECONDS)));
}
Expand All @@ -42,7 +42,7 @@ public void testExplicitPropertyMappings()
.put("memsql.connection-timeout", "4s")
.buildOrThrow();

MemSqlConfig expected = new MemSqlConfig()
SingleStoreConfig expected = new SingleStoreConfig()
.setAutoReconnect(false)
.setConnectionTimeout(new Duration(4, TimeUnit.SECONDS));

Expand Down
Loading

0 comments on commit b1337f8

Please sign in to comment.