public async Task CreateTimeSeries()

in src/Apache.IoTDB/SessionPool.cs [282:332]


        public async Task<int> CreateTimeSeries(
            string tsPath,
            TSDataType dataType,
            TSEncoding encoding,
            Compressor compressor)
        {
            var client = _clients.Take();
            var req = new TSCreateTimeseriesReq(
                client.SessionId,
                tsPath,
                (int)dataType,
                (int)encoding,
                (int)compressor);
            try
            {
                var status = await client.ServiceClient.createTimeseriesAsync(req);

                if (_debugMode)
                {
                    _logger.LogInformation("creating time series {0} successfully, server message is {1}", tsPath, 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.createTimeseriesAsync(req);
                    if (_debugMode)
                    {
                        _logger.LogInformation("creating time series {0} successfully, server message is {1}", tsPath, status.Message);
                    }
                    return _utilFunctions.VerifySuccess(status, SuccessCode, RedirectRecommendCode);

                }
                catch (TException ex)
                {
                    throw new TException("Error occurs when creating time series", ex);
                }
            }
            finally
            {
                _clients.Add(client);
            }

        }