aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-core/src/test/kotlin
AgeCommit message (Collapse)AuthorFilesLines
2018-09-24Remove end-of-transmission message from protocolFilip Krzywka1-96/+23
Also update protobuf files definitions to latest version. Change-Id: I0cd5d2d8deec5c787e2d3948d3d905fa672f9fea Issue-ID: DCAEGEN2-775 Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
2018-09-17Align with latest HV-VES proto definitionFilip Krzywka4-42/+31
- excluded measurements proto files from build to keep them reference-only Change-Id: I8c6de20eeeb1b9f8cd2ae4e865de368afe55cc91 Issue-ID: DCAEGEN2-775 Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
2018-09-13Align with configuration present in consulJakub Dudycz1-2/+2
Rename few configuration json keys inside collector code to match those on consul. Change-Id: I400aebce98049118a30d7959dc6655a4da6016bf Issue-ID: DCAEGEN2-774 Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
2018-08-16Remove Ratpack dependency for HV-VES health checksPiotr Jaszczyk1-5/+5
In order to minimize complexity and possibly improve performance (thread count) reactor-netty should be used instead of Ratpack. Also reorganize code to be more consistent and differentiated readiness and liveness endpoints (for future use in K8s Pod definition). As an example I've defined health check probe in docker-compose YAML. Change-Id: I1b5ce3d685e7ae5b0515b2146ae4fa88b3b41186 Issue-ID: DCAEGEN2-705 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
2018-08-09Implement simple health check mechanismJakub Dudycz1-41/+72
Change-Id: Ic4b8b59ced9dc19c9ebf26131036a9e1a752164f Issue-ID: DCAEGEN2-659 Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
2018-08-03Extract test-utils modulefkrzywka3-77/+21
- removed duplicate code that was creating VesMessages and similiar objects - removed duplicate code in command line parsing tests - made minor refactorings to avoid passing unnecessary params and to be as verbose as possible in tests Closes ONAP-699 Change-Id: I2607f1f775054ae1c5f275c231895f838b415371 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-03Fix NPE when getting Consul configurationPiotr Jaszczyk1-34/+28
No initial value for AtomicReference was provided hence we had a little race condition. Retry when consul returns error. Change-Id: Ie38ca7fbf445123e98ee94703eba501bb5233fab Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-03Enable UNDEFINED option in commonHeader GPB schemakjaniak2-18/+59
Closes ONAP-655 Change-Id: I6fc830d2b8c7bdd726f306a6fbf7e979f39e03f0 Signed-off-by: kjaniak <kornel.janiak@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-03Fix consul request timeout issueJakub Dudycz1-2/+3
Fix timeout issue when using consul blocking query calls by switching to standard requests peformed in given interval Closes ONAP-628 Change-Id: Ifaf7ddfa27045015a7a90c178e0d6d38955c0c58 Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-03Add command line option to disable SSL/TLSkjaniak1-30/+55
Closes ONAP-508 Change-Id: If6c3935ede7b00dea9b36747c6cd1422c1c8d330 Signed-off-by: kjaniak <kornel.janiak@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-03Use Try/Option monad when decoding protobuffkrzywka1-9/+30
Closes ONAP-143 Change-Id: I33cb2d24cd5962318a6f405096db298bbdbab963 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-03Include msg generator module in coverage reportfkrzywka1-2/+0
* Reordered alphabetically modules in main pom file * Removed unused imports * Corrected visibility for fields/methods * Fix typos in tests Change-Id: I35c515b3844bc8517cc6ffb0c6557596505536c9 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Use MessageValidator in VesMessage classJakub Dudycz1-1/+1
Closes ONAP-493 Change-Id: I15b5f0f1052865aa29ffa103bef2368bd94021e8 Signed-off-by: Jakub Dudycz <jdudycz@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Enhance wire protocolfkrzywka1-24/+97
Handle new wire frame message type which should allow clients to indicate that all data has been sent to collector Change xNF Simulator to send end-of-transmission message after sending all messages Close ves-hv-collector stream after encountering EOT message Remove duplicated file in project Closes ONAP-391 Change-Id: Idb6afc41d4bb0220a29df10c2aecfd76acd3ad16 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Implement blocking consul callsJakub Dudycz2-27/+54
Replaced interval based requesting for consul configuration with blocking query calls Closes ONAP-80 Change-Id: If70365bae9fde513d99b047209d085122a5df0dd Signed-off-by: Jakub Dudycz <jdudycz@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Enhancement of routing testkjaniak1-7/+6
Change-Id: I432c09a219928d1a89a0c619db0e8cc3104af0ec Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Use Either instead of exceptions in frame decoderPiotr Jaszczyk1-6/+5
Goals: * Make code cleaner (in a FP way) * Avoid costly exception throw each time we wait for the rest of the frame (collecting stack traces is costly and we do not need them anyway) Closes ONAP-437 Change-Id: I40341d3c2cb85f3ff581d89167245cb009dbb070 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Change Consul configuration update policyJakub Dudycz2-23/+81
- At startup default config is applied - Configuration is updated in intervals given at VES-HV service startup to allow dynamic changes - Included consul service startup in docker-compose file - VES-HV now exits when fails to acquire confguration from consul Closes ONAP-229 Change-Id: I896cfd177fa45381f9822278c2dffc113dd3df72 Signed-off-by: jakub.dudycz@nokia.com Issue-ID: DCAEGEN2-601
2018-08-02Various improvementsPiotr Jaszczyk1-7/+10
* Kotlin upgrade * Monad usage on APIs * Idle timeout * Simulator enhancements Closes ONAP-390 Change-Id: I3c00fcfe38c722caf661ddaad428cf089eeefcaa Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Refactor ArgBasedConfigurationfkrzywka1-1/+1
Extracted duplicate code from Client/Server ArgBasedConfiguration, as it probably would be used third time in future work Change-Id: I581abbcd5f1dd4a1a049e1d28e68a7e4d82a84f8 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Check license notes during buildPiotr Jaszczyk2-0/+38
I wanted to use oparent as parent pom but unfortunately jacoco plugin is configured differently there. Currently oparent provides support for jacoco (static code analysis), checkstyle (licenses + code style) and swagger api documentation. In ves-hv: * jacoco is preconfigured for kotlin (but currently not very usable as it's not ready for kotlin-generated code ie. displayed coverage is well under the actual coverage; there is an ongoing effort in jacoco and kotlin communities to fix that). * checkstyle - this task adds support for checking licenses using oparent:checkstyle artifact. Static code analysis is already done using Detekt. * swagger - ves-hv is not exposing REST API so there is no need for this. Closes ONAP-364 Change-Id: If2727a97d826dcab473b2e1e80171d8124ae52d4 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-02Implement Kafka SinkPiotr Jaszczyk4-45/+69
Closes ONAP-146 Change-Id: I119a8abe70a9042f65a43909e5aa2fbed439e26f Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-01Fix TCP stream framing issuePiotr Jaszczyk3-106/+238
Because of the nature of TCP protocol we receive consecutive IO buffer snapshots - not separate messages. That means that we need to join incomming buffers and then split it into separate WireFrames. Closes ONAP-312 Change-Id: I84ba0ec58a41ff9026f2fca24d2b15f3adcf0a19 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-01Extract domain modulefkrzywka6-64/+7
WireFrame extracted to domain module Domain package name in collector-core changed to avoid collision Merged Protobuf module with new domain module Closes ONAP-253. Change-Id: Ie7ac0bb877eae018a7520b4f3ceebe9fd51dbf65 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-01Copyright notice correctionfkrzywka3-3/+3
Change-Id: I8a8ca4cb4c1cc0d437edfe4f43f3063f135161c3 Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
2018-08-01Use SSL for encrypting the connectionPiotr Jaszczyk1-0/+79
Netty's OpenSSL bindings are used Closes ONAP-179 Change-Id: I8249fbaaed1dd869b733db04a27cebf53962c80c Issue-ID: DCAEGEN2-601 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
2018-08-01Fix wire protocol decoder refCnt issuePiotr Jaszczyk1-0/+55
We should use retain + slice because every reactor-netty operator automatically releases the buffer. Change-Id: Ie0282e70fadb56d56fc410a08e036fb0ca10584c Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
2018-07-26HV VES Collector seed codePiotr Jaszczyk6-0/+493
Contains squashed commits up to 11fe6b63 (2018-05-30). The whole contains a basic project structure. We are trying to put rest of the commits one by one so we do not loose the history. Bellow there are messages of the single commits in this squashed bulk: Basic project setup Create base maven project with Gitlab CI configuration. Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Merging guildeline Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Add remote branch delete command Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Sample runtime in Kotlin - PoC Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Setup project internal architecture Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Message routing Determine target topic and partition by VES Common Header. Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Parse GPB message header fkrzywka <filip.krzywka@nokia.com> Set listen port based on command line args Use Apache Commons CLI to parse cmd line args. Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Drop invalid GPB messages Instead of propagating error and closing stream just drop the message and proceed. Final handling logic may include closing the connection or sending some message depending on the specification. Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Add Apache license file Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Convert to maven multi-module project fkrzywka <filip.krzywka@nokia.com> Component tests with current GPB schema * Using v5 draft protobuf definition * Code reorganized to so component boundaries are more visible Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Thin logging facade over slf4j Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Introduce code analysis tools Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Implemented reading configuration from consul Ves Common Header validation added (required parameters existance check) Micro benchmark for direct vs on-heap NIO buffers Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Decode wire protocol and fix (most?) memory leaks Proposed wire protocol is just a suggestion and will (should) change in the future. Netty's ByteBuf is a reference-counted wrapper over a memory chunk. It is crucial to free unused buffers by means of release() method. The general rule regarding memory management was suggested. Let's put all memory-cleanup logic in main VesHvCollector class so other classes could focus on their job. Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Minor cleanup Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Add license info in files Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Change-Id: Ic484aa107eba48ad48f8ab222799e1795dffa865 Issue-ID: DCAEGEN2-601 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>