Skip to content

Commit

Permalink
Repackage as io.trino (step 5 of 5): package references
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Jan 3, 2021
1 parent 03d8e5a commit e2ae5a9
Show file tree
Hide file tree
Showing 147 changed files with 358 additions and 353 deletions.
4 changes: 2 additions & 2 deletions .mvn/modernizer/violations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
<violation>
<name>org/testng/Assert.assertEquals:(Ljava/lang/Iterable;Ljava/lang/Iterable;)V</name>
<version>1.8</version>
<comment>Use io.prestosql.testing.assertions.Assert.assertEquals due to TestNG #543</comment>
<comment>Use io.trino.testing.assertions.Assert.assertEquals due to TestNG #543</comment>
</violation>

<violation>
<name>org/testng/Assert.assertEquals:(Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/String;)V</name>
<version>1.8</version>
<comment>Use io.prestosql.testing.assertions.Assert.assertEquals due to TestNG #543</comment>
<comment>Use io.trino.testing.assertions.Assert.assertEquals due to TestNG #543</comment>
</violation>

<violation>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ properly configured for the project:
Presto comes with sample configuration that should work out-of-the-box for
development. Use the following options to create a run configuration:

* Main Class: `io.prestosql.server.PrestoServer`
* Main Class: `io.trino.server.PrestoServer`
* VM Options: `-ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -Djdk.attach.allowAttachSelf=true`
* Working directory: `$MODULE_DIR$`
* Use classpath of module: `trino-server-main`
Expand Down
2 changes: 1 addition & 1 deletion client/trino-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>
<project.build.targetJdk>8</project.build.targetJdk>
<main-class>io.prestosql.cli.Presto</main-class>
<main-class>io.trino.cli.Presto</main-class>
<dep.jline.version>3.17.1</dep.jline.version>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions client/trino-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>
<project.build.targetJdk>8</project.build.targetJdk>
<shadeBase>io.prestosql.jdbc.\$internal</shadeBase>
<shadeBase>io.trino.jdbc.\$internal</shadeBase>
</properties>

<dependencies>
Expand Down Expand Up @@ -234,7 +234,7 @@
<dependencyReducedPomLocation>${project.build.directory}/pom.xml</dependencyReducedPomLocation>
<relocations>
<relocation>
<pattern>io.prestosql.client</pattern>
<pattern>io.trino.client</pattern>
<shadedPattern>${shadeBase}.client</shadedPattern>
</relocation>
<relocation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package com.facebook.presto.jdbc;

