@@ -128,7 +128,7 @@ public class OpcUaSink implements PipeConnector {
128128
129129 private String serverKey ;
130130 boolean isClientServerModel ;
131- String unQualifiedDatabaseName ;
131+ String databaseName ;
132132 String placeHolder ;
133133 @ Nullable String valueName ;
134134 @ Nullable String qualityName ;
@@ -159,12 +159,15 @@ public void validate(final PipeParameterValidator validator) throws Exception {
159159
160160 final PipeParameters parameters = validator .getParameters ();
161161 if (validator
162- .getParameters ()
163- .hasAnyAttributes (CONNECTOR_OPC_UA_NODE_URL_KEY , SINK_OPC_UA_NODE_URL_KEY )) {
162+ .getParameters ()
163+ .hasAnyAttributes (CONNECTOR_OPC_UA_NODE_URL_KEY , SINK_OPC_UA_NODE_URL_KEY )
164+ || parameters .getBooleanOrDefault (
165+ Arrays .asList (CONNECTOR_OPC_UA_WITH_QUALITY_KEY , SINK_OPC_UA_WITH_QUALITY_KEY ),
166+ CONNECTOR_OPC_UA_WITH_QUALITY_DEFAULT_VALUE )) {
164167 validator .validate (
165168 CONNECTOR_OPC_UA_MODEL_CLIENT_SERVER_VALUE ::equals ,
166169 String .format (
167- "When the OPC UA sink points to an outer server or specifies 'with-quality', the %s or %s must be %s." ,
170+ "When the OPC UA sink points to an outer server or sets 'with-quality' to true , the %s or %s must be %s." ,
168171 CONNECTOR_OPC_UA_MODEL_KEY ,
169172 SINK_OPC_UA_MODEL_KEY ,
170173 CONNECTOR_OPC_UA_MODEL_CLIENT_SERVER_VALUE ),
@@ -207,16 +210,22 @@ public void customize(
207210 final DataRegion region =
208211 StorageEngine .getInstance ()
209212 .getDataRegion (new DataRegionId (configuration .getRuntimeEnvironment ().getRegionId ()));
210- unQualifiedDatabaseName =
211- Objects .nonNull (region )
212- ? PathUtils .unQualifyDatabaseName (region .getDatabaseName ())
213- : "__temp_db" ;
213+ databaseName = Objects .nonNull (region ) ? region .getDatabaseName () : "__temp_db" ;
214+
215+ if (withQuality && PathUtils .isTableModelDatabase (databaseName )) {
216+ throw new PipeException (
217+ "When the OPC UA sink sets 'with-quality' to true, the table model data is not supported." );
218+ }
214219
215220 final String nodeUrl =
216221 parameters .getStringByKeys (CONNECTOR_OPC_UA_NODE_URL_KEY , SINK_OPC_UA_NODE_URL_KEY );
217222 if (Objects .isNull (nodeUrl )) {
218223 customizeServer (parameters );
219224 } else {
225+ if (PathUtils .isTableModelDatabase (databaseName )) {
226+ throw new PipeException (
227+ "When the OPC UA sink points to an outer server, the table model data is not supported." );
228+ }
220229 customizeClient (nodeUrl , parameters );
221230 }
222231 }
@@ -478,8 +487,8 @@ public boolean isClientServerModel() {
478487 return isClientServerModel ;
479488 }
480489
481- public String getUnQualifiedDatabaseName () {
482- return unQualifiedDatabaseName ;
490+ public String getDatabaseName () {
491+ return databaseName ;
483492 }
484493
485494 public String getPlaceHolder () {
0 commit comments