public async Task InsertStringRecordsOfOneDeviceSortedAsync()

in src/Apache.IoTDB/SessionPool.cs [1313:1363]


        public async Task<int> InsertStringRecordsOfOneDeviceSortedAsync(string deviceId, List<long> timestamps,
            List<List<string>> measurementsList, List<List<string>> valuesList, bool isAligned)
        {
            var client = _clients.Take();

            if (!_utilFunctions.IsSorted(timestamps))
            {
                throw new TException("insert string records of one device error: timestamp not sorted", null);
            }

            var req = GenInsertStringRecordsOfOneDeviceReq(deviceId, timestamps, measurementsList, valuesList, client.SessionId, isAligned);
            try
            {
                var status = await client.ServiceClient.insertStringRecordsOfOneDeviceAsync(req);

                if (_debugMode)
                {
                    _logger.LogInformation("insert string records of one device, message: {0}", 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.insertStringRecordsOfOneDeviceAsync(req);

                    if (_debugMode)
                    {
                        _logger.LogInformation("insert string records of one device, message: {0}", status.Message);
                    }

                    return _utilFunctions.VerifySuccess(status, SuccessCode, RedirectRecommendCode);

                }
                catch (TException ex)
                {
                    throw new TException("Error occurs when inserting string records of one device", ex);
                }
            }
            finally
            {
                _clients.Add(client);

            }
        }