Skip to content
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

Task/json metadata #1919

Merged
merged 4 commits into from
Sep 2, 2020
Merged

Task/json metadata #1919

merged 4 commits into from
Sep 2, 2020

Conversation

IvanHdzC
Copy link
Contributor

@IvanHdzC IvanHdzC commented Sep 1, 2020

This PR is related to #1902.

Copy link
Member

@AlvaroVega AlvaroVega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A CNR update is needed

@IvanHdzC
Copy link
Contributor Author

IvanHdzC commented Sep 2, 2020

A CNR update is needed

Fixed in e4c21a1

@manucarrace
Copy link
Collaborator

manucarrace commented Sep 2, 2020

Just a question. If I store metadata in a JsonArray object, does it mean that when I persist the data it will be stored between square brackets? Even when there is a single metadata?

@AlvaroVega AlvaroVega self-requested a review September 2, 2020 07:25
Copy link
Member

@AlvaroVega AlvaroVega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IvanHdzC
Copy link
Contributor Author

IvanHdzC commented Sep 2, 2020

Just a question. If I store metadata in a JsonArray object, does it mean that when I persist the data it will be stored between square brackets? Even when there is a single metadata?

That's correct @manucarrace. It always be on square brackets.

@AlvaroVega AlvaroVega merged commit 284eb30 into master Sep 2, 2020
@manucarrace
Copy link
Collaborator

LGTM

@manucarrace manucarrace deleted the task/json_metadata branch September 2, 2020 08:04
@AlvaroVega
Copy link
Member

@IvanHdzC This log was reported after test it:

time=2020-09-03T13:51:09.462Z | lvl=INFO | corr=855996f0-edec-11ea-ae1e-fa163ec74401 | trans=439cf0b7-e70e-483e-b27e-ac17f6e06d8f | srv=dipbad | subsrv=/envAirQualityRESPIRA | op=getEvents | comp=Cygnus | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[306] : [NGSIRestHandler] Starting internal transaction (439cf0b7-e70e-483e-b27e-ac17f6e06d8f)
time=2020-09-03T13:51:09.464Z | lvl=INFO | corr=855996f0-edec-11ea-ae1e-fa163ec74401 | trans=439cf0b7-e70e-483e-b27e-ac17f6e06d8f | srv=dipbad | subsrv=/envAirQualityRESPIRA | op=getEvents | comp=Cygnus | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[324] : [NGSIRestHandler] Received data ({"subscriptionId":"5f475ac02d7063421980836a","originator":"localhost","contextResponses":[{"contextElement":{"type":"RESPIRA","isPattern":"false","id":"bada1","attributes":[{"name":"TimeInstant","type":"DateTime","value":"2020-07-01T20:32:06.000Z","metadatas":[{"name":"dateCreated","type":"DateTime","value":"2020-01-10T10:08:33.000Z"},{"name":"dateModified","type":"DateTime","value":"2020-07-08T10:55:38.000Z"}]},{"name":"airQualityIndex","type":"Number","value":31,"metadatas":[{"name":"dateCreated","type":"DateTime","value":"2020-01-10T10:08:33.000Z"},{"name":"dateModified","type":"DateTime","value":"2020-07-08T10:55:38.000Z"}]}]},"statusCode":{"code":"200","reasonPhrase":"OK"}}]})
time=2020-09-03T13:51:13.516Z | lvl=ERROR | corr=855996f0-edec-11ea-ae1e-fa163ec74401 | trans=439cf0b7-e70e-483e-b27e-ac17f6e06d8f | srv=dipbad | subsrv=/envAirQualityRESPIRA | op=processNewBatches | comp=Cygnus | msg=com.telefonica.iot.cygnus.sinks.NGSISink[587] : java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2Stack trace: [com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176), com.google.gson.Gson.fromJson(Gson.java:795), com.google.gson.Gson.fromJson(Gson.java:761), com.google.gson.Gson.fromJson(Gson.java:710), com.google.gson.Gson.fromJson(Gson.java:682), com.telefonica.iot.cygnus.aggregation.NGSIGenericColumnAggregator.aggregate(NGSIGenericColumnAggregator.java:111), com.telefonica.iot.cygnus.sinks.NGSICKANSink.persistBatch(NGSICKANSink.java:285), com.telefonica.iot.cygnus.sinks.NGSISink.processNewBatches(NGSISink.java:569), com.telefonica.iot.cygnus.sinks.NGSISink.process(NGSISink.java:371), org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68), org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147), java.lang.Thread.run(Thread.java:748)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants