X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pm-file-converter%2Fcomponents%2Fkafkacollector%2Fkafkacollector.go;fp=pm-file-converter%2Fcomponents%2Fkafkacollector%2Fkafkacollector.go;h=a3c911ef1a4eb1752dc1be4b2f0ec500218dee65;hb=b7bbba33696d4f3e36a51710661152eda459eb74;hp=418b312729b5507712d9c6746026a18a4d3b7141;hpb=ba3389b19b7992f2bc237c4a8566463c55100e22;p=nonrtric%2Fplt%2Franpm.git diff --git a/pm-file-converter/components/kafkacollector/kafkacollector.go b/pm-file-converter/components/kafkacollector/kafkacollector.go index 418b312..a3c911e 100644 --- a/pm-file-converter/components/kafkacollector/kafkacollector.go +++ b/pm-file-converter/components/kafkacollector/kafkacollector.go @@ -18,7 +18,7 @@ // limitations under the License. // ========================LICENSE_END=================================== -//nolint:gocognit +//nolint:all package kafkacollector import ( @@ -49,7 +49,7 @@ const typeLabel = " for type: " const fetchTokenErrorMessage = "Cannot fetch token: " const setTokenErrorMessage = "Cannot set token: " -// This function intentionally has high cognitive complexity //NOSONAR +//nolint:all func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.ReaderControl, dataCh chan *dataTypes.KafkaPayload, gid string, cid string) { log.Info("Topic reader starting, topic: ", topic, typeLabel, typeId) @@ -182,7 +182,7 @@ func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.Read }() } -// This function intentionally has high cognitive complexity //NOSONAR +//nolint:all func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataTypes.KafkaPayload) { var kafkaProducer *kafka.Producer @@ -296,7 +296,7 @@ func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataT }() } -// We need to pass the kafka properties in this way for readability purpose //NOSONAR +//nolint:all func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer { var cm kafka.ConfigMap if creds_grant_type == "" { @@ -331,7 +331,7 @@ func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer return c } -// We need to pass the kafka properties in this way for readability purpose //NOSONAR +//nolint:all func startProducer() *kafka.Producer { log.Info("Creating kafka producer") @@ -358,6 +358,7 @@ func startProducer() *kafka.Producer { return p } +//nolint:all func StartJobXmlFileData(typeId string, controlCh chan dataTypes.JobControl, dataInCh chan *dataTypes.KafkaPayload, dataOutChannel chan *dataTypes.KafkaPayload, fvolume string, fsbucket string) { log.Info("Type job", typeId, " started") @@ -392,7 +393,7 @@ func StartJobXmlFileData(typeId string, controlCh chan dataTypes.JobControl, dat } } -// This function intentionally has more parameters for legacy compatibility //NOSONAR +//nolint:all func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression string, dataOutChannel chan *dataTypes.KafkaPayload, topicList map[string]string, jobLimiterChan chan struct{}, fvolume string, fsbucket string) { defer func() { <-jobLimiterChan @@ -437,7 +438,7 @@ func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression str } } -// This function intentionally has some patterns in logs for easier identification //NOSONAR +//nolint:all func FetchToken() (*kafka.OAuthBearerToken, error) { log.Debug("Get token inline") conf := &clientcredentials.Config{