You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/05/16 03:22:19 UTC

[GitHub] [incubator-inlong] LvJiancheng opened a new pull request, #4211: [INLONG-4197][Manager] Adaptive Hbase load node

LvJiancheng opened a new pull request, #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211

   ### Title Name: [INLONG-4197][Manager] Adaptive Hbase load node 
   
   where *XYZ* should be replaced by the actual issue number.
   
   Fixes #4197 
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve?*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r874444394


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+
+/**
+ * Hbase sink.
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Hive sink configuration")

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] gong commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
gong commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r873410603


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Hive sink configuration")
+public class HbaseSink extends StreamSink {
+
+    @ApiModelProperty(value = "Sink type", required = true)
+    private SinkType sinkType = SinkType.HBASE;
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;
+
+    @ApiModelProperty("Row key")
+    private String rowKey;
+
+    @ApiModelProperty("Zookeeper quorm")
+    private String zookeeperQuorum;
+
+    @ApiModelProperty("Sink buffer flush maxsize")
+    private String sinkBufferFlushMaxSize;
+
+    @ApiModelProperty("Zookeeper znode parent")
+    private String zookeeperZnodeParent;
+
+    @ApiModelProperty("Sink buffer flush max rows")
+    private String sinkBufferFlushMaxRows;
+
+    @ApiModelProperty("Sink buffer flush interval")
+    private String sinkBufferFlushInterval;
+
+    @ApiModelProperty("Create table or not")
+    private boolean needCreated;
+
+    @ApiModelProperty("Field definitions for hive")

Review Comment:
   `hive` should be `hbase`. Please attention annotate.



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] woofyzhao commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r873361780


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+

Review Comment:
   Please add some java doc before classes and public/static methods.



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] healchow commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r874978338


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/util/LoadNodeUtils.java:
##########
@@ -161,6 +165,44 @@ public static HiveLoadNode createLoadNode(HiveSinkResponse hiveSinkResponse) {
         );
     }
 
+    public static HbaseLoadNode createLoadNode(HbaseSinkResponse hbaseSinkResponse) {

Review Comment:
   Please add Java doc for the static method, thanks.



##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/sink/hbase/HbaseSinkDTO.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.inlong.manager.common.pojo.sink.hbase;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+
+import javax.validation.constraints.NotNull;
+import java.util.Map;
+
+/**
+ * Hbase sink info
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class HbaseSinkDTO {
+
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;
+
+    @ApiModelProperty("Row key")
+    private String rowKey;
+
+    @ApiModelProperty("Zookeeper quorm")
+    private String zookeeperQuorum;
+
+    @ApiModelProperty("Sink buffer flush maxsize")
+    private String sinkBufferFlushMaxSize;
+
+    @ApiModelProperty("Zookeeper znode parent")
+    private String zookeeperZnodeParent;
+
+    @ApiModelProperty("Sink buffer flush max rows")
+    private String sinkBufferFlushMaxRows;
+
+    @ApiModelProperty("Sink buffer flush interval")
+    private String sinkBufferFlushInterval;
+
+    @ApiModelProperty("Properties for hbase")
+    private Map<String, Object> properties;
+
+    /**
+     * Get the dto instance from the request
+     */
+    public static HbaseSinkDTO getFromRequest(HbaseSinkRequest request) {
+        return HbaseSinkDTO.builder()
+                .tableName(request.getTableName())
+                .nameSpace(request.getNameSpace())
+                .rowKey(request.getRowKey())
+                .zookeeperQuorum(request.getZookeeperQuorum())
+                .sinkBufferFlushMaxSize(request.getSinkBufferFlushMaxSize())
+                .zookeeperZnodeParent(request.getZookeeperZnodeParent())
+                .sinkBufferFlushMaxRows(request.getSinkBufferFlushMaxRows())
+                .sinkBufferFlushInterval(request.getSinkBufferFlushInterval())
+                .properties(request.getProperties())
+                .build();
+    }
+
+    public static HbaseSinkDTO getFromJson(@NotNull String extParams) {

Review Comment:
   Please add Java doc for the static method, thanks.



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongStreamSinkTransfer.java:
##########
@@ -207,6 +212,65 @@ private static StreamSink parseKafkaSink(KafkaSinkResponse sinkResponse, StreamS
         return kafkaSink;
     }
 
+    private static SinkRequest createHbaseRequest(StreamSink streamSink, InlongStreamInfo streamInfo) {

Review Comment:
   Please add Java doc for the static method, thanks.



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongStreamSinkTransfer.java:
##########
@@ -207,6 +212,65 @@ private static StreamSink parseKafkaSink(KafkaSinkResponse sinkResponse, StreamS
         return kafkaSink;
     }
 
+    private static SinkRequest createHbaseRequest(StreamSink streamSink, InlongStreamInfo streamInfo) {
+        HbaseSinkRequest hbaseSinkRequest = new HbaseSinkRequest();
+        HbaseSink hbaseSink = (HbaseSink) streamSink;
+        hbaseSinkRequest.setInlongGroupId(streamInfo.getInlongGroupId());
+        hbaseSinkRequest.setInlongStreamId(streamInfo.getInlongStreamId());
+        hbaseSinkRequest.setNameSpace(hbaseSink.getNameSpace());
+        hbaseSinkRequest.setTableName(hbaseSink.getTableName());
+        hbaseSinkRequest.setRowKey(hbaseSink.getRowKey());
+        hbaseSinkRequest.setZookeeperQuorum(hbaseSink.getZookeeperQuorum());
+        hbaseSinkRequest.setZookeeperZnodeParent(hbaseSink.getZookeeperZnodeParent());
+        hbaseSinkRequest.setSinkBufferFlushInterval(hbaseSink.getSinkBufferFlushInterval());
+        hbaseSinkRequest.setSinkBufferFlushMaxRows(hbaseSink.getSinkBufferFlushMaxRows());
+        hbaseSinkRequest.setSinkBufferFlushMaxSize(hbaseSink.getSinkBufferFlushMaxSize());
+        hbaseSinkRequest.setSinkType(hbaseSink.getSinkType().name());
+        hbaseSinkRequest.setEnableCreateResource(hbaseSink.isNeedCreated() ? 1 : 0);
+        hbaseSinkRequest.setProperties(hbaseSink.getProperties());
+        if (CollectionUtils.isNotEmpty(hbaseSink.getSinkFields())) {
+            List<SinkFieldRequest> fieldRequests = createSinkFieldRequests(hbaseSink.getSinkFields());
+            hbaseSinkRequest.setFieldList(fieldRequests);
+        }
+        return hbaseSinkRequest;
+
+    }
+
+    private static StreamSink parseHbaseSink(HbaseSinkResponse sinkResponse, StreamSink sink) {

Review Comment:
   Please add Java doc for the static method, thanks.



##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hbase/HbaseSinkOperation.java:
##########
@@ -0,0 +1,233 @@
+/*
+ * 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.inlong.manager.service.sink.hbase;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.enums.GlobalConstants;
+import org.apache.inlong.manager.common.enums.SinkStatus;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkDTO;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkResponse;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.Preconditions;
+import org.apache.inlong.manager.dao.entity.StreamSinkEntity;
+import org.apache.inlong.manager.dao.entity.StreamSinkFieldEntity;
+import org.apache.inlong.manager.dao.mapper.StreamSinkEntityMapper;
+import org.apache.inlong.manager.dao.mapper.StreamSinkFieldEntityMapper;
+import org.apache.inlong.manager.service.sink.StreamSinkOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.function.Supplier;
+
+/**
+ * Hbase sink operation
+ */
+@Service
+public class HbaseSinkOperation implements StreamSinkOperation {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HbaseSinkOperation.class);
+
+    @Autowired
+    private ObjectMapper objectMapper;
+    @Autowired
+    private StreamSinkEntityMapper sinkMapper;
+    @Autowired
+    private StreamSinkFieldEntityMapper sinkFieldMapper;
+
+    @Override
+    public Boolean accept(SinkType sinkType) {
+        return SinkType.HBASE.equals(sinkType);
+    }
+
+    @Override
+    public Integer saveOpt(SinkRequest request, String operator) {
+        String sinkType = request.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(sinkType),
+                ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT.getMessage() + ": " + sinkType);
+
+        HbaseSinkRequest hbaseSinkRequest = (HbaseSinkRequest) request;
+        StreamSinkEntity entity = CommonBeanUtils.copyProperties(hbaseSinkRequest, StreamSinkEntity::new);
+        entity.setStatus(SinkStatus.NEW.getCode());
+        entity.setIsDeleted(GlobalConstants.UN_DELETED);
+        entity.setCreator(operator);
+        entity.setModifier(operator);
+        Date now = new Date();
+        entity.setCreateTime(now);
+        entity.setModifyTime(now);
+
+        // get the ext params
+        HbaseSinkDTO dto = HbaseSinkDTO.getFromRequest(hbaseSinkRequest);
+        try {
+            entity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SINK_SAVE_FAILED);
+        }
+        sinkMapper.insert(entity);
+        Integer sinkId = entity.getId();
+        request.setId(sinkId);
+        this.saveFieldOpt(request);
+        return sinkId;
+    }
+
+    @Override
+    public void saveFieldOpt(SinkRequest request) {
+        List<SinkFieldRequest> fieldList = request.getFieldList();
+        LOGGER.info("begin to save hbase field={}", fieldList);
+        if (CollectionUtils.isEmpty(fieldList)) {
+            return;
+        }
+        int size = fieldList.size();
+        List<StreamSinkFieldEntity> entityList = new ArrayList<>(size);
+        String groupId = request.getInlongGroupId();
+        String streamId = request.getInlongStreamId();
+        String sinkType = request.getSinkType();
+        Integer sinkId = request.getId();
+        for (SinkFieldRequest fieldInfo : fieldList) {
+            StreamSinkFieldEntity fieldEntity = CommonBeanUtils.copyProperties(fieldInfo, StreamSinkFieldEntity::new);
+            if (StringUtils.isEmpty(fieldEntity.getFieldComment())) {
+                fieldEntity.setFieldComment(fieldEntity.getFieldName());
+            }
+            fieldEntity.setInlongGroupId(groupId);
+            fieldEntity.setInlongStreamId(streamId);
+            fieldEntity.setSinkType(sinkType);
+            fieldEntity.setSinkId(sinkId);
+            fieldEntity.setIsDeleted(GlobalConstants.UN_DELETED);
+            entityList.add(fieldEntity);
+        }
+
+        sinkFieldMapper.insertAll(entityList);
+        LOGGER.info("success to save hive field");
+    }
+
+    @Override
+    public SinkResponse getByEntity(StreamSinkEntity entity) {
+        Preconditions.checkNotNull(entity, ErrorCodeEnum.SINK_INFO_NOT_FOUND.getMessage());
+        String existType = entity.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(existType),
+                String.format(ErrorCodeEnum.SINK_TYPE_NOT_SAME.getMessage(), SinkType.SINK_HBASE, existType));
+
+        SinkResponse response = this.getFromEntity(entity, HbaseSinkResponse::new);
+        List<StreamSinkFieldEntity> entities = sinkFieldMapper.selectBySinkId(entity.getId());
+        List<SinkFieldResponse> infos = CommonBeanUtils.copyListProperties(entities,
+                SinkFieldResponse::new);
+        response.setFieldList(infos);
+
+        return response;
+    }
+
+    @Override
+    public <T> T getFromEntity(StreamSinkEntity entity, Supplier<T> target) {
+        T result = target.get();
+        if (entity == null) {
+            return result;
+        }
+
+        String existType = entity.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(existType),
+                String.format(ErrorCodeEnum.SINK_TYPE_NOT_SAME.getMessage(), SinkType.SINK_HBASE, existType));
+
+        HbaseSinkDTO dto = HbaseSinkDTO.getFromJson(entity.getExtParams());
+        CommonBeanUtils.copyProperties(entity, result, true);
+        CommonBeanUtils.copyProperties(dto, result, true);
+
+        return result;
+    }
+
+    @Override
+    public PageInfo<? extends SinkListResponse> getPageInfo(Page<StreamSinkEntity> entityPage) {
+        if (CollectionUtils.isEmpty(entityPage)) {
+            return new PageInfo<>();
+        }
+        return entityPage.toPageInfo(entity -> this.getFromEntity(entity, HbaseSinkListResponse::new));
+    }
+
+    @Override
+    public void updateOpt(SinkRequest request, String operator) {
+        String sinkType = request.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(sinkType),
+                String.format(ErrorCodeEnum.SINK_TYPE_NOT_SAME.getMessage(), SinkType.SINK_HBASE, sinkType));
+
+        StreamSinkEntity entity = sinkMapper.selectByPrimaryKey(request.getId());
+        Preconditions.checkNotNull(entity, ErrorCodeEnum.SINK_INFO_NOT_FOUND.getMessage());
+        HbaseSinkRequest hbaseSinkRequest = (HbaseSinkRequest) request;
+        CommonBeanUtils.copyProperties(hbaseSinkRequest, entity, true);
+        try {
+            HbaseSinkDTO dto = HbaseSinkDTO.getFromRequest(hbaseSinkRequest);
+            entity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SINK_INFO_INCORRECT.getMessage());
+        }
+
+        entity.setPreviousStatus(entity.getStatus());
+        entity.setStatus(SinkStatus.CONFIG_ING.getCode());
+        entity.setModifier(operator);
+        entity.setModifyTime(new Date());
+        sinkMapper.updateByPrimaryKeySelective(entity);
+
+        boolean onlyAdd = SinkStatus.CONFIG_SUCCESSFUL.getCode().equals(entity.getPreviousStatus());
+        this.updateFieldOpt(onlyAdd, hbaseSinkRequest);
+
+        LOGGER.info("success to update sink of type={}", sinkType);
+

