KeeProMise commented on code in PR #7137:
URL: https://github.com/apache/iotdb/pull/7137#discussion_r958048469
##########
server/src/main/java/org/apache/iotdb/db/metadata/idtable/deviceID/DeviceIDFactory.java:
##########
@@ -49,23 +50,26 @@ public static DeviceIDFactory getInstance() {
}
private DeviceIDFactory() {
- if (IoTDBDescriptor.getInstance().getConfig().isEnableIDTable()
- && IoTDBDescriptor.getInstance()
- .getConfig()
- .getDeviceIDTransformationMethod()
- .equals("SHA256")) {
- getDeviceIDFunction = SHA256DeviceID::new;
- } else {
- getDeviceIDFunction = PlainDeviceID::new;
+ if (IoTDBDescriptor.getInstance().getConfig().isEnableIDTable()) {
+ switch (DeviceIDMode.valueOf(
+
IoTDBDescriptor.getInstance().getConfig().getDeviceIDTransformationMethod())) {
+ case SHA256:
+ getDeviceIDFunction = SHA256DeviceID::new;
+ return;
+ case AutoIncrement:
+ getDeviceIDFunction = IDTableAutoIncImpl::getDeviceID;
+ return;
Review Comment:
added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]