Fine0830 commented on a change in pull request #30:
URL: https://github.com/apache/skywalking-banyandb/pull/30#discussion_r684606363
##########
File path: banyand/liaison/grpc/grpc.go
##########
@@ -128,3 +166,87 @@ func (s *Server) GracefulStop() {
s.log.Info().Msg("stopping")
s.ser.GracefulStop()
}
+
+func assemblyWriteData(shardID uint, writeEntity *v1.WriteRequest, seriesID
uint64) data.TraceWriteDate {
+ return data.TraceWriteDate{ShardID: shardID, SeriesID: seriesID,
WriteRequest: writeEntity}
+}
+
+func (s *Server) Write(TraceWriteServer v1.TraceService_WriteServer) error {
+ for {
+ writeEntity, err := TraceWriteServer.Recv()
+ if err == io.EOF {
+ return nil
+ }
+ if err != nil {
+ return err
+ }
+
+ //log.Println("writeEntity:", writeEntity)
+ ana := logical.DefaultAnalyzer()
+ metadata := common.Metadata{
+ KindVersion: apischema.SeriesKindVersion,
+ Spec: writeEntity.GetMetadata(),
+ }
+ schema, ruleError := ana.BuildTraceSchema(context.TODO(),
metadata)
+ if ruleError != nil {
+ return ruleError
+ }
+ if s.seriesInfo.seriesEvent == nil {
+ return errors.New("No seriesEvents")
+ }
+ seriesIDLen :=
len(s.seriesInfo.seriesEvent.FieldNamesCompositeSeriesId)
+ var str string
+ var arr []string
+ for i := 0; i < seriesIDLen; i++ {
Review comment:
uh... I am confused. There are two arrays([]*FieldRef and []*Field), can
I get results in one iteration? the Field of Write has only Value without Key.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]