in src/Apache.IoTDB/SessionPool.cs [1501:1550]
public async Task<int> TestInsertRecordAsync(string deviceId, RowRecord record)
{
var client = _clients.Take();
var req = new TSInsertRecordReq(
client.SessionId,
deviceId,
record.Measurements,
record.ToBytes(),
record.Timestamps);
try
{
var status = await client.ServiceClient.testInsertRecordAsync(req);
if (_debugMode)
{
_logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, 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.testInsertRecordAsync(req);
if (_debugMode)
{
_logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message);
}
return _utilFunctions.VerifySuccess(status, SuccessCode, RedirectRecommendCode);
}
catch (TException ex)
{
throw new TException("Error occurs when test inserting one record", ex);
}
}
finally
{
_clients.Add(client);
}
}