Skip to content

Commit

Permalink
Cleanup TypeRegistry constructor
Browse files Browse the repository at this point in the history
Remove unused inject annotation
Remove unused types constructor arg
  • Loading branch information
dain committed Feb 19, 2020
1 parent c58ff37 commit ae407a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public final class MetadataManager
private final ColumnPropertyManager columnPropertyManager;
private final AnalyzePropertyManager analyzePropertyManager;
private final TransactionManager transactionManager;
private final TypeRegistry typeRegistry = new TypeRegistry(ImmutableSet.of());
private final TypeRegistry typeRegistry = new TypeRegistry();

private final ConcurrentMap<String, BlockEncoding> blockEncodings = new ConcurrentHashMap<>();
private final ConcurrentMap<QueryId, QueryCatalogs> catalogsByQueryId = new ConcurrentHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@
import io.prestosql.type.VarcharParametricType;

import javax.annotation.concurrent.ThreadSafe;
import javax.inject.Inject;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -91,11 +89,8 @@ final class TypeRegistry

private final Cache<TypeSignature, Type> parametricTypeCache;

@Inject
public TypeRegistry(Set<Type> types)
public TypeRegistry()
{
requireNonNull(types, "types is null");

// Manually register UNKNOWN type without a verifyTypeClass call since it is a special type that cannot be used by functions
this.types.put(UNKNOWN.getTypeSignature(), UNKNOWN);

Expand Down Expand Up @@ -137,9 +132,6 @@ public TypeRegistry(Set<Type> types)
addParametricType(FUNCTION);
addParametricType(QDIGEST);

for (Type type : types) {
addType(type);
}
parametricTypeCache = CacheBuilder.newBuilder()
.maximumSize(1000)
.build();
Expand Down

0 comments on commit ae407a1

Please sign in to comment.