Skip to content

Commit

Permalink
Remove unused FunctionInvoker contructor argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dain committed Sep 4, 2022
1 parent ff71d41 commit 95f033f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class FunctionInvoker
private final Optional<MethodHandle> instanceFactory;
private final List<Class<?>> lambdaInterfaces;

public FunctionInvoker(MethodHandle methodHandle, Optional<MethodHandle> instanceFactory)
public FunctionInvoker(MethodHandle methodHandle)
{
this.methodHandle = requireNonNull(methodHandle, "methodHandle is null");
this.instanceFactory = requireNonNull(instanceFactory, "instanceFactory is null");
this.instanceFactory = Optional.empty();
this.lambdaInterfaces = ImmutableList.of();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.COMPARISON_UNORDERED_FIRST;
import static io.trino.spi.type.IntegerType.INTEGER;
Expand Down Expand Up @@ -54,7 +53,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getComparisonUnorderedFirstOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.COMPARISON_UNORDERED_LAST;
import static io.trino.spi.type.IntegerType.INTEGER;
Expand Down Expand Up @@ -54,7 +53,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getComparisonUnorderedLastOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.IS_DISTINCT_FROM;
import static io.trino.spi.type.BooleanType.BOOLEAN;
Expand Down Expand Up @@ -55,7 +54,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getDistinctFromOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.EQUAL;
import static io.trino.spi.type.BooleanType.BOOLEAN;
Expand Down Expand Up @@ -55,7 +54,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getEqualOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.HASH_CODE;
import static io.trino.spi.type.BigintType.BIGINT;
Expand Down Expand Up @@ -53,7 +52,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getHashCodeOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.INDETERMINATE;
import static io.trino.spi.type.BooleanType.BOOLEAN;
Expand Down Expand Up @@ -54,7 +53,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getIndeterminateOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.LESS_THAN;
import static io.trino.spi.type.BooleanType.BOOLEAN;
Expand Down Expand Up @@ -54,7 +53,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getLessThanOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.LESS_THAN_OR_EQUAL;
import static io.trino.spi.type.BooleanType.BOOLEAN;
Expand Down Expand Up @@ -54,7 +53,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getLessThanOrEqualOperator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.spi.type.TypeSignature;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static io.trino.spi.function.OperatorType.XX_HASH_64;
import static io.trino.spi.type.BigintType.BIGINT;
Expand Down Expand Up @@ -53,7 +52,7 @@ protected SpecializedSqlScalarFunction specialize(BoundSignature boundSignature)
Type type = boundSignature.getArgumentType(0);
return invocationConvention -> {
MethodHandle methodHandle = typeOperators.getXxHash64Operator(type, invocationConvention);
return new FunctionInvoker(methodHandle, Optional.empty());
return new FunctionInvoker(methodHandle);
};
}
}

0 comments on commit 95f033f

Please sign in to comment.