This is an automated email from the ASF dual-hosted git repository.
JackieTien97 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new eef45ff778a Update thrift to 0.23.0 (#17945)
eef45ff778a is described below
commit eef45ff778aaacdfbb45361718de6a20ece78469
Author: Haonan <[email protected]>
AuthorDate: Mon Jun 22 14:15:01 2026 +0800
Update thrift to 0.23.0 (#17945)
---
.github/workflows/client-cpp-package.yml | 34 +++++++---
.github/workflows/multi-language-client.yml | 79 ++++++++++++++--------
LICENSE-binary | 2 +-
iotdb-client/jdbc/src/main/feature/feature.xml | 2 +-
.../iotdb/rpc/TNonblockingTransportWrapper.java | 4 +-
.../java/org/apache/iotdb/rpc/TSocketWrapper.java | 4 +-
.../thrift/ConfigNodeRPCServiceHandler.java | 3 +-
.../iot/service/IoTConsensusRPCServiceHandler.java | 4 +-
.../service/IoTConsensusV2RPCServiceHandler.java | 4 +-
.../thrift/handler/BaseServerContextHandler.java | 7 +-
.../handler/InternalServiceThriftHandler.java | 3 +-
.../MPPDataExchangeServiceThriftHandler.java | 3 +-
.../iotdb/commons/service/NoopServerContext.java | 48 +++++++++++++
.../client/mock/MockInternalRPCService.java | 7 +-
.../commons/service/NoopServerContextTest.java} | 44 +++++-------
pom.xml | 38 +++++------
16 files changed, 186 insertions(+), 100 deletions(-)
diff --git a/.github/workflows/client-cpp-package.yml
b/.github/workflows/client-cpp-package.yml
index 4eb889b0136..3c8c2b2844f 100644
--- a/.github/workflows/client-cpp-package.yml
+++ b/.github/workflows/client-cpp-package.yml
@@ -46,18 +46,32 @@ jobs:
steps:
- uses: actions/checkout@v5
if: github.event_name == 'push' && startsWith(github.ref,
'refs/heads/rc/')
- - uses: dorny/paths-filter@v3
+ with:
+ fetch-depth: 0
+ - name: Detect C++ package changes
id: filter
if: github.event_name == 'push' && startsWith(github.ref,
'refs/heads/rc/')
- with:
- filters: |
- cpp:
- - 'iotdb-client/client-cpp/**'
- - 'iotdb-client/pom.xml'
- - 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift'
- - 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift'
- - '.github/workflows/client-cpp-package.yml'
- - '.github/scripts/package-client-cpp-*.sh'
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ BASE="${{ github.event.before }}"
+ HEAD="${{ github.sha }}"
+ if [[ "$BASE" =~ ^0+$ ]]; then
+ BASE="$(git hash-object -t tree /dev/null)"
+ fi
+
+ cpp=false
+ while IFS= read -r file; do
+ case "$file" in
+
iotdb-client/client-cpp/*|iotdb-client/pom.xml|iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift|iotdb-protocol/thrift-commons/src/main/thrift/common.thrift|.github/workflows/client-cpp-package.yml|.github/scripts/package-client-cpp-*.sh)
+ cpp=true
+ break
+ ;;
+ esac
+ done < <(git diff --name-only "$BASE" "$HEAD")
+
+ echo "cpp=${cpp}" >> "$GITHUB_OUTPUT"
- id: result
shell: bash
run: |
diff --git a/.github/workflows/multi-language-client.yml
b/.github/workflows/multi-language-client.yml
index 50840ca75ec..16c6d93ae2d 100644
--- a/.github/workflows/multi-language-client.yml
+++ b/.github/workflows/multi-language-client.yml
@@ -1,4 +1,4 @@
-# Shared client CI: run only affected language jobs via paths-filter.
+# Shared client CI: run only affected language jobs via changed path detection.
name: Multi-Language Client
on:
push:
@@ -50,36 +50,55 @@ jobs:
go: ${{ steps.filter.outputs.go }}
steps:
- uses: actions/checkout@v5
- - uses: dorny/paths-filter@v3
- id: filter
with:
- filters: |
- cpp:
- - 'iotdb-client/pom.xml'
- - 'iotdb-client/client-cpp/**'
- - 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift'
- - 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift'
- - '.github/workflows/multi-language-client.yml'
- - '.github/workflows/client-cpp-package.yml'
- - '.github/scripts/package-client-cpp-*.sh'
- python:
- - 'pom.xml'
- - 'iotdb-client/pom.xml'
- - 'iotdb-client/client-py/**'
- - 'docker/src/main/Dockerfile-1c1d'
- - '.github/workflows/multi-language-client.yml'
- go:
- - 'pom.xml'
- - 'iotdb-core/**'
- - 'iotdb-api/**'
- - 'iotdb-protocol/**'
- - 'distribution/**'
- - 'integration-test/**'
- - 'iotdb-client/session/**'
- - 'iotdb-client/jdbc/**'
- - 'iotdb-client/cli/**'
- - 'iotdb-client/service-rpc/**'
- - '.github/workflows/multi-language-client.yml'
+ fetch-depth: 0
+ - name: Detect changed client paths
+ id: filter
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
+ BASE="${{ github.event.pull_request.base.sha }}"
+ HEAD="${{ github.sha }}"
+ elif [[ "${{ github.event_name }}" == "push" ]]; then
+ BASE="${{ github.event.before }}"
+ HEAD="${{ github.sha }}"
+ else
+ echo "cpp=true" >> "$GITHUB_OUTPUT"
+ echo "python=true" >> "$GITHUB_OUTPUT"
+ echo "go=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ if [[ "$BASE" =~ ^0+$ ]]; then
+ BASE="$(git hash-object -t tree /dev/null)"
+ fi
+
+ cpp=false
+ python=false
+ go=false
+ while IFS= read -r file; do
+ case "$file" in
+
iotdb-client/pom.xml|iotdb-client/client-cpp/*|iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift|iotdb-protocol/thrift-commons/src/main/thrift/common.thrift|.github/workflows/multi-language-client.yml|.github/workflows/client-cpp-package.yml|.github/scripts/package-client-cpp-*.sh)
+ cpp=true
+ ;;
+ esac
+ case "$file" in
+
pom.xml|iotdb-client/pom.xml|iotdb-client/client-py/*|docker/src/main/Dockerfile-1c1d|.github/workflows/multi-language-client.yml)
+ python=true
+ ;;
+ esac
+ case "$file" in
+
pom.xml|iotdb-core/*|iotdb-api/*|iotdb-protocol/*|distribution/*|integration-test/*|iotdb-client/session/*|iotdb-client/jdbc/*|iotdb-client/cli/*|iotdb-client/service-rpc/*|.github/workflows/multi-language-client.yml)
+ go=true
+ ;;
+ esac
+ done < <(git diff --name-only "$BASE" "$HEAD")
+
+ echo "cpp=${cpp}" >> "$GITHUB_OUTPUT"
+ echo "python=${python}" >> "$GITHUB_OUTPUT"
+ echo "go=${go}" >> "$GITHUB_OUTPUT"
cpp:
needs: changes
diff --git a/LICENSE-binary b/LICENSE-binary
index a55f3987249..d21627d28ee 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -241,7 +241,7 @@ org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.36
org.eclipse.jetty:jetty-util:12.0.36
com.google.code.findbugs:jsr305:3.0.2
com.librato.metrics:librato-java:2.1.0
-org.apache.thrift:libthrift:0.14.1
+org.apache.thrift:libthrift:0.23.0
io.dropwizard.metrics:metrics-core:4.2.19
io.dropwizard.metrics:metrics-jvm:3.2.2
com.librato.metrics:metrics-librato:5.1.0
diff --git a/iotdb-client/jdbc/src/main/feature/feature.xml
b/iotdb-client/jdbc/src/main/feature/feature.xml
index 033fe46d47c..b77e2690148 100644
--- a/iotdb-client/jdbc/src/main/feature/feature.xml
+++ b/iotdb-client/jdbc/src/main/feature/feature.xml
@@ -27,7 +27,7 @@
<bundle>mvn:org.apache.iotdb/service-rpc/${project.version}</bundle>
<bundle>mvn:org.apache.iotdb/iotdb-thrift/${project.version}</bundle>
<bundle>mvn:org.apache.iotdb/hadoop-tsfile/${project.version}</bundle>
- <bundle>mvn:org.apache.thrift/libthrift/0.14.1</bundle>
+ <bundle>mvn:org.apache.thrift/libthrift/0.23.0</bundle>
<bundle>mvn:org.xerial.snappy/snappy-java/1.1.8.4</bundle>
<bundle>mvn:commons-io/commons-io/2.5</bundle>
<bundle>wrap:mvn:org.apache.hadoop/hadoop-core/1.2.1</bundle>
diff --git
a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingTransportWrapper.java
b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingTransportWrapper.java
index 8a044f1e5cc..47e0f31c50d 100644
---
a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingTransportWrapper.java
+++
b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingTransportWrapper.java
@@ -27,8 +27,8 @@ import java.io.IOException;
import java.nio.channels.SocketChannel;
/**
- * In Thrift 0.14.1, TNonblockingSocket's constructor throws a never-happened
exception. So, we
- * screen the exception https://issues.apache.org/jira/browse/THRIFT-5412
+ * TNonblockingSocket's constructor declares a TTransportException for
compatibility, but this code
+ * path is not expected to throw one. See
https://issues.apache.org/jira/browse/THRIFT-5412.
*/
public class TNonblockingTransportWrapper {
diff --git
a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSocketWrapper.java
b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSocketWrapper.java
index df25d503e43..42a4e87b004 100644
---
a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSocketWrapper.java
+++
b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSocketWrapper.java
@@ -24,8 +24,8 @@ import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransportException;
/**
- * In Thrift 0.14.1, TSocket's constructor throws a never-happened exception.
So, we screen the
- * exception https://issues.apache.org/jira/browse/THRIFT-5412
+ * TSocket's constructor declares a TTransportException for compatibility, but
this code path is not
+ * expected to throw one. See
https://issues.apache.org/jira/browse/THRIFT-5412.
*/
public class TSocketWrapper {
diff --git
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceHandler.java
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceHandler.java
index abe4c03f861..c373dba5a3f 100644
---
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceHandler.java
+++
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceHandler.java
@@ -17,6 +17,7 @@
package org.apache.iotdb.confignode.service.thrift;
+import org.apache.iotdb.commons.service.NoopServerContext;
import org.apache.iotdb.commons.service.metric.MetricService;
import org.apache.thrift.protocol.TProtocol;
@@ -37,7 +38,7 @@ public class ConfigNodeRPCServiceHandler implements
TServerEventHandler {
@Override
public ServerContext createContext(TProtocol input, TProtocol output) {
thriftConnectionNumber.incrementAndGet();
- return null;
+ return NoopServerContext.INSTANCE;
}
@Override
diff --git
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
index 621f887de3b..5e9f5c1b2bb 100644
---
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
+++
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
@@ -19,6 +19,8 @@
package org.apache.iotdb.consensus.iot.service;
+import org.apache.iotdb.commons.service.NoopServerContext;
+
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.server.ServerContext;
import org.apache.thrift.server.TServerEventHandler;
@@ -37,7 +39,7 @@ public class IoTConsensusRPCServiceHandler implements
TServerEventHandler {
@Override
public ServerContext createContext(TProtocol input, TProtocol output) {
- return null;
+ return NoopServerContext.INSTANCE;
}
@Override
diff --git
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/service/IoTConsensusV2RPCServiceHandler.java
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/service/IoTConsensusV2RPCServiceHandler.java
index dd4b9dfa73d..001ba310087 100644
---
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/service/IoTConsensusV2RPCServiceHandler.java
+++
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/service/IoTConsensusV2RPCServiceHandler.java
@@ -19,6 +19,8 @@
package org.apache.iotdb.consensus.pipe.service;
+import org.apache.iotdb.commons.service.NoopServerContext;
+
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.server.ServerContext;
import org.apache.thrift.server.TServerEventHandler;
@@ -37,7 +39,7 @@ public class IoTConsensusV2RPCServiceHandler implements
TServerEventHandler {
@Override
public ServerContext createContext(TProtocol input, TProtocol output) {
- return null;
+ return NoopServerContext.INSTANCE;
}
@Override
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/BaseServerContextHandler.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/BaseServerContextHandler.java
index e5489d0a185..111f6e08d27 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/BaseServerContextHandler.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/BaseServerContextHandler.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.db.protocol.thrift.handler;
+import org.apache.iotdb.commons.service.NoopServerContext;
import org.apache.iotdb.db.i18n.DataNodeMiscMessages;
import org.apache.iotdb.db.protocol.session.ClientSession;
import org.apache.iotdb.db.protocol.session.SessionManager;
@@ -63,17 +64,17 @@ public class BaseServerContextHandler {
getSessionManager().registerSession(new ClientSession(socket));
if (factory != null) {
context = factory.newServerContext(out, socket);
- if (!context.whenConnect()) {
+ if (context != null && !context.whenConnect()) {
return context;
}
}
- return context;
+ return context == null ? NoopServerContext.INSTANCE : context;
}
public void deleteContext(ServerContext context, TProtocol in, TProtocol
out) {
getSessionManager().removeCurrSession();
- if (context != null && factory != null) {
+ if (context instanceof JudgableServerContext) {
((JudgableServerContext) context).whenDisconnect();
}
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/InternalServiceThriftHandler.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/InternalServiceThriftHandler.java
index d53d3126502..58130eb91cc 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/InternalServiceThriftHandler.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/handler/InternalServiceThriftHandler.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.db.protocol.thrift.handler;
+import org.apache.iotdb.commons.service.NoopServerContext;
import org.apache.iotdb.commons.service.metric.MetricService;
import org.apache.thrift.protocol.TProtocol;
@@ -45,7 +46,7 @@ public class InternalServiceThriftHandler implements
TServerEventHandler {
@Override
public ServerContext createContext(TProtocol tProtocol, TProtocol
tProtocol1) {
thriftConnectionNumber.incrementAndGet();
- return null;
+ return NoopServerContext.INSTANCE;
}
@Override
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/exchange/MPPDataExchangeServiceThriftHandler.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/exchange/MPPDataExchangeServiceThriftHandler.java
index 2c3d358759a..999ad37d7ae 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/exchange/MPPDataExchangeServiceThriftHandler.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/exchange/MPPDataExchangeServiceThriftHandler.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.db.queryengine.execution.exchange;
+import org.apache.iotdb.commons.service.NoopServerContext;
import org.apache.iotdb.commons.service.metric.MetricService;
import org.apache.thrift.protocol.TProtocol;
@@ -44,7 +45,7 @@ public class MPPDataExchangeServiceThriftHandler implements
TServerEventHandler
@Override
public ServerContext createContext(TProtocol input, TProtocol output) {
thriftConnectionNumber.incrementAndGet();
- return null;
+ return NoopServerContext.INSTANCE;
}
@Override
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/NoopServerContext.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/NoopServerContext.java
new file mode 100644
index 00000000000..70ea8afef03
--- /dev/null
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/NoopServerContext.java
@@ -0,0 +1,48 @@
+/*
+ * 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.iotdb.commons.service;
+
+import org.apache.thrift.server.ServerContext;
+
+/**
+ * Shared {@link ServerContext} implementation for Thrift handlers that do not
need per-connection
+ * state.
+ *
+ * <p>Thrift 0.23 server implementations expect {@code createContext} to
return a non-null context,
+ * even when the event handler only uses connection lifecycle callbacks. This
no-op implementation
+ * keeps those handlers explicit without adding a custom context object for
each connection.
+ */
+public final class NoopServerContext implements ServerContext {
+
+ /** Singleton instance reused by handlers that do not attach state to the
connection. */
+ public static final NoopServerContext INSTANCE = new NoopServerContext();
+
+ private NoopServerContext() {}
+
+ @Override
+ public <T> T unwrap(Class<T> iface) {
+ return iface.isInstance(this) ? iface.cast(this) : null;
+ }
+
+ @Override
+ public boolean isWrapperFor(Class<?> iface) {
+ return iface.isInstance(this);
+ }
+}
diff --git
a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/client/mock/MockInternalRPCService.java
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/client/mock/MockInternalRPCService.java
index 386a212436f..0b5b57c4930 100644
---
a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/client/mock/MockInternalRPCService.java
+++
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/client/mock/MockInternalRPCService.java
@@ -22,6 +22,7 @@ package org.apache.iotdb.commons.client.mock;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.commons.concurrent.ThreadName;
import org.apache.iotdb.commons.exception.runtime.RPCServiceException;
+import org.apache.iotdb.commons.service.NoopServerContext;
import org.apache.iotdb.commons.service.ServiceType;
import org.apache.iotdb.commons.service.ThriftService;
import org.apache.iotdb.commons.service.ThriftServiceThread;
@@ -30,7 +31,9 @@ import org.apache.iotdb.rpc.DeepCopyRpcTransportFactory;
import org.apache.thrift.server.TServerEventHandler;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
public class MockInternalRPCService extends ThriftService implements
MockInternalRPCServiceMBean {
@@ -60,6 +63,8 @@ public class MockInternalRPCService extends ThriftService
implements MockInterna
@Override
public void initThriftServiceThread() throws IllegalAccessException {
try {
+ TServerEventHandler serverEventHandler = mock(TServerEventHandler.class);
+ when(serverEventHandler.createContext(any(),
any())).thenReturn(NoopServerContext.INSTANCE);
thriftServiceThread =
new ThriftServiceThread(
processor,
@@ -69,7 +74,7 @@ public class MockInternalRPCService extends ThriftService
implements MockInterna
getBindPort(),
65535,
60,
- mock(TServerEventHandler.class),
+ serverEventHandler,
false,
DeepCopyRpcTransportFactory.INSTANCE);
} catch (RPCServiceException e) {
diff --git
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/service/NoopServerContextTest.java
similarity index 50%
copy from
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
copy to
iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/service/NoopServerContextTest.java
index 621f887de3b..b8a7555c14f 100644
---
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/service/IoTConsensusRPCServiceHandler.java
+++
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/service/NoopServerContextTest.java
@@ -17,35 +17,27 @@
* under the License.
*/
-package org.apache.iotdb.consensus.iot.service;
+package org.apache.iotdb.commons.service;
-import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.server.ServerContext;
-import org.apache.thrift.server.TServerEventHandler;
-import org.apache.thrift.transport.TTransport;
-
-public class IoTConsensusRPCServiceHandler implements TServerEventHandler {
-
- private final IoTConsensusRPCServiceProcessor processor;
-
- public IoTConsensusRPCServiceHandler(IoTConsensusRPCServiceProcessor
processor) {
- this.processor = processor;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class NoopServerContextTest {
+
+ @Test
+ public void testUnwrap() {
+ Assert.assertSame(
+ NoopServerContext.INSTANCE,
NoopServerContext.INSTANCE.unwrap(NoopServerContext.class));
+ Assert.assertSame(
+ NoopServerContext.INSTANCE,
NoopServerContext.INSTANCE.unwrap(ServerContext.class));
+ Assert.assertNull(NoopServerContext.INSTANCE.unwrap(String.class));
}
- @Override
- public void preServe() {}
-
- @Override
- public ServerContext createContext(TProtocol input, TProtocol output) {
- return null;
+ @Test
+ public void testIsWrapperFor() {
+
Assert.assertTrue(NoopServerContext.INSTANCE.isWrapperFor(NoopServerContext.class));
+
Assert.assertTrue(NoopServerContext.INSTANCE.isWrapperFor(ServerContext.class));
+ Assert.assertFalse(NoopServerContext.INSTANCE.isWrapperFor(String.class));
}
-
- @Override
- public void deleteContext(ServerContext serverContext, TProtocol input,
TProtocol output) {
- processor.handleClientExit();
- }
-
- @Override
- public void processContext(
- ServerContext serverContext, TTransport inputTransport, TTransport
outputTransport) {}
}
diff --git a/pom.xml b/pom.xml
index 3f3b235f19a..80c3d4af968 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,7 +88,7 @@
This is the version of the thrift binary, that we release separately
from here:
https://github.com/apache/iotdb-bin-resources/tree/main/iotdb-tools-thrift
-->
- <iotdb-tools-thrift.version>0.14.1.0</iotdb-tools-thrift.version>
+ <iotdb-tools-thrift.version>0.23.0.0</iotdb-tools-thrift.version>
<jackson.version>2.18.6</jackson.version>
<jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version>
<jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>
@@ -142,13 +142,7 @@
<swagger.version>2.2.50</swagger.version>
<thrift.exec-cmd.executable>chmod</thrift.exec-cmd.executable>
<thrift.exec.absolute.path/>
- <!--
- Thrift 0.17.0 was the last version that could be used in Java 8
applications,
- However Thrift 0.17.0 has an invalid entry in the META-INF/MANIFEST.mf
file.
- All versions between 0.17.0 and 0.14.1 have know vulnerabilities, so for
now
- we'll stay at 0.14.1.
- -->
- <thrift.version>0.14.1</thrift.version>
+ <thrift.version>0.23.0</thrift.version>
<xz.version>1.9</xz.version>
<zstd-jni.version>1.5.6-3</zstd-jni.version>
<tsfile.version>2.3.2-260608-SNAPSHOT</tsfile.version>
@@ -179,24 +173,30 @@
<artifactId>libthrift</artifactId>
<version>${thrift.version}</version>
<exclusions>
- <!-- Seemed suspicious to have this dependency in -->
+ <!-- We don't use thrift HTTP client or servlet
transports. -->
+ <exclusion>
+ <groupId>org.apache.httpcomponents.client5</groupId>
+ <artifactId>httpclient5</artifactId>
+ </exclusion>
<exclusion>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-core</artifactId>
+ <groupId>org.apache.httpcomponents.core5</groupId>
+ <artifactId>httpcore5</artifactId>
</exclusion>
- <!-- We don't want the old javax packages -->
<exclusion>
- <groupId>javax.annotation</groupId>
- <artifactId>javax.annotation-api</artifactId>
+ <groupId>org.apache.httpcomponents.core5</groupId>
+ <artifactId>httpcore5-h2</artifactId>
</exclusion>
- <!-- We don't use thrift http connection -->
<exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
</exclusion>
+ <!--
+ commons-lang3 is only used by Thrift's partial
deserialization runtime.
+ IoTDB does not use org.apache.thrift.partial APIs.
+ -->
<exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>