in src/Apache.IoTDB/SessionPool.cs [486:535]
public async Task<int> CreateMultiTimeSeriesAsync(
List<string> tsPathLst,
List<TSDataType> dataTypeLst,
List<TSEncoding> encodingLst,
List<Compressor> compressorLst)
{
var client = _clients.Take();
var dataTypes = dataTypeLst.ConvertAll(x => (int)x);
var encodings = encodingLst.ConvertAll(x => (int)x);
var compressors = compressorLst.ConvertAll(x => (int)x);
var req = new TSCreateMultiTimeseriesReq(client.SessionId, tsPathLst, dataTypes, encodings, compressors);
try
{
var status = await client.ServiceClient.createMultiTimeseriesAsync(req);
if (_debugMode)
{
_logger.LogInformation("creating multiple time series {0}, server message is {1}", tsPathLst, status.Message);
}
return _utilFunctions.VerifySuccess(status, SuccessCode, RedirectRecommendCode);
}
catch (TException e)
{
await Open(_enableRpcCompression);
client = _clients.Take();
req.SessionId = client.SessionId;
try
{
var status = await client.ServiceClient.createMultiTimeseriesAsync(req);
if (_debugMode)
{
_logger.LogInformation("creating multiple time series {0}, server message is {1}", tsPathLst, status.Message);
}
return _utilFunctions.VerifySuccess(status, SuccessCode, RedirectRecommendCode);
}
catch (TException ex)
{
throw new TException("Error occurs when creating multiple time series", ex);
}
}
finally
{
_clients.Add(client);
}
}