carp84 commented on a change in pull request #8930: [FLINK-12955] HBase 
LookupableTableSource
URL: https://github.com/apache/flink/pull/8930#discussion_r300957927
 
 

 ##########
 File path: 
flink-connectors/flink-hbase/src/test/java/org/apache/flink/addons/hbase/HBaseLookupFunctionITCase.java
 ##########
 @@ -0,0 +1,247 @@
+/*
+ * 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.addons.hbase;
+
+import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.api.java.ExecutionEnvironment;
+import org.apache.flink.api.java.ExecutionEnvironmentFactory;
+import org.apache.flink.api.java.LocalEnvironment;
+import org.apache.flink.api.java.typeutils.RowTypeInfo;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.streaming.api.datastream.DataStream;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.api.Table;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.descriptors.ConnectorDescriptorValidator;
+import org.apache.flink.table.descriptors.DescriptorProperties;
+import org.apache.flink.table.factories.TableFactoryService;
+import org.apache.flink.table.runtime.utils.StreamITCase;
+import org.apache.flink.table.sources.TableSource;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.utils.TypeConversions;
+import org.apache.flink.types.Row;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static 
org.apache.flink.addons.hbase.HBaseValidator.CONNECTOR_HBASE_TABLE_NAME;
+import static 
org.apache.flink.addons.hbase.HBaseValidator.CONNECTOR_TYPE_VALUE_HBASE;
+import static 
org.apache.flink.addons.hbase.HBaseValidator.CONNECTOR_VERSION_VALUE_143;
+import static 
org.apache.flink.table.descriptors.ConnectorDescriptorValidator.CONNECTOR_PROPERTY_VERSION;
+import static 
org.apache.flink.table.descriptors.ConnectorDescriptorValidator.CONNECTOR_VERSION;
+import static org.apache.flink.table.descriptors.Schema.SCHEMA;
+
+/**
+ * IT case Test HBaseLookupFunction.
+ */
+public class HBaseLookupFunctionITCase extends HBaseTestingClusterAutostarter {
+       private static final Log LOG = 
LogFactory.getLog(HBaseLookupFunctionITCase.class);
+       private static final String FAMILY1 = "family1";
+       private static final String F1COL1 = "col1";
+
+       private static final String FAMILY2 = "family2";
+       private static final String F2COL1 = "col1";
+       private static final String F2COL2 = "col2";
+
+       private static final String FAMILY3 = "family3";
+       private static final String F3COL1 = "col1";
+       private static final String F3COL2 = "col2";
+       private static final String F3COL3 = "col3";
+
+       // prepare a source collection.
+       private static final List<Row> testData1 = new ArrayList<>();
+
+       static {
+               testData1.add(Row.of(1, 1L, "Hi"));
+               testData1.add(Row.of(2, 2L, "Hello"));
+               testData1.add(Row.of(3, 2L, "Hello world"));
+               testData1.add(Row.of(3, 3L, "Hello world!"));
+       }
+
+       private static final TypeInformation<?>[] testTypes1 = 
{BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO, 
BasicTypeInfo.STRING_TYPE_INFO};
+       private static final String[] testColumns1 = {"a", "b", "c"};
+       private static final RowTypeInfo testTypeInfo1 = new 
RowTypeInfo(testTypes1, testColumns1);
+
+       @BeforeClass
+       public static void activateHBaseCluster() {
+               registerHBaseMiniClusterInClasspath();
+       }
+
+       @AfterClass
+       public static void resetExecutionEnvironmentFactory() {
+               LimitNetworkBuffersTestEnvironment.unsetAsContext();
+       }
+
+       /**
+        * Allows the tests to use {@link 
ExecutionEnvironment#getExecutionEnvironment()} but with a
+        * configuration that limits the maximum memory used for network 
buffers since the current
+        * defaults are too high for Travis-CI.
+        */
+       private abstract static class LimitNetworkBuffersTestEnvironment 
extends ExecutionEnvironment {
+
+               public static void setAsContext() {
 
 Review comment:
   Never used, consider removing it.

----------------------------------------------------------------
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