Skip to content

Commit c7bcb20

Browse files
[WSO2-Release] [Release 2.0.1] update documentation for release 2.0.1
1 parent d74e83e commit c7bcb20

File tree

5 files changed

+225
-15
lines changed

5 files changed

+225
-15
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Find some useful links below:
1313

1414
## Latest API Docs
1515

16-
Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-file/api/2.0.0">2.0.0</a>.
16+
Latest API Docs is <a target="_blank" href="https://wso2-extensions.github.io/siddhi-io-file/api/2.0.1">2.0.1</a>.
1717

1818
## How to use
1919

@@ -49,8 +49,8 @@ extension you can replace the component <a target="_blank" href="https://github
4949

5050
## Features
5151

52-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-file/api/2.0.0/#file-sink">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#sink">(Sink)</a>*<br><div style="padding-left: 1em;"><p>File Sink can be used to publish (write) event data which is processed within siddhi to files. <br>Siddhi-io-file sink provides support to write both textual and binary data into files<br></p></div>
53-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-file/api/2.0.0/#file-source">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#source">(Source)</a>*<br><div style="padding-left: 1em;"><p>File Source provides the functionality for user to feed data to siddhi from files. Both text and binary files are supported by file source.</p></div>
52+
* <a target="_blank" href="https://wso2-extensions.github.io/siddhi-io-file/api/2.0.1/#file-sink">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#sink">(Sink)</a>*<br><div style="padding-left: 1em;"><p>File Sink can be used to publish (write) event data which is processed within siddhi to files. <br>Siddhi-io-file sink provides support to write both textual and binary data into files<br></p></div>
53+
* <a target="_blank" href="https://wso2-extensions.github.io/siddhi-io-file/api/2.0.1/#file-source">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#source">(Source)</a>*<br><div style="padding-left: 1em;"><p>File Source provides the functionality for user to feed data to siddhi from files. Both text and binary files are supported by file source.</p></div>
5454

5555
## How to Contribute
5656