/**
* @deprecated Use {@link io.prestosql.jdbc.PrestoDriver} instead.
* @deprecated Use {@link io.trino.jdbc.PrestoDriver} instead.
*/
@Deprecated
public class PrestoDriver
extends io.prestosql.jdbc.PrestoDriver {}
extends io.trino.jdbc.PrestoDriver {}
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ abstract class AbstractPrestoResultSet
.add("interval day to second", String.class, PrestoIntervalDayTime.class, AbstractPrestoResultSet::parseIntervalDayTime)
.add("array", List.class, List.class, (type, list) -> (List<?>) convertFromClientRepresentation(type, list))
.add("map", Map.class, Map.class, (type, map) -> (Map<?, ?>) convertFromClientRepresentation(type, map))
.add("row", io.prestosql.client.Row.class, Row.class, (type, clientRow) -> (Row) convertFromClientRepresentation(type, clientRow))
.add("row", io.prestosql.client.Row.class, Map.class, (type, clientRow) -> {
.add("row", io.trino.client.Row.class, Row.class, (type, clientRow) -> (Row) convertFromClientRepresentation(type, clientRow))
.add("row", io.trino.client.Row.class, Map.class, (type, clientRow) -> {
Row row = (Row) convertFromClientRepresentation(type, clientRow);
Map<String, Object> result = new HashMap<>();
for (RowField field : row.getFields()) {
Expand Down Expand Up @@ -658,13 +658,13 @@ private static Object convertFromClientRepresentation(ClientTypeSignature column
}

case "row": {
io.prestosql.client.Row row = (io.prestosql.client.Row) value;
List<io.prestosql.client.RowField> fields = row.getFields();
io.trino.client.Row row = (io.trino.client.Row) value;
List<io.trino.client.RowField> fields = row.getFields();
List<ClientTypeSignatureParameter> typeArguments = columnType.getArguments();
Row.Builder builder = Row.builder();
verify(fields.size() == typeArguments.size(), "Type mismatch: %s, %s", row, columnType);
for (int i = 0; i < fields.size(); i++) {
io.prestosql.client.RowField field = fields.get(i);
io.trino.client.RowField field = fields.get(i);
ClientTypeSignatureParameter clientTypeSignatureParameter = typeArguments.get(i);
verify(clientTypeSignatureParameter.getKind() == ClientTypeSignatureParameter.ParameterKind.NAMED_TYPE, "Not a NAMED_TYPE: %s", clientTypeSignatureParameter);
verify(field.getName().equals(clientTypeSignatureParameter.getNamedTypeSignature().getName()), "Name mismatch: %s, %s", field, clientTypeSignatureParameter);
Expand Down
6 changes: 3 additions & 3 deletions client/trino-jdbc/src/main/java/io/trino/jdbc/Row.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
// A public facade for Row from trino-client
public final class Row
{
private final io.prestosql.client.Row row;
private final io.trino.client.Row row;

Row(io.prestosql.client.Row row)
Row(io.trino.client.Row row)
{
this.row = requireNonNull(row, "row is null");
}
Expand Down Expand Up @@ -72,7 +72,7 @@ public static Builder builder()
// A public facade for Row.Builder from trino-client
public static final class Builder
{
private final io.prestosql.client.Row.Builder builder = io.prestosql.client.Row.builder();
private final io.trino.client.Row.Builder builder = io.trino.client.Row.builder();

private Builder() {}

Expand Down
4 changes: 2 additions & 2 deletions client/trino-jdbc/src/main/java/io/trino/jdbc/RowField.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
// A public facade for RowField from presto-client
public final class RowField
{
private final io.prestosql.client.RowField rowField;
private final io.trino.client.RowField rowField;

RowField(io.prestosql.client.RowField rowField)
RowField(io.trino.client.RowField rowField)
{
this.rowField = requireNonNull(rowField, "rowField is null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public StageStats(
this.subStages = ImmutableList.copyOf(requireNonNull(subStages, "subStages is null"));
}

static StageStats create(io.prestosql.client.StageStats stats)
static StageStats create(io.trino.client.StageStats stats)
{
return new StageStats(
stats.getStageId(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
io.prestosql.jdbc.PrestoDriver
io.trino.jdbc.PrestoDriver
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ public void testConvertLocalDate()
assertThatThrownBy(() -> assertion.roundTripsAs(Types.DATE, Date.valueOf(jvmGapDate)))
// TODO (https://github.com/trinodb/trino/issues/6242) this currently fails
.isInstanceOf(SQLException.class)
.hasStackTraceContaining("io.prestosql.jdbc.PrestoResultSet.getObject")
.hasStackTraceContaining("io.trino.jdbc.PrestoResultSet.getObject")
.hasMessage("Expected value to be a date but is: 1970-01-01");

assertBind((ps, i) -> ps.setObject(i, jvmGapDate, Types.DATE))
Expand Down
2 changes: 1 addition & 1 deletion core/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ docker run -p 8080:8080 --name presto prestosql/presto

Wait for the following message log line:
```
INFO main io.prestosql.server.Server ======== SERVER STARTED ========
INFO main io.trino.server.Server ======== SERVER STARTED ========
```

The Presto server is now running on `localhost:8080` (the default port).
Expand Down
2 changes: 1 addition & 1 deletion core/docker/default/etc/log.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Enable verbose logging from Presto
#io.prestosql=DEBUG
#io.trino=DEBUG
4 changes: 2 additions & 2 deletions core/trino-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@
<artifactId>modernizer-maven-plugin</artifactId>
<configuration>
<ignorePackages>
<ignorePackage>io.prestosql.testing.assertions</ignorePackage>
<ignorePackage>io.trino.testing.assertions</ignorePackage>
</ignorePackages>
</configuration>
</plugin>
Expand Down Expand Up @@ -493,7 +493,7 @@
<argument>-Dmyproperty=myvalue</argument>
<argument>-classpath</argument>
<classpath />
<argument>io.prestosql.benchmark.BenchmarkSuite</argument>
<argument>io.trino.benchmark.BenchmarkSuite</argument>
</arguments>
<classpathScope>test</classpathScope>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final Distribution getDistribution()
}

/**
* @param constraint a {@link Constraint} using {@link io.prestosql.connector.system.SystemColumnHandle} to identify columns
* @param constraint a {@link Constraint} using {@link io.trino.connector.system.SystemColumnHandle} to identify columns
*/
/*
* This method is not part of the SystemTable interface, because system tables do not operate on column handles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public PlanNodeStatsEstimate filterStats(

private Expression simplifyExpression(Session session, Expression predicate, TypeProvider types)
{
// TODO reuse io.prestosql.sql.planner.iterative.rule.SimplifyExpressions.rewrite
// TODO reuse io.trino.sql.planner.iterative.rule.SimplifyExpressions.rewrite

Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(session, predicate, types);
ExpressionInterpreter interpreter = ExpressionInterpreter.expressionOptimizer(predicate, metadata, session, expressionTypes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,28 +663,28 @@ public FunctionRegistry(
.scalar(TimestampWithTimeZoneOperators.TimestampMinusIntervalYearToMonth.class)
.scalar(TimestampWithTimeZoneOperators.TimestampMinusTimestamp.class)
.scalar(CurrentTimestamp.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractYear.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractQuarter.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractMonth.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractDay.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractHour.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractMinute.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractSecond.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractMillisecond.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractDayOfYear.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractDayOfWeek.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractWeekOfYear.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ExtractYearOfWeek.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ToIso8601.class)
.scalar(io.prestosql.operator.scalar.timestamptz.DateAdd.class)
.scalar(io.prestosql.operator.scalar.timestamptz.DateTrunc.class)
.scalar(io.prestosql.operator.scalar.timestamptz.TimeZoneHour.class)
.scalar(io.prestosql.operator.scalar.timestamptz.TimeZoneMinute.class)
.scalar(io.prestosql.operator.scalar.timestamptz.DateDiff.class)
.scalar(io.prestosql.operator.scalar.timestamptz.DateFormat.class)
.scalar(io.prestosql.operator.scalar.timestamptz.FormatDateTime.class)
.scalar(io.prestosql.operator.scalar.timestamptz.ToUnixTime.class)
.scalar(io.prestosql.operator.scalar.timestamptz.LastDayOfMonth.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractYear.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractQuarter.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractMonth.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractDay.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractHour.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractMinute.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractSecond.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractMillisecond.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractDayOfYear.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractDayOfWeek.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractWeekOfYear.class)
.scalar(io.trino.operator.scalar.timestamptz.ExtractYearOfWeek.class)
.scalar(io.trino.operator.scalar.timestamptz.ToIso8601.class)
.scalar(io.trino.operator.scalar.timestamptz.DateAdd.class)
.scalar(io.trino.operator.scalar.timestamptz.DateTrunc.class)
.scalar(io.trino.operator.scalar.timestamptz.TimeZoneHour.class)
.scalar(io.trino.operator.scalar.timestamptz.TimeZoneMinute.class)
.scalar(io.trino.operator.scalar.timestamptz.DateDiff.class)
.scalar(io.trino.operator.scalar.timestamptz.DateFormat.class)
.scalar(io.trino.operator.scalar.timestamptz.FormatDateTime.class)
.scalar(io.trino.operator.scalar.timestamptz.ToUnixTime.class)
.scalar(io.trino.operator.scalar.timestamptz.LastDayOfMonth.class)
.scalar(AtTimeZone.class)
.scalar(AtTimeZoneWithOffset.class)
.scalar(DateToTimestampWithTimeZoneCast.class)
Expand Down Expand Up @@ -713,17 +713,17 @@ public FunctionRegistry(
.scalar(TimeWithTimeZoneToTimeWithTimeZoneCast.class)
.scalar(TimeWithTimeZoneToVarcharCast.class)
.scalar(VarcharToTimeWithTimeZoneCast.class)
.scalar(io.prestosql.operator.scalar.timetz.DateDiff.class)
.scalar(io.prestosql.operator.scalar.timetz.DateAdd.class)
.scalar(io.prestosql.operator.scalar.timetz.ExtractHour.class)
.scalar(io.prestosql.operator.scalar.timetz.ExtractMinute.class)
.scalar(io.prestosql.operator.scalar.timetz.ExtractSecond.class)
.scalar(io.prestosql.operator.scalar.timetz.ExtractMillisecond.class)
.scalar(io.prestosql.operator.scalar.timetz.TimeZoneHour.class)
.scalar(io.prestosql.operator.scalar.timetz.TimeZoneMinute.class)
.scalar(io.prestosql.operator.scalar.timetz.DateTrunc.class)
.scalar(io.prestosql.operator.scalar.timetz.AtTimeZone.class)
.scalar(io.prestosql.operator.scalar.timetz.AtTimeZoneWithOffset.class)
.scalar(io.trino.operator.scalar.timetz.DateDiff.class)
.scalar(io.trino.operator.scalar.timetz.DateAdd.class)
.scalar(io.trino.operator.scalar.timetz.ExtractHour.class)
.scalar(io.trino.operator.scalar.timetz.ExtractMinute.class)
.scalar(io.trino.operator.scalar.timetz.ExtractSecond.class)
.scalar(io.trino.operator.scalar.timetz.ExtractMillisecond.class)
.scalar(io.trino.operator.scalar.timetz.TimeZoneHour.class)
.scalar(io.trino.operator.scalar.timetz.TimeZoneMinute.class)
.scalar(io.trino.operator.scalar.timetz.DateTrunc.class)
.scalar(io.trino.operator.scalar.timetz.AtTimeZone.class)
.scalar(io.trino.operator.scalar.timetz.AtTimeZoneWithOffset.class)
.scalar(CurrentTime.class);

switch (featuresConfig.getRegexLibrary()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private UnnestOperatorBlockUtil() {}
// See java.util.ArrayList for an explanation
static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;

// Copied from io.prestosql.spi.block.BlockUtil#calculateNewArraySize
// Copied from io.trino.spi.block.BlockUtil#calculateNewArraySize
static int calculateNewArraySize(int currentSize)
{
// grow array by 50%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public interface AccessControl

/**
* Check if identity is allowed to comment the specified column.
* @throws io.prestosql.spi.security.AccessDeniedException if not allowed
* @throws io.trino.spi.security.AccessDeniedException if not allowed
*/
void checkCanSetColumnComment(SecurityContext context, QualifiedObjectName tableName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public SystemSecurityContext toSystemSecurityContext()
@Override
public boolean equals(Object o)
{
// this is needed by io.prestosql.sql.analyzer.Analysis.AccessControlInfo
// this is needed by io.trino.sql.analyzer.Analysis.AccessControlInfo
if (this == o) {
return true;
}
Expand All @@ -83,7 +83,7 @@ public boolean equals(Object o)
@Override
public int hashCode()
{
// this is needed by io.prestosql.sql.analyzer.Analysis.AccessControlInfo
// this is needed by io.trino.sql.analyzer.Analysis.AccessControlInfo
return Objects.hash(transactionId, identity, queryId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
public class PluginManager
{
private static final ImmutableList<String> SPI_PACKAGES = ImmutableList.<String>builder()
.add("io.prestosql.spi.")
.add("io.trino.spi.")
.add("com.fasterxml.jackson.annotation.")
.add("io.airlift.slice.")
.add("org.openjdk.jol.")
Expand Down
2 changes: 1 addition & 1 deletion core/trino-main/src/main/java/io/trino/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private void doStart(String prestoVersion)
new JsonModule(),
new JaxrsModule(),
new MBeanModule(),
new PrefixObjectNameGeneratorModule("io.prestosql"),
new PrefixObjectNameGeneratorModule("io.trino"),
new JmxModule(),
new JmxHttpModule(),
new LogJmxModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ private static StageStats toStageStats(StageInfo stageInfo)
return null;
}

io.prestosql.execution.StageStats stageStats = stageInfo.getStageStats();
io.trino.execution.StageStats stageStats = stageInfo.getStageStats();

ImmutableList.Builder<StageStats> subStages = ImmutableList.builder();
for (StageInfo subStage : stageInfo.getSubStages()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public AccessType getAccessType(ResourceInfo resourceInfo)
private static void verifyNotPrestoResource(ResourceInfo resourceInfo)
{
Method resourceMethod = resourceInfo.getResourceMethod();
if (resourceMethod != null && resourceMethod.getDeclaringClass().getPackageName().startsWith("io.prestosql.")) {
if (resourceMethod != null && resourceMethod.getDeclaringClass().getPackageName().startsWith("io.trino.")) {
throw new IllegalArgumentException("Presto resource is not annotated with @" + ResourceSecurity.class.getSimpleName() + ": " + resourceInfo.getResourceMethod());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ protected Type visitLambdaExpression(LambdaExpression node, StackableAstVisitorC
for (int i = 0; i < lambdaArguments.size(); i++) {
LambdaArgumentDeclaration lambdaArgument = lambdaArguments.get(i);
Type type = types.get(i);
fields.add(io.prestosql.sql.analyzer.Field.newUnqualified(lambdaArgument.getName().getValue(), type));
fields.add(io.trino.sql.analyzer.Field.newUnqualified(lambdaArgument.getName().getValue(), type));
setExpressionType(lambdaArgument, type);
}

Expand Down
Loading

0 comments on commit e2ae5a9

Please sign in to comment.