wuchong commented on a change in pull request #9866: [FLINK-14349][hbase] 
Create a Connector Descriptor for HBase so that user can connect HBase by 
TableEnvironment#connect
URL: https://github.com/apache/flink/pull/9866#discussion_r333315438
 
 

 ##########
 File path: 
flink-connectors/flink-hbase/src/main/java/org/apache/flink/table/descriptors/HBase.java
 ##########
 @@ -0,0 +1,120 @@
+/*
+ * 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.descriptors;
+
+import org.apache.flink.configuration.MemorySize;
+
+import java.util.Map;
+
+import static 
org.apache.flink.table.descriptors.ConnectorDescriptorValidator.CONNECTOR_VERSION;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_TABLE_NAME;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_TYPE_VALUE_HBASE;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_WRITE_BUFFER_FLUSH_INTERVAL;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_WRITE_BUFFER_FLUSH_MAX_ROWS;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_WRITE_BUFFER_FLUSH_MAX_SIZE;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_ZK_NODE_PARENT;
+import static 
org.apache.flink.table.descriptors.HBaseValidator.CONNECTOR_ZK_QUORUM;
+
+/**
+ * Connector descriptor for Apache HBase.
+ */
+public class HBase extends ConnectorDescriptor {
+       private DescriptorProperties properties = new DescriptorProperties();
+
+       public HBase() {
+               super(CONNECTOR_TYPE_VALUE_HBASE, 1, true);
+       }
+
+       /**
+        * Set the Apache HBase version to be used. Required.
+        *
+        * @param version HBase version. E.g., "1.4.3".
+        */
+       public HBase version(String version) {
+               properties.putString(CONNECTOR_VERSION, version);
+               return this;
+       }
+
+       /**
+        * Set the HBase table name, Required.
+        *
+        * @param tableName Name of HBase table.  E.g., 
"testNamespace:testTable", "testDefaultTable"
+        */
+       public HBase tableName(String tableName) {
+               properties.putString(CONNECTOR_TABLE_NAME, tableName);
+               return this;
+       }
+
+       /**
+        * Set the zookeeper quorum address to connect the HBase cluster. 
Required.
+        *
+        * @param zookeeperQuorum zookeeper quorum address to connect the HBase 
cluster. E.g., "localhost:2181,localhost:2182,localhost:2183".
+        */
+       public HBase zookeeperQuorum(String zookeeperQuorum) {
+               properties.putString(CONNECTOR_ZK_QUORUM, zookeeperQuorum);
+               return this;
+       }
+
+       /**
+        * Set the zookeeper node parent path of HBase cluster. Optional.
 
 Review comment:
   The default value is "/hbase".

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to