Skip to content

Commit

Permalink
Remove redundant Guice-like annotation
Browse files Browse the repository at this point in the history
`@ForBigQuery` was meaningless, because it lacked runtime retention.
Guice could not obey the annotation since it didn't see it.
  • Loading branch information
findepi committed May 14, 2024
1 parent 9bc94e6 commit f9a6fd9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import io.trino.spi.NodeManager;
import io.trino.spi.function.table.ConnectorTableFunction;

import java.lang.annotation.Target;
import java.lang.management.ManagementFactory;
import java.util.Set;
import java.util.regex.Matcher;
Expand All @@ -43,10 +42,6 @@
import static io.airlift.configuration.ConditionalModule.conditionalModule;
import static io.airlift.configuration.ConfigBinder.configBinder;
import static io.trino.plugin.bigquery.BigQueryConfig.ARROW_SERIALIZATION_ENABLED;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.util.concurrent.Executors.newFixedThreadPool;
import static java.util.stream.Collectors.toSet;

Expand Down Expand Up @@ -122,7 +117,6 @@ public static BigQueryLabelFactory labelFactory(BigQueryConfig config)
}

@Provides
@ForBigQuery
public ListeningExecutorService provideListeningExecutor(BigQueryConfig config)
{
return listeningDecorator(newFixedThreadPool(config.getMetadataParallelism(), daemonThreadsNamed("big-query-%s"))); // limit parallelism
Expand Down Expand Up @@ -186,9 +180,4 @@ protected void setup(Binder binder)
}
}
}

@Target({PARAMETER, FIELD, METHOD, CONSTRUCTOR})
public @interface ForBigQuery
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.inject.Inject;

import static io.trino.plugin.bigquery.BigQueryConnectorModule.ForBigQuery;
import static java.util.Objects.requireNonNull;

public class DefaultBigQueryMetadataFactory
Expand All @@ -31,7 +30,7 @@ public class DefaultBigQueryMetadataFactory
public DefaultBigQueryMetadataFactory(
BigQueryClientFactory bigQueryClient,
BigQueryTypeManager typeManager,
@ForBigQuery ListeningExecutorService executorService,
ListeningExecutorService executorService,
BigQueryConfig config)
{
this.bigQueryClient = requireNonNull(bigQueryClient, "bigQueryClient is null");
Expand Down

0 comments on commit f9a6fd9

Please sign in to comment.