From 4629b76ca8f3d7056c3c354e48833f9f0562e49d Mon Sep 17 00:00:00 2001 From: WSO2 Builder Date: Thu, 19 Sep 2019 17:29:15 +0000 Subject: [PATCH] [WSO2-Release] [Release 2.0.3] update documentation for release 2.0.3 --- README.md | 7 +- docs/api/2.0.3.md | 146 +++++++++++++++++++++++++++++++++++++ docs/api/latest.md | 17 ++--- docs/index.md | 7 +- mkdocs.yml | 175 +++++++++++++++++++++++---------------------- 5 files changed, 249 insertions(+), 103 deletions(-) create mode 100644 docs/api/2.0.3.md diff --git a/README.md b/README.md index 70705ab4..9055ffac 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,12 @@ For information on Siddhi and i ## Latest API Docs -Latest API Docs is 2.0.2. +Latest API Docs is 2.0.3. ## Features -* avro *(Sink Mapper)*

This extension is a Siddhi Event to Avro Message output mapper.Transports that publish messages to Avro sink can utilize this extension to convert Siddhi events to Avro messages.
 You can either specify the Avro schema or provide the schema registry URL and the schema reference ID as parameters in the stream definition.
If no Avro schema is specified, a flat Avro schema of the 'record' type is generated with the stream attributes as schema fields.

-* avro *(Source Mapper)*

This extension is an Avro to Event input mapper. Transports that accept Avro messages can utilize this extension to convert the incoming Avro messages to Siddhi events.
 The Avro schema to be used for creating Avro messages can be specified as a parameter in the stream definition.
 If no Avro schema is specified, a flat avro schema of the 'record' type is generated with the stream attributes as schema fields.
The generated/specified Avro schema is used to convert Avro messages to Siddhi events.

- +* avro *(Sink Mapper)*

This extension is a Siddhi Event to Avro Message output mapper.Transports that publish messages to Avro sink can utilize this extension to convert Siddhi events to Avro messages.
 You can either specify the Avro schema or provide the schema registry URL and the schema reference ID as parameters in the stream definition.
If no Avro schema is specified, a flat Avro schema of the 'record' type is generated with the stream attributes as schema fields.

+* avro *(Source Mapper)*

This extension is an Avro to Event input mapper. Transports that accept Avro messages can utilize this extension to convert the incoming Avro messages to Siddhi events.
 The Avro schema to be used for creating Avro messages can be specified as a parameter in the stream definition.
 If no Avro schema is specified, a flat avro schema of the 'record' type is generated with the stream attributes as schema fields.
The generated/specified Avro schema is used to convert Avro messages to Siddhi events.

## Dependencies diff --git a/docs/api/2.0.3.md b/docs/api/2.0.3.md new file mode 100644 index 00000000..24a88895 --- /dev/null +++ b/docs/api/2.0.3.md @@ -0,0 +1,146 @@ +# API Docs - v2.0.3 + +!!! Info "Tested Siddhi Core version: *5.1.0*" + It could also support other Siddhi Core minor versions. + +## Sinkmapper + +### avro *(Sink Mapper)* +

This extension is a Siddhi Event to Avro Message output mapper.Transports that publish messages to Avro sink can utilize this extension to convert Siddhi events to Avro messages.
 You can either specify the Avro schema or provide the schema registry URL and the schema reference ID as parameters in the stream definition.
If no Avro schema is specified, a flat Avro schema of the 'record' type is generated with the stream attributes as schema fields.

