(tablets []*Tablet, isAligned bool)
| 1048 | } |
| 1049 | |
| 1050 | func (s *Session) genInsertTabletsReq(tablets []*Tablet, isAligned bool) (*rpc.TSInsertTabletsReq, error) { |
| 1051 | var ( |
| 1052 | length = len(tablets) |
| 1053 | deviceIds = make([]string, length) |
| 1054 | measurementsList = make([][]string, length) |
| 1055 | valuesList = make([][]byte, length) |
| 1056 | timestampsList = make([][]byte, length) |
| 1057 | typesList = make([][]int32, length) |
| 1058 | sizeList = make([]int32, length) |
| 1059 | ) |
| 1060 | for index, tablet := range tablets { |
| 1061 | deviceIds[index] = tablet.insertTargetName |
| 1062 | measurementsList[index] = tablet.GetMeasurements() |
| 1063 | |
| 1064 | values, err := tablet.getValuesBytes() |
| 1065 | if err != nil { |
| 1066 | return nil, err |
| 1067 | } |
| 1068 | |
| 1069 | valuesList[index] = values |
| 1070 | timestampsList[index] = tablet.GetTimestampBytes() |
| 1071 | typesList[index] = tablet.getDataTypes() |
| 1072 | sizeList[index] = int32(tablet.RowSize) |
| 1073 | } |
| 1074 | request := rpc.TSInsertTabletsReq{ |
| 1075 | SessionId: s.sessionId, |
| 1076 | PrefixPaths: deviceIds, |
| 1077 | TypesList: typesList, |
| 1078 | MeasurementsList: measurementsList, |
| 1079 | ValuesList: valuesList, |
| 1080 | TimestampsList: timestampsList, |
| 1081 | SizeList: sizeList, |
| 1082 | IsAligned: &isAligned, |
| 1083 | } |
| 1084 | return &request, nil |
| 1085 | } |
| 1086 | |
| 1087 | func (s *Session) genInsertRecordsReq(deviceIds []string, measurements [][]string, dataTypes [][]TSDataType, values [][]interface{}, |
| 1088 | timestamps []int64, isAligned bool, |
no test coverage detected