docs/api/2.0.1.md

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# API Docs - v2.0.1
2+
3+
## Sink
4+
5+
### file *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#sink">(Sink)</a>*
6+
7+
<p style="word-wrap: break-word">File Sink can be used to publish (write) event data which is processed within siddhi to files. <br>Siddhi-io-file sink provides support to write both textual and binary data into files<br></p>
8+
9+
<span id="syntax" class="md-typeset" style="display: block; font-weight: bold;">Syntax</span>
10+
```
11+
@sink(type="file", file.uri="<STRING>", append="<BOOL>", add.line.separator="<BOOL>", @map(...)))
12+
```
13+
14+
<span id="query-parameters" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">QUERY PARAMETERS</span>
15+
<table>
16+
<tr>
17+
<th>Name</th>
18+
<th style="min-width: 20em">Description</th>
19+
<th>Default Value</th>
20+
<th>Possible Data Types</th>
21+
<th>Optional</th>
22+
<th>Dynamic</th>
23+
</tr>
24+
<tr>
25+
<td style="vertical-align: top">file.uri</td>
26+
<td style="vertical-align: top; word-wrap: break-word">Used to specify the file for data to be written. </td>
27+
<td style="vertical-align: top"></td>
28+
<td style="vertical-align: top">STRING</td>
29+
<td style="vertical-align: top">No</td>
30+
<td style="vertical-align: top">Yes</td>
31+
</tr>
32+
<tr>
33+
<td style="vertical-align: top">append</td>
34+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify whether the data should be append to the file or not.<br>If append = 'true', data will be write at the end of the file without changing the existing content.<br>If file does not exist, a new fill will be crated and then data will be written.<br>If append append = 'false', <br>If given file exists, existing content will be deleted and then data will be written back to the file.<br>If given file does not exist, a new file will be created and then data will be written on it.<br></td>
35+
<td style="vertical-align: top">true</td>
36+
<td style="vertical-align: top">BOOL</td>
37+
<td style="vertical-align: top">Yes</td>
38+
<td style="vertical-align: top">No</td>
39+
</tr>
40+
<tr>
41+
<td style="vertical-align: top">add.line.separator</td>
42+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify whether events added to the file should be separated by a newline.<br>If add.event.separator= 'true',then a newline will be added after data is added to the file.</td>
43+
<td style="vertical-align: top">true. (However, if csv mapper is used, it is false)</td>
44+
<td style="vertical-align: top">BOOL</td>
45+
<td style="vertical-align: top">Yes</td>
46+
<td style="vertical-align: top">No</td>
47+
</tr>
48+
</table>
49+
50+
<span id="examples" class="md-typeset" style="display: block; font-weight: bold;">Examples</span>
51+
<span id="example-1" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 1</span>
52+
```
53+
@sink(type='file', @map(type='json'), append='false', file.uri='/abc/{{symbol}}.txt') define stream BarStream (symbol string, price float, volume long);
54+
```
55+
<p style="word-wrap: break-word">Under above configuration, for each event, a file will be generated if there's no such a file,and then data will be written to that file as json messagesoutput will looks like below.<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;"event":{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"symbol":"WSO2",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"price":55.6,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"volume":100<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br></p>
56+
57+
## Source
58+
59+
### file *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#source">(Source)</a>*
60+
61+
<p style="word-wrap: break-word">File Source provides the functionality for user to feed data to siddhi from files. Both text and binary files are supported by file source.</p>
62+
63+
<span id="syntax" class="md-typeset" style="display: block; font-weight: bold;">Syntax</span>
64+
```
65+
@source(type="file", dir.uri="<STRING>", file.uri="<STRING>", mode="<STRING>", tailing="<BOOL>", action.after.process="<STRING>", action.after.failure="<STRING>", move.after.process="<STRING>", move.after.failure="<STRING>", begin.regex="<STRING>", end.regex="<STRING>", file.polling.interval="<STRING>", dir.polling.interval="<STRING>", timeout="<STRING>", @map(...)))
66+
```
67+
68+
<span id="query-parameters" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">QUERY PARAMETERS</span>
69+
<table>
70+
<tr>
71+
<th>Name</th>
72+
<th style="min-width: 20em">Description</th>
73+
<th>Default Value</th>
74+
<th>Possible Data Types</th>
75+
<th>Optional</th>
76+
<th>Dynamic</th>
77+
</tr>
78+
<tr>
79+
<td style="vertical-align: top">dir.uri</td>
80+
<td style="vertical-align: top; word-wrap: break-word">Used to specify a directory to be processed. <br>All the files inside this directory will be processed. <br>Only one of 'dir.uri' and 'file.uri' should be provided.<br>This uri MUST have the respective protocol specified.</td>
81+
<td style="vertical-align: top"></td>
82+
<td style="vertical-align: top">STRING</td>
83+
<td style="vertical-align: top">No</td>
84+
<td style="vertical-align: top">No</td>
85+
</tr>
86+
<tr>
87+
<td style="vertical-align: top">file.uri</td>
88+
<td style="vertical-align: top; word-wrap: break-word">Used to specify a file to be processed. <br>&nbsp;Only one of 'dir.uri' and 'file.uri' should be provided.<br>This uri MUST have the respective protocol specified.<br></td>
89+
<td style="vertical-align: top"></td>
90+
<td style="vertical-align: top">STRING</td>
91+
<td style="vertical-align: top">No</td>
92+
<td style="vertical-align: top">No</td>
93+
</tr>
94+
<tr>
95+
<td style="vertical-align: top">mode</td>
96+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify how files in given directory should.Possible values for this parameter are,<br>1. TEXT.FULL : to read a text file completely at once.<br>2. BINARY.FULL : to read a binary file completely at once.<br>3. LINE : to read a text file line by line.<br>4. REGEX : to read a text file and extract data using a regex.<br></td>
97+
<td style="vertical-align: top">line</td>
98+
<td style="vertical-align: top">STRING</td>
99+
<td style="vertical-align: top">Yes</td>
100+
<td style="vertical-align: top">No</td>
101+
</tr>
102+
<tr>
103+
<td style="vertical-align: top">tailing</td>
104+
<td style="vertical-align: top; word-wrap: break-word">This can either have value true or false. By default it will be true. <br>This attribute allows user to specify whether the file should be tailed or not. <br>If tailing is enabled, the first file of the directory will be tailed.<br>Also tailing should not be enabled in 'binary.full' or 'text.full' modes.<br></td>
105+
<td style="vertical-align: top">true</td>
106+
<td style="vertical-align: top">BOOL</td>
107+
<td style="vertical-align: top">Yes</td>
108+
<td style="vertical-align: top">No</td>
109+
</tr>
110+
<tr>
111+
<td style="vertical-align: top">action.after.process</td>
112+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify the action which should be carried out <br>after processing a file in the given directory. <br>It can be either DELETE or MOVE and default value will be 'DELETE'.<br>If the action.after.process is MOVE, user must specify the location to move consumed files using 'move.after.process' parameter.<br></td>
113+
<td style="vertical-align: top">delete</td>
114+
<td style="vertical-align: top">STRING</td>
115+
<td style="vertical-align: top">Yes</td>
116+
<td style="vertical-align: top">No</td>
117+
</tr>
118+
<tr>
119+
<td style="vertical-align: top">action.after.failure</td>
120+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify the action which should be carried out if a failure occurred during the process. <br>It can be either DELETE or MOVE and default value will be 'DELETE'.<br>If the action.after.failure is MOVE, user must specify the location to move consumed files using 'move.after.failure' parameter.<br></td>
121+
<td style="vertical-align: top">delete</td>
122+
<td style="vertical-align: top">STRING</td>
123+
<td style="vertical-align: top">Yes</td>
124+
<td style="vertical-align: top">No</td>
125+
</tr>
126+
<tr>
127+
<td style="vertical-align: top">move.after.process</td>
128+
<td style="vertical-align: top; word-wrap: break-word">If action.after.process is MOVE, user must specify the location to move consumed files using 'move.after.process' parameter.<br>This should be the absolute path of the file that going to be created after moving is done.<br>This uri MUST have the respective protocol specified.<br></td>
129+
<td style="vertical-align: top"></td>
130+
<td style="vertical-align: top">STRING</td>
131+
<td style="vertical-align: top">No</td>
132+
<td style="vertical-align: top">No</td>
133+
</tr>
134+
<tr>
135+
<td style="vertical-align: top">move.after.failure</td>
136+
<td style="vertical-align: top; word-wrap: break-word">If action.after.failure is MOVE, user must specify the location to move consumed files using 'move.after.failure' parameter.<br>This should be the absolute path of the file that going to be created after moving is done.<br>This uri MUST have the respective protocol specified.<br></td>
137+
<td style="vertical-align: top"></td>
138+
<td style="vertical-align: top">STRING</td>
139+
<td style="vertical-align: top">No</td>
140+
<td style="vertical-align: top">No</td>
141+
</tr>
142+
<tr>
143+
<td style="vertical-align: top">begin.regex</td>
144+
<td style="vertical-align: top; word-wrap: break-word">This will define the regex to be matched at the beginning of the retrieved content.<br></td>
145+
<td style="vertical-align: top">None</td>
146+
<td style="vertical-align: top">STRING</td>
147+
<td style="vertical-align: top">Yes</td>
148+
<td style="vertical-align: top">No</td>
149+
</tr>
150+
<tr>
151+
<td style="vertical-align: top">end.regex</td>
152+
<td style="vertical-align: top; word-wrap: break-word">This will define the regex to be matched at the end of the retrieved content.<br></td>
153+
<td style="vertical-align: top">None</td>
154+
<td style="vertical-align: top">STRING</td>
155+
<td style="vertical-align: top">Yes</td>
156+
<td style="vertical-align: top">No</td>
157+
</tr>
158+
<tr>
159+
<td style="vertical-align: top">file.polling.interval</td>
160+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify the time period (in milliseconds) of a polling cycle for a file.<br></td>
161+
<td style="vertical-align: top">1000</td>
162+
<td style="vertical-align: top">STRING</td>
163+
<td style="vertical-align: top">Yes</td>
164+
<td style="vertical-align: top">No</td>
165+
</tr>
166+
<tr>
167+
<td style="vertical-align: top">dir.polling.interval</td>
168+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify the time period (in milliseconds) of a polling cycle for a directory.<br></td>
169+
<td style="vertical-align: top">1000</td>
170+
<td style="vertical-align: top">STRING</td>
171+
<td style="vertical-align: top">Yes</td>
172+
<td style="vertical-align: top">No</td>
173+
</tr>
174+
<tr>
175+
<td style="vertical-align: top">timeout</td>
176+
<td style="vertical-align: top; word-wrap: break-word">This parameter is used to specify the maximum time period (in milliseconds) for waiting until a file is processed.<br></td>
177+
<td style="vertical-align: top">5000</td>
178+
<td style="vertical-align: top">STRING</td>
179+
<td style="vertical-align: top">Yes</td>
180+
<td style="vertical-align: top">No</td>
181+
</tr>
182+
</table>
183+
184+
<span id="examples" class="md-typeset" style="display: block; font-weight: bold;">Examples</span>
185+
<span id="example-1" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 1</span>
186+
```
187+
@source(type='file',
188+
mode='text.full',
189+
tailing='false'
190+
dir.uri='file://abc/xyz',
191+
action.after.process='delete',
192+
@map(type='json'))
193+
define stream FooStream (symbol string, price float, volume long);
194+
195+
```
196+
<p style="word-wrap: break-word">Under above configuration, all the files in directory will be picked and read one by one.<br>In this case, it's assumed that all the files contains json valid json strings with keys 'symbol','price' and 'volume'.<br>Once a file is read, its content will be converted to an event using siddhi-map-json extension and then, that event will be received to the FooStream.<br>Finally, after reading is finished, the file will be deleted.<br></p>
197+
198+
<span id="example-2" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 2</span>
199+
```
200+
@source(type='file',
201+
mode='files.repo.line',
202+
tailing='true',
203+
dir.uri='file://abc/xyz',
204+
@map(type='json'))
205+
define stream FooStream (symbol string, price float, volume long);
206+
207+
```
208+
<p style="word-wrap: break-word">Under above configuration, the first file in directory '/abc/xyz' will be picked and read line by line.<br>In this case, it is assumed that the file contains lines json strings.<br>For each line, line content will be converted to an event using siddhi-map-json extension and then, that event will be received to the FooStream.<br>Once file content is completely read, it will keep checking whether a new entry is added to the file or not.<br>If such entry is added, it will be immediately picked up and processed.<br></p>
209+

