fuweng11 commented on code in PR #7282:
URL: https://github.com/apache/inlong/pull/7282#discussion_r1090138816


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/HeartbeatImpl.java:
##########
@@ -45,55 +45,55 @@ public HeartbeatImpl(ClientConfiguration configuration) {
 
     @Override
     public ComponentHeartbeatResponse 
getComponentHeartbeat(HeartbeatQueryRequest request) {
-        Preconditions.checkNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
+        Preconditions.expectNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
 
         return heartbeatClient.getComponentHeartbeat(request);
     }
 
     @Override
     public GroupHeartbeatResponse getGroupHeartbeat(HeartbeatQueryRequest 
request) {
-        Preconditions.checkNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInlongGroupId(), 
ErrorCodeEnum.GROUP_ID_IS_EMPTY.getMessage());
+        Preconditions.expectNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());

Review Comment:
   `Preconditions.expectNotBlank`.



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/DataNodeImpl.java:
##########
@@ -38,36 +38,36 @@ public DataNodeImpl(ClientConfiguration configuration) {
 
     @Override
     public Integer save(DataNodeRequest request) {
-        Preconditions.checkNotNull(request, "request cannot be null");
-        Preconditions.checkNotEmpty(request.getName(), "data node name cannot 
be empty");
-        Preconditions.checkNotEmpty(request.getType(), "data node type cannot 
be empty");
+        Preconditions.expectNotNull(request, "request cannot be null");
+        Preconditions.expectNotEmpty(request.getName(), "data node name cannot 
be empty");

Review Comment:
   `Preconditions.expectNotBlank`.



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/HeartbeatImpl.java:
##########
@@ -45,55 +45,55 @@ public HeartbeatImpl(ClientConfiguration configuration) {
 
     @Override
     public ComponentHeartbeatResponse 
getComponentHeartbeat(HeartbeatQueryRequest request) {
-        Preconditions.checkNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
+        Preconditions.expectNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
 
         return heartbeatClient.getComponentHeartbeat(request);
     }
 
     @Override
     public GroupHeartbeatResponse getGroupHeartbeat(HeartbeatQueryRequest 
request) {
-        Preconditions.checkNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInlongGroupId(), 
ErrorCodeEnum.GROUP_ID_IS_EMPTY.getMessage());
+        Preconditions.expectNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getInlongGroupId(), 
ErrorCodeEnum.GROUP_ID_IS_EMPTY.getMessage());
 
         return heartbeatClient.getGroupHeartbeat(request);
     }
 
     @Override
     public StreamHeartbeatResponse getStreamHeartbeat(HeartbeatQueryRequest 
request) {
-        Preconditions.checkNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInstance(), 
ErrorCodeEnum.REQUEST_INSTANCE_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInlongGroupId(), 
ErrorCodeEnum.GROUP_ID_IS_EMPTY.getMessage());
-        Preconditions.checkNotEmpty(request.getInlongStreamId(), 
ErrorCodeEnum.STREAM_ID_IS_EMPTY.getMessage());
+        Preconditions.expectNotNull(request, 
ErrorCodeEnum.REQUEST_IS_EMPTY.getMessage());
+        Preconditions.expectNotEmpty(request.getComponent(), 
ErrorCodeEnum.REQUEST_COMPONENT_EMPTY.getMessage());

Review Comment:
   `Preconditions.expectNotBlank`.



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/DataNodeImpl.java:
##########
@@ -38,36 +38,36 @@ public DataNodeImpl(ClientConfiguration configuration) {
 
     @Override
     public Integer save(DataNodeRequest request) {
-        Preconditions.checkNotNull(request, "request cannot be null");
-        Preconditions.checkNotEmpty(request.getName(), "data node name cannot 
be empty");
-        Preconditions.checkNotEmpty(request.getType(), "data node type cannot 
be empty");
+        Preconditions.expectNotNull(request, "request cannot be null");
+        Preconditions.expectNotEmpty(request.getName(), "data node name cannot 
be empty");
+        Preconditions.expectNotEmpty(request.getType(), "data node type cannot 
be empty");
         return dataNodeClient.save(request);
     }
 
     @Override
     public DataNodeInfo get(Integer id) {
-        Preconditions.checkNotNull(id, "data node id cannot be null");
+        Preconditions.expectNotNull(id, "data node id cannot be null");
         return dataNodeClient.get(id);
     }
 
     @Override
     public PageResult<DataNodeInfo> list(DataNodeRequest request) {
-        Preconditions.checkNotNull(request, "request cannot be null");
+        Preconditions.expectNotNull(request, "request cannot be null");
         return dataNodeClient.list(request);
     }
 
     @Override
     public Boolean update(DataNodeRequest request) {
-        Preconditions.checkNotNull(request, "request cannot be null");
-        Preconditions.checkNotEmpty(request.getName(), "data node name cannot 
be empty");
-        Preconditions.checkNotEmpty(request.getType(), "data node type cannot 
be empty");
-        Preconditions.checkNotNull(request.getId(), "data node id cannot be 
null");
+        Preconditions.expectNotNull(request, "request cannot be null");
+        Preconditions.expectNotEmpty(request.getName(), "data node name cannot 
be empty");

Review Comment:
   `Preconditions.expectNotBlank`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to