Skip to content

Commit

Permalink
Merge f663282 into 8f8f93d
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliocimino committed Jul 18, 2023
2 parents 8f8f93d + f663282 commit b9e6b73
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Test/env_setup.sh
Expand Up @@ -43,9 +43,10 @@ wget https://github.com/Engineering-Research-and-Development/fiware-orion-pyspar
unzip main.zip
echo "repository downloaded and unzipped"
mkdir ci/PySpark/
sed -i "s/FPC.connectorconf/connectorconf/g" fiware-orion-pyspark-connector-main/FPC/connector.py
mkdir ci/PySpark/fpc
sed -i "s/fpc.connectorconf/connectorconf/g" fiware-orion-pyspark-connector-main/fpc/connector.py
mv fiware-orion-pyspark-connector-main/fpc/connector.py ./ci/PySpark/
mv fiware-orion-pyspark-connector-main/fpc/connectorconf.py ./ci/PySpark/
mv fiware-orion-pyspark-connector-main/fpc/connectorconf.py ./ci/PySpark/fpc
mv fiware-orion-pyspark-connector-main/fpc/__init__.py ./ci/PySpark/
# mv fiware-orion-pyspark-connector-main/fpc/subscribing_tool.py ./ci/PySpark/
rm -r fiware-orion-pyspark-connector-main
Expand Down
6 changes: 3 additions & 3 deletions Test/v2_replier_start.py
Expand Up @@ -2,9 +2,9 @@
#import subscribing_tool as sub


response = connector.UnstructuredReplyToBroker('{ "value" :' + str(20) +' }', "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PUT")
response2 = connector.SemistructuredReplyToBroker("20", '{"value" : %%TOREPLACE%% }', "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PUT")
response3 = connector.ReplyToBroker("20", "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PUT")
response = connector.UnstructuredReplyToBroker('{ "value" :' + str(20) +' }', "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PATCH")
response2 = connector.SemistructuredReplyToBroker("20", '{"value" : %%TOREPLACE%% }', "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PATCH")
response3 = connector.ReplyToBroker("20", "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PATCH")


msg = '{"timestamp":"2022-06-17T09:58:34.152716","Host":"10.0.2.15:8061","User-Agent":"orion/3.6.0 libcurl/7.61.1","Fiware-Servicepath":"/","Accept":"application/json","Content-Length":"260","Content-Type":"application/json; charset=utf-8","Fiware-Correlator":"49330d2c-ee13-11ec-be47-0242ac130002; cbnotif=1","Ngsiv2-AttrsFormat":"normalized","Body":{"subscriptionId":"62a8907ec8eef3395b17eafd","data":[{"id":"urn:ngsi-ld:Product:010","type":"Product","name":{"type":"Text","value":"Lemonade","metadata":{}},"price":{"type":"Number","value":20,"metadata":{}},"size":{"type":"Text","value":"S","metadata":{}}}]}}'
Expand Down
5 changes: 3 additions & 2 deletions ci/env_setup.sh
Expand Up @@ -43,9 +43,10 @@ wget https://github.com/Engineering-Research-and-Development/fiware-orion-pyspar
unzip main.zip
echo "repository downloaded and unzipped"
mkdir ci/PySpark/
sed -i "s/FPC.connectorconf/connectorconf/g" fiware-orion-pyspark-connector-main/FPC/connector.py
mkdir ci/PySpark/fpc
sed -i "s/fpc.connectorconf/connectorconf/g" fiware-orion-pyspark-connector-main/fpc/connector.py
mv fiware-orion-pyspark-connector-main/fpc/connector.py ./ci/PySpark/
mv fiware-orion-pyspark-connector-main/fpc/connectorconf.py ./ci/PySpark/
mv fiware-orion-pyspark-connector-main/fpc/connectorconf.py ./ci/PySpark/fpc
mv fiware-orion-pyspark-connector-main/fpc/__init__.py ./ci/PySpark/
mv fiware-orion-pyspark-connector-main/fpc/subscribing_tool.py ./ci/PySpark/
rm -r fiware-orion-pyspark-connector-main
Expand Down
6 changes: 3 additions & 3 deletions ci/v2_test/start.py
Expand Up @@ -16,9 +16,9 @@
event, ssc = connector.Prime(sc, 5 , StorageLevel.MEMORY_AND_DISK_2)

event = event.flatMap(lambda x: x.entities).map(lambda x: x.attrs['price'].value)
response = event.map(lambda x : connector.UnstructuredReplyToBroker('{ "value" :' + str(20) +' }'))
response2 = event.map(lambda x: connector.SemistructuredReplyToBroker(20, '{"value" : %%TOREPLACE%% }'))
response3 = event.map(lambda x : connector.ReplyToBroker(20))
response3 = event.map(lambda x : connector.ReplyToBroker(20, "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PUT"))
response = event.map(lambda x : connector.UnstructuredReplyToBroker('{ "value" :' + str(20) +' }', "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PUT"))
response2 = event.map(lambda x: connector.SemistructuredReplyToBroker(20, '{"value" : %%TOREPLACE%% }', "http://localhost:1026/v2/entities/urn:ngsi-ld:Product:010/attrs/price/", "PUT"))
event.pprint()
response.pprint()
response2.pprint()
Expand Down

0 comments on commit b9e6b73

Please sign in to comment.