Review Comment:
   Remove the last unused line, thanks.



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r873500730


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Hive sink configuration")
+public class HbaseSink extends StreamSink {
+
+    @ApiModelProperty(value = "Sink type", required = true)
+    private SinkType sinkType = SinkType.HBASE;
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;
+
+    @ApiModelProperty("Row key")
+    private String rowKey;
+
+    @ApiModelProperty("Zookeeper quorm")
+    private String zookeeperQuorum;
+
+    @ApiModelProperty("Sink buffer flush maxsize")
+    private String sinkBufferFlushMaxSize;
+
+    @ApiModelProperty("Zookeeper znode parent")
+    private String zookeeperZnodeParent;
+
+    @ApiModelProperty("Sink buffer flush max rows")
+    private String sinkBufferFlushMaxRows;
+
+    @ApiModelProperty("Sink buffer flush interval")
+    private String sinkBufferFlushInterval;
+
+    @ApiModelProperty("Create table or not")
+    private boolean needCreated;
+
+    @ApiModelProperty("Field definitions for hive")

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] healchow merged pull request #4211: [INLONG-4197][Manager] Add Hbase sink info and load node utils

Posted by GitBox <gi...@apache.org>.
healchow merged PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211


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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] woofyzhao commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r874431788


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hbase/HbaseSinkOperation.java:
##########
@@ -0,0 +1,233 @@
+/*
+ * 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.inlong.manager.service.sink.hbase;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.enums.GlobalConstants;
+import org.apache.inlong.manager.common.enums.SinkStatus;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkDTO;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkResponse;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.Preconditions;
+import org.apache.inlong.manager.dao.entity.StreamSinkEntity;
+import org.apache.inlong.manager.dao.entity.StreamSinkFieldEntity;
+import org.apache.inlong.manager.dao.mapper.StreamSinkEntityMapper;
+import org.apache.inlong.manager.dao.mapper.StreamSinkFieldEntityMapper;
+import org.apache.inlong.manager.service.sink.StreamSinkOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.function.Supplier;
+
+/**
+ * Hbase sink operation
+ */
+@Service
+public class HbaseSinkOperation implements StreamSinkOperation {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HbaseSinkOperation.class);
+
+    @Autowired
+    private ObjectMapper objectMapper;
+    @Autowired
+    private StreamSinkEntityMapper sinkMapper;
+    @Autowired
+    private StreamSinkFieldEntityMapper sinkFieldMapper;
+
+    @Override
+    public Boolean accept(SinkType sinkType) {
+        return SinkType.HBASE.equals(sinkType);
+    }
+
+    @Override
+    public Integer saveOpt(SinkRequest request, String operator) {
+        String sinkType = request.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(sinkType),
+                ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT.getMessage() + ": " + sinkType);
+
+        HbaseSinkRequest hbaseSinkRequest = (HbaseSinkRequest) request;
+        StreamSinkEntity entity = CommonBeanUtils.copyProperties(hbaseSinkRequest, StreamSinkEntity::new);
+        entity.setStatus(SinkStatus.NEW.getCode());
+        entity.setIsDeleted(GlobalConstants.UN_DELETED);
+        entity.setCreator(operator);
+        entity.setModifier(operator);
+        Date now = new Date();
+        entity.setCreateTime(now);
+        entity.setModifyTime(now);
+
+        // get the ext params
+        HbaseSinkDTO dto = HbaseSinkDTO.getFromRequest(hbaseSinkRequest);
+        try {
+            entity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SINK_SAVE_FAILED);
+        }
+        sinkMapper.insert(entity);
+        Integer sinkId = entity.getId();
+        request.setId(sinkId);
+        this.saveFieldOpt(request);
+        return sinkId;
+    }
+
+    @Override
+    public void saveFieldOpt(SinkRequest request) {
+        List<SinkFieldRequest> fieldList = request.getFieldList();
+        LOGGER.info("begin to save hbase field={}", fieldList);
+        if (CollectionUtils.isEmpty(fieldList)) {
+            return;
+        }
+        int size = fieldList.size();
+        List<StreamSinkFieldEntity> entityList = new ArrayList<>(size);
+        String groupId = request.getInlongGroupId();
+        String streamId = request.getInlongStreamId();
+        String sinkType = request.getSinkType();
+        Integer sinkId = request.getId();
+        for (SinkFieldRequest fieldInfo : fieldList) {
+            StreamSinkFieldEntity fieldEntity = CommonBeanUtils.copyProperties(fieldInfo, StreamSinkFieldEntity::new);
+            if (StringUtils.isEmpty(fieldEntity.getFieldComment())) {
+                fieldEntity.setFieldComment(fieldEntity.getFieldName());
+            }
+            fieldEntity.setInlongGroupId(groupId);
+            fieldEntity.setInlongStreamId(streamId);
+            fieldEntity.setSinkType(sinkType);
+            fieldEntity.setSinkId(sinkId);
+            fieldEntity.setIsDeleted(GlobalConstants.UN_DELETED);
+            entityList.add(fieldEntity);
+        }
+
+        sinkFieldMapper.insertAll(entityList);
+        LOGGER.info("success to save hive field");

Review Comment:
   not hive



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Add Hbase sink info and load node utils

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r875582899


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongStreamSinkTransfer.java:
##########
@@ -207,6 +212,65 @@ private static StreamSink parseKafkaSink(KafkaSinkResponse sinkResponse, StreamS
         return kafkaSink;
     }
 
+    private static SinkRequest createHbaseRequest(StreamSink streamSink, InlongStreamInfo streamInfo) {

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] healchow commented on a diff in pull request #4211: [INLONG-4197][Manager] Add Hbase sink info and load node utils

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r875959496


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/sink/hbase/HbaseSinkDTO.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.inlong.manager.common.pojo.sink.hbase;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+
+import javax.validation.constraints.NotNull;
+import java.util.Map;
+
+/**
+ * Hbase sink info
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class HbaseSinkDTO {
+
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;

Review Comment:
   Please change to `namespace`, thanks.



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+
+/**
+ * Hbase sink.
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Hbase sink configuration")
+public class HbaseSink extends StreamSink {
+
+    @ApiModelProperty(value = "Sink type", required = true)
+    private SinkType sinkType = SinkType.HBASE;
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;
+
+    @ApiModelProperty("Row key")
+    private String rowKey;
+
+    @ApiModelProperty("Zookeeper quorm")
+    private String zookeeperQuorum;
+
+    @ApiModelProperty("Sink buffer flush maxsize")
+    private String sinkBufferFlushMaxSize;
+
+    @ApiModelProperty("Zookeeper znode parent")
+    private String zookeeperZnodeParent;
+
+    @ApiModelProperty("Sink buffer flush max rows")
+    private String sinkBufferFlushMaxRows;
+
+    @ApiModelProperty("Sink buffer flush interval")
+    private String sinkBufferFlushInterval;
+
+    @ApiModelProperty("Create table or not")
+    private boolean needCreated;
+
+    @ApiModelProperty("Field definitions for hbase")
+    private List<SinkField> sinkFields;
+
+    @ApiModelProperty("Data format type for stream sink")
+    private DataFormat dataFormat;

Review Comment:
   Did this filed needed for HBase sink?



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+
+/**
+ * Hbase sink.
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Hbase sink configuration")
+public class HbaseSink extends StreamSink {
+
+    @ApiModelProperty(value = "Sink type", required = true)
+    private SinkType sinkType = SinkType.HBASE;
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;

Review Comment:
   Please change to `namespace`.



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Add Hbase sink info and load node utils

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r875582608


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/util/LoadNodeUtils.java:
##########
@@ -161,6 +165,44 @@ public static HiveLoadNode createLoadNode(HiveSinkResponse hiveSinkResponse) {
         );
     }
 
+    public static HbaseLoadNode createLoadNode(HbaseSinkResponse hbaseSinkResponse) {

Review Comment:
   done



##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/sink/hbase/HbaseSinkDTO.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.inlong.manager.common.pojo.sink.hbase;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+
+import javax.validation.constraints.NotNull;
+import java.util.Map;
+
+/**
+ * Hbase sink info
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class HbaseSinkDTO {
+
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+    @ApiModelProperty("Target table name")
+    private String tableName;
+
+    @ApiModelProperty("Namespace")
+    private String nameSpace;
+
+    @ApiModelProperty("Row key")
+    private String rowKey;
+
+    @ApiModelProperty("Zookeeper quorm")
+    private String zookeeperQuorum;
+
+    @ApiModelProperty("Sink buffer flush maxsize")
+    private String sinkBufferFlushMaxSize;
+
+    @ApiModelProperty("Zookeeper znode parent")
+    private String zookeeperZnodeParent;
+
+    @ApiModelProperty("Sink buffer flush max rows")
+    private String sinkBufferFlushMaxRows;
+
+    @ApiModelProperty("Sink buffer flush interval")
+    private String sinkBufferFlushInterval;
+
+    @ApiModelProperty("Properties for hbase")
+    private Map<String, Object> properties;
+
+    /**
+     * Get the dto instance from the request
+     */
+    public static HbaseSinkDTO getFromRequest(HbaseSinkRequest request) {
+        return HbaseSinkDTO.builder()
+                .tableName(request.getTableName())
+                .nameSpace(request.getNameSpace())
+                .rowKey(request.getRowKey())
+                .zookeeperQuorum(request.getZookeeperQuorum())
+                .sinkBufferFlushMaxSize(request.getSinkBufferFlushMaxSize())
+                .zookeeperZnodeParent(request.getZookeeperZnodeParent())
+                .sinkBufferFlushMaxRows(request.getSinkBufferFlushMaxRows())
+                .sinkBufferFlushInterval(request.getSinkBufferFlushInterval())
+                .properties(request.getProperties())
+                .build();
+    }
+
+    public static HbaseSinkDTO getFromJson(@NotNull String extParams) {

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r874443656


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hbase/HbaseSinkOperation.java:
##########
@@ -0,0 +1,233 @@
+/*
+ * 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.inlong.manager.service.sink.hbase;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.enums.GlobalConstants;
+import org.apache.inlong.manager.common.enums.SinkStatus;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkDTO;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkResponse;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.Preconditions;
+import org.apache.inlong.manager.dao.entity.StreamSinkEntity;
+import org.apache.inlong.manager.dao.entity.StreamSinkFieldEntity;
+import org.apache.inlong.manager.dao.mapper.StreamSinkEntityMapper;
+import org.apache.inlong.manager.dao.mapper.StreamSinkFieldEntityMapper;
+import org.apache.inlong.manager.service.sink.StreamSinkOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.function.Supplier;
+
+/**
+ * Hbase sink operation
+ */
+@Service
+public class HbaseSinkOperation implements StreamSinkOperation {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HbaseSinkOperation.class);
+
+    @Autowired
+    private ObjectMapper objectMapper;
+    @Autowired
+    private StreamSinkEntityMapper sinkMapper;
+    @Autowired
+    private StreamSinkFieldEntityMapper sinkFieldMapper;
+
+    @Override
+    public Boolean accept(SinkType sinkType) {
+        return SinkType.HBASE.equals(sinkType);
+    }
+
+    @Override
+    public Integer saveOpt(SinkRequest request, String operator) {
+        String sinkType = request.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(sinkType),
+                ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT.getMessage() + ": " + sinkType);
+
+        HbaseSinkRequest hbaseSinkRequest = (HbaseSinkRequest) request;
+        StreamSinkEntity entity = CommonBeanUtils.copyProperties(hbaseSinkRequest, StreamSinkEntity::new);
+        entity.setStatus(SinkStatus.NEW.getCode());
+        entity.setIsDeleted(GlobalConstants.UN_DELETED);
+        entity.setCreator(operator);
+        entity.setModifier(operator);
+        Date now = new Date();
+        entity.setCreateTime(now);
+        entity.setModifyTime(now);
+
+        // get the ext params
+        HbaseSinkDTO dto = HbaseSinkDTO.getFromRequest(hbaseSinkRequest);
+        try {
+            entity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SINK_SAVE_FAILED);
+        }
+        sinkMapper.insert(entity);
+        Integer sinkId = entity.getId();
+        request.setId(sinkId);
+        this.saveFieldOpt(request);
+        return sinkId;
+    }
+
+    @Override
+    public void saveFieldOpt(SinkRequest request) {
+        List<SinkFieldRequest> fieldList = request.getFieldList();
+        LOGGER.info("begin to save hbase field={}", fieldList);
+        if (CollectionUtils.isEmpty(fieldList)) {
+            return;
+        }
+        int size = fieldList.size();
+        List<StreamSinkFieldEntity> entityList = new ArrayList<>(size);
+        String groupId = request.getInlongGroupId();
+        String streamId = request.getInlongStreamId();
+        String sinkType = request.getSinkType();
+        Integer sinkId = request.getId();
+        for (SinkFieldRequest fieldInfo : fieldList) {
+            StreamSinkFieldEntity fieldEntity = CommonBeanUtils.copyProperties(fieldInfo, StreamSinkFieldEntity::new);
+            if (StringUtils.isEmpty(fieldEntity.getFieldComment())) {
+                fieldEntity.setFieldComment(fieldEntity.getFieldName());
+            }
+            fieldEntity.setInlongGroupId(groupId);
+            fieldEntity.setInlongStreamId(streamId);
+            fieldEntity.setSinkType(sinkType);
+            fieldEntity.setSinkId(sinkId);
+            fieldEntity.setIsDeleted(GlobalConstants.UN_DELETED);
+            entityList.add(fieldEntity);
+        }
+
+        sinkFieldMapper.insertAll(entityList);
+        LOGGER.info("success to save hive field");

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Add Hbase sink info and load node utils

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r875676944


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongStreamSinkTransfer.java:
##########
@@ -207,6 +212,65 @@ private static StreamSink parseKafkaSink(KafkaSinkResponse sinkResponse, StreamS
         return kafkaSink;
     }
 
+    private static SinkRequest createHbaseRequest(StreamSink streamSink, InlongStreamInfo streamInfo) {
+        HbaseSinkRequest hbaseSinkRequest = new HbaseSinkRequest();
+        HbaseSink hbaseSink = (HbaseSink) streamSink;
+        hbaseSinkRequest.setInlongGroupId(streamInfo.getInlongGroupId());
+        hbaseSinkRequest.setInlongStreamId(streamInfo.getInlongStreamId());
+        hbaseSinkRequest.setNameSpace(hbaseSink.getNameSpace());
+        hbaseSinkRequest.setTableName(hbaseSink.getTableName());
+        hbaseSinkRequest.setRowKey(hbaseSink.getRowKey());
+        hbaseSinkRequest.setZookeeperQuorum(hbaseSink.getZookeeperQuorum());
+        hbaseSinkRequest.setZookeeperZnodeParent(hbaseSink.getZookeeperZnodeParent());
+        hbaseSinkRequest.setSinkBufferFlushInterval(hbaseSink.getSinkBufferFlushInterval());
+        hbaseSinkRequest.setSinkBufferFlushMaxRows(hbaseSink.getSinkBufferFlushMaxRows());
+        hbaseSinkRequest.setSinkBufferFlushMaxSize(hbaseSink.getSinkBufferFlushMaxSize());
+        hbaseSinkRequest.setSinkType(hbaseSink.getSinkType().name());
+        hbaseSinkRequest.setEnableCreateResource(hbaseSink.isNeedCreated() ? 1 : 0);
+        hbaseSinkRequest.setProperties(hbaseSink.getProperties());
+        if (CollectionUtils.isNotEmpty(hbaseSink.getSinkFields())) {
+            List<SinkFieldRequest> fieldRequests = createSinkFieldRequests(hbaseSink.getSinkFields());
+            hbaseSinkRequest.setFieldList(fieldRequests);
+        }
+        return hbaseSinkRequest;
+
+    }
+
+    private static StreamSink parseHbaseSink(HbaseSinkResponse sinkResponse, StreamSink sink) {

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Add Hbase sink info and load node utils

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r875678136


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hbase/HbaseSinkOperation.java:
##########
@@ -0,0 +1,233 @@
+/*
+ * 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.inlong.manager.service.sink.hbase;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.enums.GlobalConstants;
+import org.apache.inlong.manager.common.enums.SinkStatus;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkFieldResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.SinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.SinkResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkDTO;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkListResponse;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkRequest;
+import org.apache.inlong.manager.common.pojo.sink.hbase.HbaseSinkResponse;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.Preconditions;
+import org.apache.inlong.manager.dao.entity.StreamSinkEntity;
+import org.apache.inlong.manager.dao.entity.StreamSinkFieldEntity;
+import org.apache.inlong.manager.dao.mapper.StreamSinkEntityMapper;
+import org.apache.inlong.manager.dao.mapper.StreamSinkFieldEntityMapper;
+import org.apache.inlong.manager.service.sink.StreamSinkOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.function.Supplier;
+
+/**
+ * Hbase sink operation
+ */
+@Service
+public class HbaseSinkOperation implements StreamSinkOperation {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HbaseSinkOperation.class);
+
+    @Autowired
+    private ObjectMapper objectMapper;
+    @Autowired
+    private StreamSinkEntityMapper sinkMapper;
+    @Autowired
+    private StreamSinkFieldEntityMapper sinkFieldMapper;
+
+    @Override
+    public Boolean accept(SinkType sinkType) {
+        return SinkType.HBASE.equals(sinkType);
+    }
+
+    @Override
+    public Integer saveOpt(SinkRequest request, String operator) {
+        String sinkType = request.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(sinkType),
+                ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT.getMessage() + ": " + sinkType);
+
+        HbaseSinkRequest hbaseSinkRequest = (HbaseSinkRequest) request;
+        StreamSinkEntity entity = CommonBeanUtils.copyProperties(hbaseSinkRequest, StreamSinkEntity::new);
+        entity.setStatus(SinkStatus.NEW.getCode());
+        entity.setIsDeleted(GlobalConstants.UN_DELETED);
+        entity.setCreator(operator);
+        entity.setModifier(operator);
+        Date now = new Date();
+        entity.setCreateTime(now);
+        entity.setModifyTime(now);
+
+        // get the ext params
+        HbaseSinkDTO dto = HbaseSinkDTO.getFromRequest(hbaseSinkRequest);
+        try {
+            entity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SINK_SAVE_FAILED);
+        }
+        sinkMapper.insert(entity);
+        Integer sinkId = entity.getId();
+        request.setId(sinkId);
+        this.saveFieldOpt(request);
+        return sinkId;
+    }
+
+    @Override
+    public void saveFieldOpt(SinkRequest request) {
+        List<SinkFieldRequest> fieldList = request.getFieldList();
+        LOGGER.info("begin to save hbase field={}", fieldList);
+        if (CollectionUtils.isEmpty(fieldList)) {
+            return;
+        }
+        int size = fieldList.size();
+        List<StreamSinkFieldEntity> entityList = new ArrayList<>(size);
+        String groupId = request.getInlongGroupId();
+        String streamId = request.getInlongStreamId();
+        String sinkType = request.getSinkType();
+        Integer sinkId = request.getId();
+        for (SinkFieldRequest fieldInfo : fieldList) {
+            StreamSinkFieldEntity fieldEntity = CommonBeanUtils.copyProperties(fieldInfo, StreamSinkFieldEntity::new);
+            if (StringUtils.isEmpty(fieldEntity.getFieldComment())) {
+                fieldEntity.setFieldComment(fieldEntity.getFieldName());
+            }
+            fieldEntity.setInlongGroupId(groupId);
+            fieldEntity.setInlongStreamId(streamId);
+            fieldEntity.setSinkType(sinkType);
+            fieldEntity.setSinkId(sinkId);
+            fieldEntity.setIsDeleted(GlobalConstants.UN_DELETED);
+            entityList.add(fieldEntity);
+        }
+
+        sinkFieldMapper.insertAll(entityList);
+        LOGGER.info("success to save hive field");
+    }
+
+    @Override
+    public SinkResponse getByEntity(StreamSinkEntity entity) {
+        Preconditions.checkNotNull(entity, ErrorCodeEnum.SINK_INFO_NOT_FOUND.getMessage());
+        String existType = entity.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(existType),
+                String.format(ErrorCodeEnum.SINK_TYPE_NOT_SAME.getMessage(), SinkType.SINK_HBASE, existType));
+
+        SinkResponse response = this.getFromEntity(entity, HbaseSinkResponse::new);
+        List<StreamSinkFieldEntity> entities = sinkFieldMapper.selectBySinkId(entity.getId());
+        List<SinkFieldResponse> infos = CommonBeanUtils.copyListProperties(entities,
+                SinkFieldResponse::new);
+        response.setFieldList(infos);
+
+        return response;
+    }
+
+    @Override
+    public <T> T getFromEntity(StreamSinkEntity entity, Supplier<T> target) {
+        T result = target.get();
+        if (entity == null) {
+            return result;
+        }
+
+        String existType = entity.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(existType),
+                String.format(ErrorCodeEnum.SINK_TYPE_NOT_SAME.getMessage(), SinkType.SINK_HBASE, existType));
+
+        HbaseSinkDTO dto = HbaseSinkDTO.getFromJson(entity.getExtParams());
+        CommonBeanUtils.copyProperties(entity, result, true);
+        CommonBeanUtils.copyProperties(dto, result, true);
+
+        return result;
+    }
+
+    @Override
+    public PageInfo<? extends SinkListResponse> getPageInfo(Page<StreamSinkEntity> entityPage) {
+        if (CollectionUtils.isEmpty(entityPage)) {
+            return new PageInfo<>();
+        }
+        return entityPage.toPageInfo(entity -> this.getFromEntity(entity, HbaseSinkListResponse::new));
+    }
+
+    @Override
+    public void updateOpt(SinkRequest request, String operator) {
+        String sinkType = request.getSinkType();
+        Preconditions.checkTrue(SinkType.SINK_HBASE.equals(sinkType),
+                String.format(ErrorCodeEnum.SINK_TYPE_NOT_SAME.getMessage(), SinkType.SINK_HBASE, sinkType));
+
+        StreamSinkEntity entity = sinkMapper.selectByPrimaryKey(request.getId());
+        Preconditions.checkNotNull(entity, ErrorCodeEnum.SINK_INFO_NOT_FOUND.getMessage());
+        HbaseSinkRequest hbaseSinkRequest = (HbaseSinkRequest) request;
+        CommonBeanUtils.copyProperties(hbaseSinkRequest, entity, true);
+        try {
+            HbaseSinkDTO dto = HbaseSinkDTO.getFromRequest(hbaseSinkRequest);
+            entity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SINK_INFO_INCORRECT.getMessage());
+        }
+
+        entity.setPreviousStatus(entity.getStatus());
+        entity.setStatus(SinkStatus.CONFIG_ING.getCode());
+        entity.setModifier(operator);
+        entity.setModifyTime(new Date());
+        sinkMapper.updateByPrimaryKeySelective(entity);
+
+        boolean onlyAdd = SinkStatus.CONFIG_SUCCESSFUL.getCode().equals(entity.getPreviousStatus());
+        this.updateFieldOpt(onlyAdd, hbaseSinkRequest);
+
+        LOGGER.info("success to update sink of type={}", sinkType);
+

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] LvJiancheng commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
LvJiancheng commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r873501414


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+

Review Comment:
   ok 



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] woofyzhao commented on a diff in pull request #4211: [INLONG-4197][Manager] Adaptive Hbase load node

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #4211:
URL: https://github.com/apache/incubator-inlong/pull/4211#discussion_r874432168


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/sink/HbaseSink.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.inlong.manager.client.api.sink;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.DataFormat;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.pojo.stream.SinkField;
+import org.apache.inlong.manager.common.pojo.stream.StreamSink;
+
+import java.util.List;
+
+/**
+ * Hbase sink.
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Hive sink configuration")

Review Comment:
   not Hive



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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org