Myasuka commented on a change in pull request #9231: [FLINK-13252] Common 
CachedLookupFunction for All connector
URL: https://github.com/apache/flink/pull/9231#discussion_r307450367
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/sources/decorator/CachedLookupFunctionDecorator.java
 ##########
 @@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.sources.decorator;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.table.functions.FunctionContext;
+import org.apache.flink.table.functions.TableFunction;
+import org.apache.flink.types.Row;
+import org.apache.flink.util.Collector;
+
+import org.apache.flink.shaded.guava18.com.google.common.cache.Cache;
+import org.apache.flink.shaded.guava18.com.google.common.cache.CacheBuilder;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * CachedLookupableTableSource.
+ * LIMITATION: now the function eval of the lookupTableSource implementation 
only supports parameter as Object or Object...
+ * TODO: in the future, to extract the parameter type from the Method, but I 
think it's not much urgent.
+ */
+public class CachedLookupFunctionDecorator<T> extends TableFunction<T> {
+       //default 1day.
+       private static final long EXPIRED_TIME_MS_DEFAULT = 24 * 60 * 60 * 1000;
+       private final TableFunction<T> lookupTableSource;
+       private transient Cache<Row, List<T>> cache;
+       private transient LookupFunctionInvoker.Evaluation realEval;
+       private CollectorProxy collectorProxy;
+       private final long expireTimeMS;
+       private final long maximumSize;
+       private final boolean recordStat;
+       private final boolean isVariable;
 
 Review comment:
   How about change this field name to `isVarArgs`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to