in iotdb-collector/collector-core/src/main/java/org/apache/iotdb/collector/plugin/builtin/sink/payload/thrift/request/PipeTransferSchemaSnapshotSealReq.java [47:96]
public static PipeTransferSchemaSnapshotSealReq toTPipeTransferReq(
final String treePattern,
final String tablePatternDatabase,
final String tablePatternTable,
final boolean isTreeCaptured,
final boolean isTableCaptured,
final String mTreeSnapshotName,
final long mTreeSnapshotLength,
final String tLogName,
final long tLogLength,
final String attributeSnapshotName,
final long attributeSnapshotLength,
final String databaseName,
final String typeString)
throws IOException {
final Map<String, String> parameters = new HashMap<>();
parameters.put(ColumnHeaderConstant.PATH_PATTERN, treePattern);
parameters.put(DATABASE_PATTERN, tablePatternDatabase);
parameters.put(ColumnHeaderConstant.TABLE_NAME, tablePatternTable);
if (isTreeCaptured) {
parameters.put(IClientSession.SqlDialect.TREE.toString(), "");
}
if (isTableCaptured) {
parameters.put(IClientSession.SqlDialect.TABLE.toString(), "");
}
parameters.put(ColumnHeaderConstant.DATABASE, databaseName);
parameters.put(ColumnHeaderConstant.TYPE, typeString);
final List<String> fileNameList;
final List<Long> fileLengthList;
// Tree model sync
if (Objects.isNull(attributeSnapshotName)) {
fileNameList =
Objects.nonNull(tLogName)
? Arrays.asList(mTreeSnapshotName, tLogName)
: Collections.singletonList(mTreeSnapshotName);
fileLengthList =
Objects.nonNull(tLogName)
? Arrays.asList(mTreeSnapshotLength, tLogLength)
: Collections.singletonList(mTreeSnapshotLength);
} else {
fileNameList = Arrays.asList(mTreeSnapshotName, tLogName, attributeSnapshotName);
fileLengthList = Arrays.asList(mTreeSnapshotLength, tLogLength, attributeSnapshotLength);
}
return (PipeTransferSchemaSnapshotSealReq)
new PipeTransferSchemaSnapshotSealReq()
.convertToTPipeTransferReq(fileNameList, fileLengthList, parameters);
}