Skip to content

Commit 8d93384

Browse files
authored
Delete unused and vulnerable rpc interface (apache#16603)
1 parent d49baf7 commit 8d93384

File tree

2 files changed

+0
-91
lines changed

2 files changed

+0
-91
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.iotdb.common.rpc.thrift.TSStatus;
2626
import org.apache.iotdb.common.rpc.thrift.TShowConfigurationResp;
2727
import org.apache.iotdb.common.rpc.thrift.TShowConfigurationTemplateResp;
28-
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
2928
import org.apache.iotdb.commons.audit.AuditEventType;
3029
import org.apache.iotdb.commons.audit.AuditLogFields;
3130
import org.apache.iotdb.commons.audit.AuditLogOperation;
@@ -34,7 +33,6 @@
3433
import org.apache.iotdb.commons.conf.CommonDescriptor;
3534
import org.apache.iotdb.commons.conf.ConfigurationFileUtils;
3635
import org.apache.iotdb.commons.conf.IoTDBConstant;
37-
import org.apache.iotdb.commons.consensus.DataRegionId;
3836
import org.apache.iotdb.commons.exception.IllegalPathException;
3937
import org.apache.iotdb.commons.exception.IoTDBException;
4038
import org.apache.iotdb.commons.partition.DataPartition;
@@ -44,9 +42,7 @@
4442
import org.apache.iotdb.commons.path.MeasurementPath;
4543
import org.apache.iotdb.commons.path.NonAlignedFullPath;
4644
import org.apache.iotdb.commons.path.PartialPath;
47-
import org.apache.iotdb.commons.schema.column.ColumnHeader;
4845
import org.apache.iotdb.commons.utils.PathUtils;
49-
import org.apache.iotdb.commons.utils.TimePartitionUtils;
5046
import org.apache.iotdb.db.audit.DNAuditLogger;
5147
import org.apache.iotdb.db.auth.AuthorityChecker;
5248
import org.apache.iotdb.db.conf.IoTDBConfig;
@@ -122,7 +118,6 @@
122118
import org.apache.iotdb.db.schemaengine.SchemaEngine;
123119
import org.apache.iotdb.db.schemaengine.schemaregion.ISchemaRegion;
124120
import org.apache.iotdb.db.schemaengine.template.TemplateQueryType;
125-
import org.apache.iotdb.db.storageengine.StorageEngine;
126121
import org.apache.iotdb.db.storageengine.dataregion.DataRegion;
127122
import org.apache.iotdb.db.storageengine.dataregion.read.QueryDataSource;
128123
import org.apache.iotdb.db.storageengine.rescon.quotas.DataNodeThrottleQuotaManager;
@@ -163,7 +158,6 @@
163158
import org.apache.iotdb.service.rpc.thrift.TSFetchResultsReq;
164159
import org.apache.iotdb.service.rpc.thrift.TSFetchResultsResp;
165160
import org.apache.iotdb.service.rpc.thrift.TSGetTimeZoneResp;
166-
import org.apache.iotdb.service.rpc.thrift.TSGroupByQueryIntervalReq;
167161
import org.apache.iotdb.service.rpc.thrift.TSInsertRecordReq;
168162
import org.apache.iotdb.service.rpc.thrift.TSInsertRecordsOfOneDeviceReq;
169163
import org.apache.iotdb.service.rpc.thrift.TSInsertRecordsReq;
@@ -188,7 +182,6 @@
188182
import org.apache.iotdb.service.rpc.thrift.TSyncTransportMetaInfo;
189183

190184
import io.airlift.units.Duration;
191-
import org.apache.commons.lang3.StringUtils;
192185
import org.apache.thrift.TException;
193186
import org.apache.tsfile.block.column.Column;
194187
import org.apache.tsfile.common.conf.TSFileConfig;
@@ -1299,72 +1292,6 @@ public TSExecuteStatementResp executeAggregationQueryV2(TSAggregationQueryReq re
12991292
return executeAggregationQueryInternal(req, SELECT_RESULT);
13001293
}
13011294

1302-
@Override
1303-
public TSExecuteStatementResp executeGroupByQueryIntervalQuery(TSGroupByQueryIntervalReq req)
1304-
throws TException {
1305-
1306-
try {
1307-
IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
1308-
1309-
String database = req.getDatabase();
1310-
if (StringUtils.isEmpty(database)) {
1311-
String[] splits = req.getDevice().split("\\.");
1312-
database = String.format("%s.%s", splits[0], splits[1]);
1313-
}
1314-
IDeviceID deviceId = Factory.DEFAULT_FACTORY.create(req.getDevice());
1315-
String measurementId = req.getMeasurement();
1316-
TSDataType dataType = TSDataType.getTsDataType((byte) req.getDataType());
1317-
1318-
// only one database, one device, one time interval
1319-
Map<String, List<DataPartitionQueryParam>> sgNameToQueryParamsMap = new HashMap<>();
1320-
TTimePartitionSlot timePartitionSlot =
1321-
TimePartitionUtils.getTimePartitionSlot(req.getStartTime());
1322-
DataPartitionQueryParam queryParam =
1323-
new DataPartitionQueryParam(
1324-
deviceId, Collections.singletonList(timePartitionSlot), false, false);
1325-
sgNameToQueryParamsMap.put(database, Collections.singletonList(queryParam));
1326-
DataPartition dataPartition = partitionFetcher.getDataPartition(sgNameToQueryParamsMap);
1327-
List<DataRegion> dataRegionList = new ArrayList<>();
1328-
List<TRegionReplicaSet> replicaSets =
1329-
dataPartition.getDataRegionReplicaSetWithTimeFilter(deviceId, null);
1330-
for (TRegionReplicaSet region : replicaSets) {
1331-
dataRegionList.add(
1332-
StorageEngine.getInstance()
1333-
.getDataRegion(new DataRegionId(region.getRegionId().getId())));
1334-
}
1335-
1336-
List<TsBlock> blockResult =
1337-
executeGroupByQueryInternal(
1338-
SESSION_MANAGER.getSessionInfo(clientSession),
1339-
deviceId,
1340-
measurementId,
1341-
dataType,
1342-
req.isAligned,
1343-
req.getStartTime(),
1344-
req.getEndTime(),
1345-
req.getInterval(),
1346-
req.getAggregationType(),
1347-
dataRegionList);
1348-
1349-
String outputColumnName = req.getAggregationType().name();
1350-
List<ColumnHeader> columnHeaders =
1351-
Collections.singletonList(new ColumnHeader(outputColumnName, dataType));
1352-
DatasetHeader header = new DatasetHeader(columnHeaders, false);
1353-
header.setTreeColumnToTsBlockIndexMap(Collections.singletonList(outputColumnName));
1354-
1355-
TSExecuteStatementResp resp = createResponse(header, 1);
1356-
TSQueryDataSet queryDataSet = convertTsBlockByFetchSize(blockResult);
1357-
resp.setQueryDataSet(queryDataSet);
1358-
1359-
return resp;
1360-
} catch (Exception e) {
1361-
return RpcUtils.getTSExecuteStatementResp(
1362-
onQueryException(e, "\"" + req + "\". " + OperationType.EXECUTE_AGG_QUERY));
1363-
} finally {
1364-
SESSION_MANAGER.updateIdleTime();
1365-
}
1366-
}
1367-
13681295
@Override
13691296
public TSFetchResultsResp fetchResultsV2(TSFetchResultsReq req) {
13701297
long startTime = System.nanoTime();

iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -387,22 +387,6 @@ struct TSAggregationQueryReq {
387387
11: optional bool legalPathNodes
388388
}
389389

390-
struct TSGroupByQueryIntervalReq {
391-
1: required i64 sessionId
392-
2: required i64 statementId
393-
3: required string device
394-
4: required string measurement
395-
5: required i32 dataType
396-
6: required common.TAggregationType aggregationType
397-
7: optional string database
398-
8: optional i64 startTime
399-
9: optional i64 endTime
400-
10: optional i64 interval
401-
11: optional i32 fetchSize
402-
12: optional i64 timeout
403-
13: optional bool isAligned
404-
}
405-
406390
struct TSCreateMultiTimeseriesReq {
407391
1: required i64 sessionId
408392
2: required list<string> paths
@@ -569,8 +553,6 @@ service IClientRPCService {
569553

570554
TSExecuteStatementResp executeAggregationQueryV2(1:TSAggregationQueryReq req);
571555

572-
TSExecuteStatementResp executeGroupByQueryIntervalQuery(1:TSGroupByQueryIntervalReq req);
573-
574556
TSFetchResultsResp fetchResultsV2(1:TSFetchResultsReq req);
575557

576558
TSOpenSessionResp openSession(1:TSOpenSessionReq req);

0 commit comments

Comments
 (0)