Skip to content

Commit 39b13b1

Browse files
committed
placeholder
1 parent 2d0c750 commit 39b13b1

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaSink.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_MODEL_KEY;
8585
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_MODEL_PUB_SUB_VALUE;
8686
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_NODE_URL_KEY;
87-
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_PLACEHOLDER_DEFAULT_VALUE;
87+
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_PLACEHOLDER_4_NULL_TAG_DEFAULT_VALUE;
8888
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_PLACEHOLDER_KEY;
8989
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_QUALITY_NAME_DEFAULT_VALUE;
9090
import static org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant.CONNECTOR_OPC_UA_QUALITY_NAME_KEY;
@@ -141,7 +141,7 @@ public class OpcUaSink implements PipeConnector {
141141
private String serverKey;
142142
private boolean isClientServerModel;
143143
private String databaseName;
144-
private String placeHolder;
144+
private String placeHolder4NullTag;
145145
private @Nullable String valueName;
146146
private @Nullable String qualityName;
147147
private StatusCode defaultQuality;
@@ -224,10 +224,10 @@ public void customize(
224224
Arrays.asList(CONNECTOR_OPC_UA_MODEL_KEY, SINK_OPC_UA_MODEL_KEY),
225225
CONNECTOR_OPC_UA_MODEL_DEFAULT_VALUE)
226226
.equals(CONNECTOR_OPC_UA_MODEL_CLIENT_SERVER_VALUE);
227-
placeHolder =
227+
placeHolder4NullTag =
228228
parameters.getStringOrDefault(
229229
Arrays.asList(CONNECTOR_OPC_UA_PLACEHOLDER_KEY, SINK_OPC_UA_PLACEHOLDER_KEY),
230-
CONNECTOR_OPC_UA_PLACEHOLDER_DEFAULT_VALUE);
230+
CONNECTOR_OPC_UA_PLACEHOLDER_4_NULL_TAG_DEFAULT_VALUE);
231231
final DataRegion region =
232232
StorageEngine.getInstance()
233233
.getDataRegion(new DataRegionId(configuration.getRuntimeEnvironment().getRegionId()));
@@ -556,8 +556,8 @@ public String getDatabaseName() {
556556
return databaseName;
557557
}
558558

559-
public String getPlaceHolder() {
560-
return placeHolder;
559+
public String getPlaceHolder4NullTag() {
560+
return placeHolder4NullTag;
561561
}
562562

563563
@Nullable

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/client/IoTDBOpcUaClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public class IoTDBOpcUaClient {
6969

7070
// Customized nodes
7171
private static final int NAME_SPACE_INDEX = 2;
72+
73+
// Useless for a server only accept client writing
74+
private static final double SAMPLING_INTERVAL_PLACEHOLDER = 500;
7275
private final String nodeUrl;
7376

7477
private final SecurityPolicy securityPolicy;
@@ -281,7 +284,7 @@ private VariableAttributes createMeasurementAttributes(
281284
null, // arrayDimensions
282285
AccessLevel.toValue(AccessLevel.READ_WRITE),
283286
AccessLevel.toValue(AccessLevel.READ_WRITE),
284-
500.0, // samplingInterval
287+
SAMPLING_INTERVAL_PLACEHOLDER,
285288
historizing);
286289
}
287290

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/server/OpcUaNameSpace.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static void transferTabletForClientServerModel(
156156

157157
for (int j = 0; j < segments.length; ++j) {
158158
folderSegments[j + 1] =
159-
Objects.isNull(segments[j]) ? sink.getPlaceHolder() : (String) segments[j];
159+
Objects.isNull(segments[j]) ? sink.getPlaceHolder4NullTag() : (String) segments[j];
160160
}
161161

162162
final int finalI = i;
@@ -393,7 +393,7 @@ private void transferTabletForPubSubModel(
393393
for (final Object segment : tablet.getDeviceID(i).getSegments()) {
394394
idBuilder
395395
.append(TsFileConstant.PATH_SEPARATOR)
396-
.append(Objects.isNull(segment) ? sink.getPlaceHolder() : segment);
396+
.append(Objects.isNull(segment) ? sink.getPlaceHolder4NullTag() : segment);
397397
}
398398
sourceNameList.add(idBuilder.toString());
399399
}

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/constant/PipeSinkConstant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public class PipeSinkConstant {
181181

182182
public static final String CONNECTOR_OPC_UA_PLACEHOLDER_KEY = "connector.opcua.placeholder";
183183
public static final String SINK_OPC_UA_PLACEHOLDER_KEY = "sink.opcua.placeholder";
184-
public static final String CONNECTOR_OPC_UA_PLACEHOLDER_DEFAULT_VALUE = "null";
184+
public static final String CONNECTOR_OPC_UA_PLACEHOLDER_4_NULL_TAG_DEFAULT_VALUE = "null";
185185

186186
public static final String CONNECTOR_OPC_UA_WITH_QUALITY_KEY = "connector.opcua.with-quality";
187187
public static final String SINK_OPC_UA_WITH_QUALITY_KEY = "sink.opcua.with-quality";

0 commit comments

Comments
 (0)