+Syntax + +``` +@sink(..., @map(type="avro", schema.def="", schema.registry="", schema.id="") +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
schema.defThis specifies the required Avro schema to be used to convert Siddhi events to Avro messages.
The schema needs to be specified as a quoted JSON string.
STRINGNoNo
schema.registryThis specifies the URL of the schema registry.STRINGNoNo
schema.idThis specifies the ID of the avro schema. This ID is the global ID that is returned from the schema registry when posting the schema to the registry. The specified ID is used to retrieve the schema from the schema registry.STRINGNoNo
+ +Examples +EXAMPLE 1 +``` +@sink(type='inMemory', topic='stock', @map(type='avro',schema.def = """{"type":"record","name":"stock","namespace":"stock.example","fields":[{"name":"symbol","type":"string"},{"name":"price":"type":"float"},{"name":"volume","type":"long"}]}""")) +define stream StockStream (symbol string, price float, volume long); +``` +

The above configuration performs a default Avro mapping that generates an Avro message as an output ByteBuffer.

+ +EXAMPLE 2 +``` +@sink(type='inMemory', topic='stock', @map(type='avro',schema.registry = 'http://localhost:8081', schema.id ='22',@payload("""{"Symbol":{{symbol}},"Price":{{price}},"Volume":{{volume}}}""" +))) +define stream StockStream (symbol string, price float, volume long); +``` +

The above configuration performs a custom Avro mapping that generates an Avro message as an output ByteBuffer. The Avro schema is retrieved from the given schema registry (localhost:8081) using the schema ID provided.

+ +## Sourcemapper + +### avro *(Source Mapper)* +

This extension is an Avro to Event input mapper. Transports that accept Avro messages can utilize this extension to convert the incoming Avro messages to Siddhi events.
 The Avro schema to be used for creating Avro messages can be specified as a parameter in the stream definition.
 If no Avro schema is specified, a flat avro schema of the 'record' type is generated with the stream attributes as schema fields.
The generated/specified Avro schema is used to convert Avro messages to Siddhi events.

+Syntax + +``` +@source(..., @map(type="avro", schema.def="", schema.registry="", schema.id="", fail.on.missing.attribute="") +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
schema.defThis specifies the schema of the Avro message. The full schema used to create the Avro message needs to be specified as a quoted JSON string.STRINGNoNo
schema.registryThis specifies the URL of the schema registry.STRINGNoNo
schema.idThis specifies the ID of the Avro schema. This ID is the global ID that is returned from the schema registry when posting the schema to the registry. The schema is retrieved from the schema registry via the specified ID.STRINGNoNo
fail.on.missing.attributeIf this parameter is set to 'true', a JSON execution failing or returning a null value results in that message being dropped by the system.
If this parameter is set to 'false', a JSON execution failing or returning a null value results in the system being prompted to send the event with a null value to Siddhi so that the user can handle it as required (i.e., by assigning a default value.
trueBOOLYesNo
+ +Examples +EXAMPLE 1 +``` +@source(type='inMemory', topic='user', @map(type='avro', schema .def = """{"type":"record","name":"userInfo","namespace":"user.example","fields":[{"name":"name","type":"string"}, {"name":"age","type":"int"}]}""")) +define stream UserStream (name string, age int ); + +``` +

The above Siddhi query performs a default Avro input mapping. The input Avro message that contains user information is converted to a Siddhi event.
The expected input is a byte array or ByteBuffer.

+ +EXAMPLE 2 +``` +@source(type='inMemory', topic='user', @map(type='avro', schema .def = """{"type":"record","name":"userInfo","namespace":"avro.userInfo","fields":[{"name":"username","type":"string"}, {"name":"age","type":"int"}]}""",@attributes(name="username",age="age"))) +define stream userStream (name string, age int ); + +``` +

The above Siddhi query performs a custom Avro input mapping. The input Avro message that contains user information is converted to a Siddhi event.
 The expected input is a byte array or ByteBuffer.

+ +EXAMPLE 3 +``` +@source(type='inMemory', topic='user', @map(type='avro',schema.registry='http://192.168.2.5:9090', schema.id='1',@attributes(name="username",age="age"))) +define stream UserStream (name string, age int ); + +``` +

The above Siddhi query performs a custom Avro input mapping. The input Avro message that contains user information is converted to a Siddhi event via the schema retrieved from the given schema registry(localhost:8081).
The expected input is a byte array or ByteBuffer.

+ diff --git a/docs/api/latest.md b/docs/api/latest.md index 0901853d..24a88895 100644 --- a/docs/api/latest.md +++ b/docs/api/latest.md @@ -1,12 +1,14 @@ -# API Docs - v2.0.2 +# API Docs - v2.0.3 -## Sinkmapper +!!! Info "Tested Siddhi Core version: *5.1.0*" + It could also support other Siddhi Core minor versions. -### avro *(Sink Mapper)* +## Sinkmapper +### avro *(Sink Mapper)*

This extension is a Siddhi Event to Avro Message output mapper.Transports that publish messages to Avro sink can utilize this extension to convert Siddhi events to Avro messages.
 You can either specify the Avro schema or provide the schema registry URL and the schema reference ID as parameters in the stream definition.
If no Avro schema is specified, a flat Avro schema of the 'record' type is generated with the stream attributes as schema fields.

- Syntax + ``` @sink(..., @map(type="avro", schema.def="", schema.registry="", schema.id="") ``` @@ -50,7 +52,7 @@ Examples EXAMPLE 1 ``` -@sink(type='inMemory', topic='stock', @map(type='avro',schema.def = """{"type":"record","name":"stock","namespace":"stock.example","fields":[{"name":"symbol","type":"string"},{"name":"price","type":"float"},{"name":"volume","type":"long"}]}""")) +@sink(type='inMemory', topic='stock', @map(type='avro',schema.def = """{"type":"record","name":"stock","namespace":"stock.example","fields":[{"name":"symbol","type":"string"},{"name":"price":"type":"float"},{"name":"volume","type":"long"}]}""")) define stream StockStream (symbol string, price float, volume long); ```

The above configuration performs a default Avro mapping that generates an Avro message as an output ByteBuffer.

@@ -65,11 +67,10 @@ define stream StockStream (symbol string, price float, volume long); ## Sourcemapper -### avro *(Source Mapper)* - +### avro *(Source Mapper)*

This extension is an Avro to Event input mapper. Transports that accept Avro messages can utilize this extension to convert the incoming Avro messages to Siddhi events.
 The Avro schema to be used for creating Avro messages can be specified as a parameter in the stream definition.
 If no Avro schema is specified, a flat avro schema of the 'record' type is generated with the stream attributes as schema fields.
The generated/specified Avro schema is used to convert Avro messages to Siddhi events.

- Syntax + ``` @source(..., @map(type="avro", schema.def="", schema.registry="", schema.id="", fail.on.missing.attribute="") ``` diff --git a/docs/index.md b/docs/index.md index 70705ab4..9055ffac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,13 +19,12 @@ For information on Siddhi and i ## Latest API Docs -Latest API Docs is 2.0.2. +Latest API Docs is 2.0.3. ## Features -* avro *(Sink Mapper)*

This extension is a Siddhi Event to Avro Message output mapper.Transports that publish messages to Avro sink can utilize this extension to convert Siddhi events to Avro messages.
 You can either specify the Avro schema or provide the schema registry URL and the schema reference ID as parameters in the stream definition.
If no Avro schema is specified, a flat Avro schema of the 'record' type is generated with the stream attributes as schema fields.

-* avro *(Source Mapper)*

This extension is an Avro to Event input mapper. Transports that accept Avro messages can utilize this extension to convert the incoming Avro messages to Siddhi events.
 The Avro schema to be used for creating Avro messages can be specified as a parameter in the stream definition.
 If no Avro schema is specified, a flat avro schema of the 'record' type is generated with the stream attributes as schema fields.
The generated/specified Avro schema is used to convert Avro messages to Siddhi events.

- +* avro *(Sink Mapper)*

This extension is a Siddhi Event to Avro Message output mapper.Transports that publish messages to Avro sink can utilize this extension to convert Siddhi events to Avro messages.
 You can either specify the Avro schema or provide the schema registry URL and the schema reference ID as parameters in the stream definition.
If no Avro schema is specified, a flat Avro schema of the 'record' type is generated with the stream attributes as schema fields.

+* avro *(Source Mapper)*

This extension is an Avro to Event input mapper. Transports that accept Avro messages can utilize this extension to convert the incoming Avro messages to Siddhi events.
 The Avro schema to be used for creating Avro messages can be specified as a parameter in the stream definition.
 If no Avro schema is specified, a flat avro schema of the 'record' type is generated with the stream attributes as schema fields.
The generated/specified Avro schema is used to convert Avro messages to Siddhi events.

## Dependencies diff --git a/mkdocs.yml b/mkdocs.yml index f5109acd..3d90dea1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,96 +12,97 @@ theme: primary: teal accent: teal extra_css: - - assets/stylesheets/extra.css +- assets/stylesheets/extra.css extra_javascript: - - assets/javascripts/extra.js +- assets/javascripts/extra.js extra: social: - - type: github - link: https://github.com/siddhi-io/siddhi - - type: medium - link: https://medium.com/siddhi-io - - type: twitter - link: https://twitter.com/siddhi_io - - type: linkedin - link: https://www.linkedin.com/groups/13553064 + - type: github + link: https://github.com/siddhi-io/siddhi + - type: medium + link: https://medium.com/siddhi-io + - type: twitter + link: https://twitter.com/siddhi_io + - type: linkedin + link: https://www.linkedin.com/groups/13553064 google_analytics: - - UA-103065-28 - - auto +- UA-103065-28 +- auto markdown_extensions: - - markdown.extensions.admonition +- markdown.extensions.admonition pages: - - Information: index.md - - API Docs: - - latest: api/latest.md - - 2.0.2: api/2.0.2.md - - 2.0.1: api/2.0.1.md - - 2.0.0: api/2.0.0.md - - 1.0.66: api/1.0.66.md - - 1.0.65: api/1.0.65.md - - 1.0.64: api/1.0.64.md - - 1.0.63: api/1.0.63.md - - 1.0.62: api/1.0.62.md - - 1.0.61: api/1.0.61.md - - 1.0.60: api/1.0.60.md - - 1.0.59: api/1.0.59.md - - 1.0.58: api/1.0.58.md - - 1.0.57: api/1.0.57.md - - 1.0.56: api/1.0.56.md - - 1.0.55: api/1.0.55.md - - 1.0.54: api/1.0.54.md - - 1.0.53: api/1.0.53.md - - 1.0.52: api/1.0.52.md - - 1.0.51: api/1.0.51.md - - 1.0.50: api/1.0.50.md - - 1.0.49: api/1.0.49.md - - 1.0.48: api/1.0.48.md - - 1.0.47: api/1.0.47.md - - 1.0.46: api/1.0.46.md - - 1.0.45: api/1.0.45.md - - 1.0.44: api/1.0.44.md - - 1.0.43: api/1.0.43.md - - 1.0.42: api/1.0.42.md - - 1.0.41: api/1.0.41.md - - 1.0.40: api/1.0.40.md - - 1.0.39: api/1.0.39.md - - 1.0.38: api/1.0.38.md - - 1.0.37: api/1.0.37.md - - 1.0.36: api/1.0.36.md - - 1.0.35: api/1.0.35.md - - 1.0.34: api/1.0.34.md - - 1.0.33: api/1.0.33.md - - 1.0.32: api/1.0.32.md - - 1.0.31: api/1.0.31.md - - 1.0.30: api/1.0.30.md - - 1.0.29: api/1.0.29.md - - 1.0.28: api/1.0.28.md - - 1.0.27: api/1.0.27.md - - 1.0.26: api/1.0.26.md - - 1.0.25: api/1.0.25.md - - 1.0.24: api/1.0.24.md - - 1.0.23: api/1.0.23.md - - 1.0.22: api/1.0.22.md - - 1.0.21: api/1.0.21.md - - 1.0.20: api/1.0.20.md - - 1.0.19: api/1.0.19.md - - 1.0.18: api/1.0.18.md - - 1.0.17: api/1.0.17.md - - 1.0.16: api/1.0.16.md - - 1.0.15: api/1.0.15.md - - 1.0.14: api/1.0.14.md - - 1.0.13: api/1.0.13.md - - 1.0.12: api/1.0.12.md - - 1.0.11: api/1.0.11.md - - 1.0.10: api/1.0.10.md - - 1.0.9: api/1.0.9.md - - 1.0.8: api/1.0.8.md - - 1.0.7: api/1.0.7.md - - 1.0.6: api/1.0.6.md - - 1.0.5: api/1.0.5.md - - 1.0.4: api/1.0.4.md - - 1.0.3: api/1.0.3.md - - 1.0.2: api/1.0.2.md - - 1.0.1: api/1.0.1.md - - 1.0.0: api/1.0.0.md - - License: license.md +- Information: index.md +- API Docs: + - latest: api/latest.md + - 2.0.3: api/2.0.3.md + - 2.0.2: api/2.0.2.md + - 2.0.1: api/2.0.1.md + - 2.0.0: api/2.0.0.md + - 1.0.66: api/1.0.66.md + - 1.0.65: api/1.0.65.md + - 1.0.64: api/1.0.64.md + - 1.0.63: api/1.0.63.md + - 1.0.62: api/1.0.62.md + - 1.0.61: api/1.0.61.md + - 1.0.60: api/1.0.60.md + - 1.0.59: api/1.0.59.md + - 1.0.58: api/1.0.58.md + - 1.0.57: api/1.0.57.md + - 1.0.56: api/1.0.56.md + - 1.0.55: api/1.0.55.md + - 1.0.54: api/1.0.54.md + - 1.0.53: api/1.0.53.md + - 1.0.52: api/1.0.52.md + - 1.0.51: api/1.0.51.md + - 1.0.50: api/1.0.50.md + - 1.0.49: api/1.0.49.md + - 1.0.48: api/1.0.48.md + - 1.0.47: api/1.0.47.md + - 1.0.46: api/1.0.46.md + - 1.0.45: api/1.0.45.md + - 1.0.44: api/1.0.44.md + - 1.0.43: api/1.0.43.md + - 1.0.42: api/1.0.42.md + - 1.0.41: api/1.0.41.md + - 1.0.40: api/1.0.40.md + - 1.0.39: api/1.0.39.md + - 1.0.38: api/1.0.38.md + - 1.0.37: api/1.0.37.md + - 1.0.36: api/1.0.36.md + - 1.0.35: api/1.0.35.md + - 1.0.34: api/1.0.34.md + - 1.0.33: api/1.0.33.md + - 1.0.32: api/1.0.32.md + - 1.0.31: api/1.0.31.md + - 1.0.30: api/1.0.30.md + - 1.0.29: api/1.0.29.md + - 1.0.28: api/1.0.28.md + - 1.0.27: api/1.0.27.md + - 1.0.26: api/1.0.26.md + - 1.0.25: api/1.0.25.md + - 1.0.24: api/1.0.24.md + - 1.0.23: api/1.0.23.md + - 1.0.22: api/1.0.22.md + - 1.0.21: api/1.0.21.md + - 1.0.20: api/1.0.20.md + - 1.0.19: api/1.0.19.md + - 1.0.18: api/1.0.18.md + - 1.0.17: api/1.0.17.md + - 1.0.16: api/1.0.16.md + - 1.0.15: api/1.0.15.md + - 1.0.14: api/1.0.14.md + - 1.0.13: api/1.0.13.md + - 1.0.12: api/1.0.12.md + - 1.0.11: api/1.0.11.md + - 1.0.10: api/1.0.10.md + - 1.0.9: api/1.0.9.md + - 1.0.8: api/1.0.8.md + - 1.0.7: api/1.0.7.md + - 1.0.6: api/1.0.6.md + - 1.0.5: api/1.0.5.md + - 1.0.4: api/1.0.4.md + - 1.0.3: api/1.0.3.md + - 1.0.2: api/1.0.2.md + - 1.0.1: api/1.0.1.md + - 1.0.0: api/1.0.0.md +- License: license.md