This is an automated email from the ASF dual-hosted git repository.
gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 97f97bfdcd [INLONG-11830][SDK] Fix the NullPointerException while not
configure factory permits (#11832)
97f97bfdcd is described below
commit 97f97bfdcd02046f92de0f2f7ada3476f0f34273
Author: Goson Zhang <[email protected]>
AuthorDate: Wed Apr 16 19:19:40 2025 +0800
[INLONG-11830][SDK] Fix the NullPointerException while not configure
factory permits (#11832)
Co-authored-by: gosonzhang <[email protected]>
---
.../java/org/apache/inlong/sdk/dataproxy/sender/BaseSender.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git
a/inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/BaseSender.java
b/inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/BaseSender.java
index cb4d2bae29..9450bb032e 100644
---
a/inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/BaseSender.java
+++
b/inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/BaseSender.java
@@ -259,7 +259,7 @@ public abstract class BaseSender implements ConfigHolder {
}
public Tuple2<Integer, Integer> getFactoryAvailQuota() {
- if (senderFactory == null) {
+ if (senderFactory == null || globalCacheQuota == null) {
return PkgCacheQuota.DISABLE_RET;
}
return globalCacheQuota.getPkgCacheAvailQuota();
@@ -270,14 +270,16 @@ public abstract class BaseSender implements ConfigHolder {
}
public int getFactoryPkgCntPermits() {
- if (senderFactory == null) {
+ if (senderFactory == null
+ || senderFactory.getFactoryPkgCacheQuota() == null) {
return SdkConsts.UNDEFINED_VALUE;
}
return senderFactory.getFactoryPkgCacheQuota().getPkgCntPermits();
}
public int getFactoryPkgSizeKbPermits() {
- if (senderFactory == null) {
+ if (senderFactory == null
+ || senderFactory.getFactoryPkgCacheQuota() == null) {
return SdkConsts.UNDEFINED_VALUE;
}
return senderFactory.getFactoryPkgCacheQuota().getPkgSizeKbPermits();