-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement ExternalService Framework #17009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>
JackieTien97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partial review, finish CN and antlr parts.
...lational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
Show resolved
Hide resolved
iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-system.properties
Show resolved
Hide resolved
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Show resolved
Hide resolved
| crc32.reset(); | ||
| crc32.update(bytes, 0, length); | ||
|
|
||
| long expectedCRC = ReadWriteIOUtils.readLong(inputStream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| long expectedCRC = ReadWriteIOUtils.readLong(inputStream); | |
| int expectedCRC = ReadWriteIOUtils.readInt(inputStream); |
|
|
||
| ReadWriteIOUtils.write(bytes.length, outputStream); | ||
| outputStream.write(bytes); | ||
| ReadWriteIOUtils.write(crc32.getValue(), outputStream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ReadWriteIOUtils.write(crc32.getValue(), outputStream); | |
| ReadWriteIOUtils.write((int) crc32.getValue(), outputStream); |
| crc32.update(bytes, 0, length); | ||
|
|
||
| long expectedCRC = ReadWriteIOUtils.readLong(inputStream); | ||
| if (crc32.getValue() != expectedCRC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (crc32.getValue() != expectedCRC) { | |
| if (((int) crc32.getValue()) != expectedCRC) { |
JackieTien97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add all ITs you list in the documents and the recovery process is missing
| new ColumnHeader(SERVICE_NAME, TSDataType.TEXT), | ||
| new ColumnHeader(DATA_NODE_ID, TSDataType.INT32), | ||
| new ColumnHeader(STATE, TSDataType.TEXT), | ||
| new ColumnHeader(CLASS_NAME, TSDataType.TEXT), | ||
| new ColumnHeader(SERVICE_TYPE, TSDataType.TEXT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| new ColumnHeader(SERVICE_NAME, TSDataType.TEXT), | |
| new ColumnHeader(DATA_NODE_ID, TSDataType.INT32), | |
| new ColumnHeader(STATE, TSDataType.TEXT), | |
| new ColumnHeader(CLASS_NAME, TSDataType.TEXT), | |
| new ColumnHeader(SERVICE_TYPE, TSDataType.TEXT)); | |
| new ColumnHeader(SERVICE_NAME, TSDataType.STRING), | |
| new ColumnHeader(DATA_NODE_ID, TSDataType.INT32), | |
| new ColumnHeader(STATE, TSDataType.STRING), | |
| new ColumnHeader(CLASS_NAME, TSDataType.STRING), | |
| new ColumnHeader(SERVICE_TYPE, TSDataType.STRING)); |
| RPC_SERVICE("RPC ServerService", "RPCService"), | ||
| INFLUX_SERVICE("InfluxDB Protocol Service", "InfluxDB Protocol"), | ||
| MQTT_SERVICE("MQTTService", "MqttService"), | ||
| EXTERNAL_SERVICE("ExternalService Service", "ExternalService"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this enum is never used.
| if (IoTDBRestServiceDescriptor.getInstance().getConfig().isEnableRestService()) { | ||
| registerManager.register(RestService.getInstance()); | ||
| } | ||
| // registerManager.register(ExternalServiceManagementService.getInstance()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need this? or should be just deleted.
| Optional.of( | ||
| new ComparisonExpression( | ||
| ComparisonExpression.Operator.EQUAL, | ||
| new Identifier("datanode_id"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| new Identifier("datanode_id"), | |
| new Identifier(ColumnHeaderConstant.DATA_NODE_ID_TABLE_MODEL), |
| @Override | ||
| protected IConfigTask visitCreateExternalService( | ||
| CreateExternalService node, MPPQueryContext context) { | ||
| context.setQueryType(QueryType.WRITE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| context.setQueryType(QueryType.WRITE); | |
| context.setQueryType(QueryType.WRITE); | |
| accessControl.checkUserGlobalSysPrivilege(context); |
| ExternalServiceManagementService.getInstance().stopService(serviceName); | ||
| future.set(new ConfigTaskResult(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()))); | ||
| } catch (Exception e) { | ||
| future.setException(new ExternalServiceManagementException(e.getMessage())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| ExternalServiceManagementService.getInstance().dropService(serviceName, forcedly); | ||
| future.set(new ConfigTaskResult(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()))); | ||
| } catch (Exception e) { | ||
| future.setException(new ExternalServiceManagementException(e.getMessage())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| new ConfigTaskResult( | ||
| TSStatusCode.SUCCESS_STATUS, builder.build(), getShowExternalServiceHeader())); | ||
| } catch (Exception e) { | ||
| future.setException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| MQTT( | ||
| "MQTT", | ||
| "org.apache.iotdb.externalservice.Mqtt", | ||
| IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService), | ||
| REST( | ||
| "REST", | ||
| "org.apache.iotdb.externalservice.Rest", | ||
| IoTDBRestServiceDescriptor.getInstance().getConfig()::isEnableRestService); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MQTT( | |
| "MQTT", | |
| "org.apache.iotdb.externalservice.Mqtt", | |
| IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService), | |
| REST( | |
| "REST", | |
| "org.apache.iotdb.externalservice.Rest", | |
| IoTDBRestServiceDescriptor.getInstance().getConfig()::isEnableRestService); | |
| MQTT( | |
| "MQTT", | |
| "org.apache.iotdb.externalservice.Mqtt", | |
| // IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService), | |
| () -> false), | |
| REST( | |
| "REST", | |
| "org.apache.iotdb.externalservice.Rest", | |
| // IoTDBRestServiceDescriptor.getInstance().getConfig()::isEnableRestService); | |
| () -> false); |
better always return false before you really seperate the rest and mqtt service outside. Otherwise, mqtt and rest ITs will fail because org.apache.iotdb.externalservice.Mqtt and org.apache.iotdb.externalservice.Rest is not found
| MQTT( | ||
| "MQTT", | ||
| "org.apache.iotdb.externalservice.Mqtt", | ||
| IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService), | ||
| REST( | ||
| "REST", | ||
| "org.apache.iotdb.externalservice.Rest", | ||
| IoTDBRestServiceDescriptor.getInstance().getConfig()::isEnableRestService); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MQTT( | |
| "MQTT", | |
| "org.apache.iotdb.externalservice.Mqtt", | |
| IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService), | |
| REST( | |
| "REST", | |
| "org.apache.iotdb.externalservice.Rest", | |
| IoTDBRestServiceDescriptor.getInstance().getConfig()::isEnableRestService); | |
| MQTT( | |
| "MQTT", | |
| "org.apache.iotdb.externalservice.Mqtt", | |
| // IoTDBDescriptor.getInstance().getConfig()::isEnableMQTTService), | |
| () -> false), | |
| REST( | |
| "REST", | |
| "org.apache.iotdb.externalservice.Rest", | |
| // IoTDBRestServiceDescriptor.getInstance().getConfig()::isEnableRestService); | |
| () -> false); |
better always return false before you really seperate the rest and mqtt service outside. Otherwise, mqtt and rest ITs will fail because org.apache.iotdb.externalservice.Mqtt and org.apache.iotdb.externalservice.Rest is not found
No description provided.