docs/api/latest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# API Docs - v2.0.0
1+
# API Docs - v2.0.1
22

33
## Sink
44

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Find some useful links below:
1313

1414
## Latest API Docs
1515

16-
Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-file/api/2.0.0">2.0.0</a>.
16+
Latest API Docs is <a target="_blank" href="https://wso2-extensions.github.io/siddhi-io-file/api/2.0.1">2.0.1</a>.
1717

1818
## How to use
1919

@@ -49,8 +49,8 @@ extension you can replace the component <a target="_blank" href="https://github
4949

5050
## Features
5151

52-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-file/api/2.0.0/#file-sink">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#sink">(Sink)</a>*<br><div style="padding-left: 1em;"><p>File Sink can be used to publish (write) event data which is processed within siddhi to files. <br>Siddhi-io-file sink provides support to write both textual and binary data into files<br></p></div>
53-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-file/api/2.0.0/#file-source">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#source">(Source)</a>*<br><div style="padding-left: 1em;"><p>File Source provides the functionality for user to feed data to siddhi from files. Both text and binary files are supported by file source.</p></div>
52+
* <a target="_blank" href="https://wso2-extensions.github.io/siddhi-io-file/api/2.0.1/#file-sink">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#sink">(Sink)</a>*<br><div style="padding-left: 1em;"><p>File Sink can be used to publish (write) event data which is processed within siddhi to files. <br>Siddhi-io-file sink provides support to write both textual and binary data into files<br></p></div>
53+
* <a target="_blank" href="https://wso2-extensions.github.io/siddhi-io-file/api/2.0.1/#file-source">file</a> *<a target="_blank" href="http://siddhi.io/documentation/siddhi-5.x/query-guide-5.x/#source">(Source)</a>*<br><div style="padding-left: 1em;"><p>File Source provides the functionality for user to feed data to siddhi from files. Both text and binary files are supported by file source.</p></div>
5454

5555
## How to Contribute
5656

mkdocs.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ extra:
2626
- type: linkedin
2727
link: https://www.linkedin.com/groups/13553064
2828
markdown_extensions:
29-
- admonition
30-
- toc:
31-
permalink: true
32-
- codehilite:
33-
guess_lang: false
34-
- pymdownx.tasklist:
35-
custom_checkbox: true
36-
- markdown.extensions.attr_list:
29+
- admonition
30+
- toc:
31+
permalink: true
32+
- codehilite:
33+
guess_lang: false
34+
- pymdownx.tasklist:
35+
custom_checkbox: true
36+
- markdown.extensions.attr_list: null
3737
pages:
3838
- Welcome: index.md
3939
- API Docs:
40+
- 2.0.1: api/2.0.1.md
4041
- 2.0.0: api/2.0.0.md
4142
- 1.1.1: api/1.1.1.md
4243
- 1.1.0: api/1.1.0.md

0 commit comments

Comments
 (0)