-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(output plugin): Add new output plugin to support Apache IoTDB #11557
Conversation
localize makefile to fit windows init iotdb plugin
add iotdb config sample in Chinese; add iotdb config sample in Chinese; treat negative number as 0 in 'timeout' complete iotdb.go and it's sample.conf 1. complete iotdb.go, fix datatype array declare fault. 2. complete sample.conf go-mod updated; fix iotdb datatype bug 1. use thrift v0.14.2 to fit iotdb dependency 2. fix a bug in iotdb.go, it a var type mistake use nanosecond as defualt TimeStampUnit; add iotdb_test.go 1. use nanosecond as defualt TimeStampUnit 2. add iotdb_test.go use iotdb-client-go 0.12.1 use iotdb-client-go 0.12.1 but it's deppened on thrift 0.14.1 a pr of supporting thrift 0.15.0 is submitted, waitting for merge. add github.com/stretchr/testify v1.8.0 to go.sum make success update iotdb-client-go thrift to 0.15.0 backup makefile for local windows OS deal with 'Tags' in different methods 1. create function WriteRecordsWithTags to deal with 'Tags' in different methods 2. add config parameter treateTagsAs 3. add struct RecordsWithTags 4. fix typo 'invaild' update sample.conf, use better example update sample.conf, use better example Split function ‘WriteRecordsWithTags’ into multiple; complete tests 1. Split function ‘WriteRecordsWithTags’ into multiple: ConvertMetricsToRecordsWithTags -> ModifiyRecordsWithTags -> WriteRecordsWithTags 2. complete tests solve deep copy problem solve deep copy problem Optimize testing change defualt treateTagsAs; update test cases; update readme_zh 1. change defualt treateTagsAs, now it's "DeviceID_subtree" 2. update test cases, fix bug datatype mismatch. this bug occured becuase same mesurement use different datatype in different test cases. 3. update readme in chinese
1. delete makefile.bak, etc 2. update gitignore
update license of dependencies; fix readme 1. update license of dependencies; 2. fix readme to fit lint
0175dd9
to
5e39fda
Compare
update readme.md, delete long url optimize code style, local lint test has passed optimizing rules: 1. do not use underscores in Go names 2. avoid unnecessary conversion 3. use better structure of if-else, and encapsulate complex structures
5b049f9
to
f4cc0ee
Compare
1. the CI recognize language option as the first section. Of course it's very short so checks failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @citrusreticulata for this contribution. I have some requests in the code. Please take a look. Please also remove the non-English documentation and configuration examples as we only support English documents and comments.
Looking forward to the next round!
1. Code optimized 2. Using container in testing is NOT supported yet
fix some typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @citrusreticulata for the nice and fast update! This is a huge improvement already. I have some more comments and suggestions, but I feel we are coming closer with the PR. Please also convert your integration test-cases to use containers instead of relying on IoTDB being installed. Also switch to table based tests (see comment) and clearly separate into integration tests and short-tests.
Thank you for your appreciation and quick reply! I will complete the above modification suggestions. |
Code optimized according to [review](influxdata#11557 (review))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small things left. Please do not wrap the functions in the tests as this will hide the location of the actual error. Rather live with code duplication for easier debugging.
Code optimized; waiting for final review
fix docker image version
8a831c5
to
83f6711
Compare
I don't know why but ALL integration tests failed on my local machine. But also for other output plugins,. For example, mongoDB: They're all stuck at This makes it difficult for me to do local debugging |
I don't know why
So I reuse the original test method, that is, assume that there is an running instance locally, just like I know it's not friendly for CI, and testing is a little more troublesome than using |
So maybe dividing this group of tests into two functions is better for understand... I'd better do this. |
1. After this commit, Metric Conversion and Tags-Handling are tested in one function. But this commit divided them into two parts. This makes code easier to read.
I have solved the problem that the last test function is not easy to read. All CI tests passed. Thank you @srebhan very much for your support and help these days. We have had nearly 100 conversations and gradually improved the code to meet the standards and become excellent, which is inseparable from your help. I am very grateful for this! I also learned a lot from the reviews these days. |
We exactly want to get failing tests in this case! If the behavior changes, we want to know, as this might break existing use-cases. That's my point, your processing will always run both, so your tests (at least some) should also test this! |
All right. Entire conversion tests and failure test cases will be added in next commit. |
1. Added entire metrics conversion tests 2. support failure test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @citrusreticulata for the update and sorry for the late reply. Two very small things and we are good for the final review IMO...
Update iotdb_test.go; fix some typo
And one merge conflict to be resolved... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for your contribution @citrusreticulata and also for the nice review process!
c46fd34
to
15cef01
Compare
Emm... I think the "go.sum" conflict is not for me to solve. I have run |
The conflict is that there is a row in the
I think it's because someone forget to run And I run |
Problem solved! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a few suggestions on the readme. Thanks!
1. using subheadings instead of unordered lists. 2. uses better words 3. also update relevant comments in sample.conf
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
resolves #
Added an output plugin to support Apache IoTDB.
Modify file "go.mod", added external dependency: iotdb-client-go.
Added readme of Apache IoTDB output plugin in English and Chinese.
Information about relevant database: Apache IoTDB github, Apache IoTDB client for Golang
By the way, unit test of IoTDB output plugin requires an external running database, on 'localhost:6667' by default.
Related issue #11561