jt2594838 commented on code in PR #18606:
URL: https://github.com/apache/iotdb/pull/18606#discussion_r4059271190


##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/plugin/builtin/BuiltinPipePlugin.java:
##########
@@ -157,7 +157,6 @@ public String getClassName() {
                   
IOT_CONSENSUS_V2_ASYNC_CONNECTOR.getPipePluginName().toLowerCase(),
                   
PIPE_CONSENSUS_ASYNC_CONNECTOR.getPipePluginName().toLowerCase(),
                   WEBSOCKET_CONNECTOR.getPipePluginName().toLowerCase(),
-                  OPC_UA_CONNECTOR.getPipePluginName().toLowerCase(),

Review Comment:
   Remove the stale OPC_UA_CONNECTOR and OPC_UA_SINK entries from 
BUILTIN_SINKS. Master moved OPC UA to library-pipe and removed those enum 
constants, but these two references remained, causing node-commons compilation 
to fail. Removing both entries also correctly classifies the separately 
registered OPC UA plugin as external. The compatibility names in 
PipeSinkConstant remain available for configuration and the single-thread 
policy. Both locale builds passed after this cleanup.



##########
library-pipe/opc-ua-sink/src/test/java/org/apache/iotdb/pipe/plugin/sink/opcua/server/OpcUaTypeServicesTest.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.pipe.plugin.sink.opcua.server;
+
+import org.apache.tsfile.enums.TSDataType;
+import org.apache.tsfile.read.common.type.Type;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DateTime;
+import org.junit.Test;
+
+import java.time.LocalDate;
+import java.time.ZoneId;
+
+import static org.junit.Assert.assertEquals;
+
+public class OpcUaTypeServicesTest {
+
+  @Test

Review Comment:
   Move the existing DATE regression from datanode's TypeServicesTest alongside 
the relocated OPC UA services. The same assertion still checks Milo's DateTime 
against the LocalDate at the system zone's start of day, guarding against 
reintroducing java.sql.Date.toInstant(), which throws 
UnsupportedOperationException. This keeps regression coverage while allowing 
datanode tests to compile without Milo. The relocated test passed, together 
with five OPC UA metadata tests and the remaining 60 targeted tests.



##########
library-pipe/opc-ua-sink/src/main/java/org/apache/iotdb/pipe/plugin/sink/opcua/server/OpcUaTypeServices.java:
##########
@@ -0,0 +1,145 @@
+/*
+ * 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.pipe.plugin.sink.opcua.server;
+
+import org.apache.iotdb.commons.exception.pipe.PipeRuntimeNonCriticalException;
+import org.apache.iotdb.commons.queryengine.utils.DateTimeUtils;
+import org.apache.iotdb.commons.queryengine.utils.TimestampPrecisionUtils;
+import org.apache.iotdb.db.i18n.DataNodePipeMessages;
+
+import org.apache.tsfile.read.common.type.service.TypeService;
+import org.apache.tsfile.utils.Binary;
+import org.apache.tsfile.utils.DateUtils;
+import org.apache.tsfile.write.UnSupportedDataTypeException;
+import org.eclipse.milo.opcua.stack.core.Identifiers;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DateTime;
+import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
+
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+// Keep Milo-dependent type services in the external plugin so core can load 
without Milo.
+final class OpcUaTypeServices {

Review Comment:
   Relocate the four OPC UA TypeServices from datanode's TypeServices.Pipe into 
the external plugin, and update all four OpcUaNameSpace call sites to use this 
class. Master removed Milo from datanode's dependencies; retaining 
DateTime/NodeId/Identifiers references there prevented compilation. Keeping the 
services with the plugin preserves the existing conversions, service checks, 
and Pub/Sub type selection outside the row loop without reintroducing Milo into 
core. The java.util.Date conversion fix is retained. Both locale reactor builds 
and the targeted OPC UA metadata/conversion tests passed.



-- 
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]

Reply via email to