This is an automated email from the ASF dual-hosted git repository.
bowenliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 70e0302c02 [KYUUBI #6727] replace immutable empty list and map in
BatchRequest initialization
70e0302c02 is described below
commit 70e0302c02ace3c013df132b8ea5e5dcc81e85ff
Author: Bowen Liang <[email protected]>
AuthorDate: Tue Oct 15 17:02:13 2024 +0800
[KYUUBI #6727] replace immutable empty list and map in BatchRequest
initialization
# :mag: Description
## Issue References ๐
This pull request fixes #
## Describe Your Solution ๐ง
- replace immutable empty list and map with mutable one for BatchRequest
initialization, for easier BatchRequest construction for rest-client use
## Types of changes :bookmark:
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
#### Related Unit Tests
---
# Checklist ๐
- [ ] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6727 from bowenliang123/batchapi-emptylist.
Closes #6727
9d6a04c8a [Bowen Liang] update
Authored-by: Bowen Liang <[email protected]>
Signed-off-by: Bowen Liang <[email protected]>
---
.../org/apache/kyuubi/client/api/v1/dto/BatchRequest.java | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git
a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/BatchRequest.java
b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/BatchRequest.java
index ac9850498d..2e6da91611 100644
---
a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/BatchRequest.java
+++
b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/BatchRequest.java
@@ -17,10 +17,7 @@
package org.apache.kyuubi.client.api.v1.dto;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -29,9 +26,9 @@ public class BatchRequest {
private String resource;
private String className;
private String name;
- private Map<String, String> conf = Collections.emptyMap();
- private List<String> args = Collections.emptyList();
- private Map<String, String> extraResourcesMap = Collections.emptyMap();
+ private Map<String, String> conf = new HashMap<>(0);
+ private List<String> args = new ArrayList<>(0);
+ private Map<String, String> extraResourcesMap = new HashMap<>(0);
public BatchRequest() {}
@@ -91,7 +88,7 @@ public class BatchRequest {
public Map<String, String> getConf() {
if (null == conf) {
- return Collections.emptyMap();
+ return new HashMap<>(0);
}
return conf;
}
@@ -102,7 +99,7 @@ public class BatchRequest {
public List<String> getArgs() {
if (null == args) {
- return Collections.emptyList();
+ return new ArrayList<>(0);
}
return args;
}