diff --git a/README.md b/README.md index dd37859..0dca998 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Find some useful links below: ## Latest API Docs -Latest API Docs is 2.0.0. +Latest API Docs is 2.1.0. ## Prerequisites - Elasticsearch can be downloaded directly from href="https://www.elastic.co/downloads/elasticsearch" in zip, tar.gz, deb, or rpm packages. @@ -60,7 +60,7 @@ Latest API Docs is elasticsearch *(Store)*

Elasticsearch store implementation uses Elasticsearch indexing document for underlying data storage. The events are converted to Elasticsearch index documents when the events are inserted into the elasticsearch store. Elasticsearch indexing documents are converted to events when the documents are read from Elasticsearch indexes. The internal store is connected to the Elastisearch server via the Elasticsearch Java High Level REST Client library.

+* elasticsearch *(Store)*

Elasticsearch store implementation uses Elasticsearch indexing document for underlying data storage. The events are converted to Elasticsearch index documents when the events are inserted into the elasticsearch store. Elasticsearch indexing documents are converted to events when the documents are read from Elasticsearch indexes. The internal store is connected to the Elastisearch server via the Elasticsearch Java High Level REST Client library.

## How to Contribute diff --git a/docs/api/2.1.0.md b/docs/api/2.1.0.md new file mode 100644 index 0000000..849c586 --- /dev/null +++ b/docs/api/2.1.0.md @@ -0,0 +1,217 @@ +# API Docs - v2.1.0 + +## Store + +### elasticsearch *(Store)* + +

Elasticsearch store implementation uses Elasticsearch indexing document for underlying data storage. The events are converted to Elasticsearch index documents when the events are inserted into the elasticsearch store. Elasticsearch indexing documents are converted to events when the documents are read from Elasticsearch indexes. The internal store is connected to the Elastisearch server via the Elasticsearch Java High Level REST Client library.

+ +Syntax +``` +@Store(type="elasticsearch", hostname="", port="", scheme="", elasticsearch.member.list="", username="", password="", index.name="", payload.index.of.index.name="", index.alias="", index.number.of.shards="", index.number.of.replicas="", bulk.actions="", bulk.size="", concurrent.requests="", flush.interval="", backoff.policy.retry.no="", backoff.policy.wait.time="", ssl.enabled="", trust.store.type="", trust.store.path="", trust.store.pass="") +@PrimaryKey("PRIMARY_KEY") +@Index("INDEX") +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
hostnameThe hostname of the Elasticsearch server.localhostSTRINGYesNo
portThe port of the Elasticsearch server.9200INTYesNo
schemeThe scheme type of the Elasticsearch server connection.httpSTRINGYesNo
elasticsearch.member.listThe list of elasticsearch host names. in comma separated mannerhttps://hostname1:9200,https://hostname2:9200nullSTRINGYesNo
usernameThe username for the Elasticsearch server connection.elasticSTRINGYesNo
passwordThe password for the Elasticsearch server connection.changemeSTRINGYesNo
index.nameThe name of the Elasticsearch index.The table name defined in the Siddhi App query.STRINGYesNo
payload.index.of.index.nameThe payload which is used to create the index. This can be used if the user needs to create index names dynamically-1INTYesNo
index.aliasThe alias of the Elasticsearch index.nullSTRINGYesNo
index.number.of.shardsThe number of shards allocated for the index in the Elasticsearch server.3INTYesNo
index.number.of.replicasThe number of replicas for the index in the Elasticsearch server.2INTYesNo
bulk.actionsThe number of actions to be added to flush a new bulk request. Use -1 to disable it1INTYesNo
bulk.sizeThe size of size of actions currently added to the bulk request to flush a new bulk request in MB. Use -1 to disable it1LONGYesNo
concurrent.requestsThe number of concurrent requests allowed to be executed. Use 0 to only allow the execution of a single request0INTYesNo
flush.intervalThe flush interval flushing any BulkRequest pending if the interval passes.10LONGYesNo
backoff.policy.retry.noThe number of retries until backoff (The backoff policy defines how the bulk processor should handle retries of bulk requests internally in case they have failed due to resource constraints (i.e. a thread pool was full)).3INTYesNo
backoff.policy.wait.timeThe constant back off policy that initially waits until the next retry in seconds.1LONGYesNo
ssl.enabledSSL is enabled or not.nullBOOLYesNo
trust.store.typeTrust store type.jksSTRINGYesNo
trust.store.pathTrust store path.nullSTRINGYesNo
trust.store.passTrust store password.wso2carbonSTRINGYesNo
+ +Examples +EXAMPLE 1 +``` +@Store(type="elasticsearch", host="localhost", username="elastic", password="changeme", index.name="MyStockTable", field.length="symbol:100", bulk.actions="5000", bulk.size="1", concurrent.requests="2", flush.interval="1", backoff.policy.retry.no="3", backoff.policy.wait.time="1") +@PrimaryKey("symbol")define table StockTable (symbol string, price float, volume long); +``` +

This example creates an index named 'MyStockTable' in the Elasticsearch server if it does not already exist (with three attributes named 'symbol', 'price', and 'volume' of the types 'string', 'float' and 'long' respectively). The connection is made as specified by the parameters configured for the '@Store' annotation. The 'symbol' attribute is considered a unique field and an Elasticsearch index document ID is generated for it.

+ +EXAMPLE 2 +``` +@Store(type="elasticsearch", host="localhost", username="elastic", password="changeme", index.name="MyStockTable", field.length="symbol:100", bulk.actions="5000", bulk.size="1", concurrent.requests="2", flush.interval="1", backoff.policy.retry.no="3", backoff.policy.wait.time="1", ssl.enabled="true", trust.store.type="jks", trust.store.path="/User/wso2/wso2sp/resources/security/client-truststore.jks", trust.store.pass="wso2carbon") +@PrimaryKey("symbol")define table StockTable (symbol string, price float, volume long); +``` +

This example uses SSL to connect to Elasticsearch.

+ +EXAMPLE 3 +``` +@Store(type="elasticsearch", elasticsearch.member.list="https://hostname1:9200,https://hostname2:9200", username="elastic", password="changeme", index.name="MyStockTable", field.length="symbol:100", bulk.actions="5000", bulk.size="1", concurrent.requests="2", flush.interval="1", backoff.policy.retry.no="3", backoff.policy.wait.time="1") +@PrimaryKey("symbol")define table StockTable (symbol string, price float, volume long); +``` +

This example defined several elasticsearch members to publish data using elasticsearch.member.list parameter.

+ diff --git a/docs/api/latest.md b/docs/api/latest.md index 42394fa..849c586 100644 --- a/docs/api/latest.md +++ b/docs/api/latest.md @@ -1,4 +1,4 @@ -# API Docs - v2.1.0-SNAPSHOT +# API Docs - v2.1.0 ## Store @@ -8,7 +8,7 @@ Syntax ``` -@Store(type="elasticsearch", hostname="", port="", scheme="", elasticsearch.member.list="", username="", password="", index.name="", index.type="", payload.index.of.index.name="", index.alias="", index.number.of.shards="", index.number.of.replicas="", bulk.actions="", bulk.size="", concurrent.requests="", flush.interval="", backoff.policy.retry.no="", backoff.policy.wait.time="", ssl.enabled="", trust.store.type="", trust.store.path="", trust.store.pass="") +@Store(type="elasticsearch", hostname="", port="", scheme="", elasticsearch.member.list="", username="", password="", index.name="", payload.index.of.index.name="", index.alias="", index.number.of.shards="", index.number.of.replicas="", bulk.actions="", bulk.size="", concurrent.requests="", flush.interval="", backoff.policy.retry.no="", backoff.policy.wait.time="", ssl.enabled="", trust.store.type="", trust.store.path="", trust.store.pass="") @PrimaryKey("PRIMARY_KEY") @Index("INDEX") ``` @@ -79,14 +79,6 @@ Yes No - - index.type - The the type of the index. - empty - STRING - Yes - No - payload.index.of.index.name The payload which is used to create the index. This can be used if the user needs to create index names dynamically diff --git a/docs/index.md b/docs/index.md index dd37859..0dca998 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ Find some useful links below: ## Latest API Docs -Latest API Docs is 2.0.0. +Latest API Docs is 2.1.0. ## Prerequisites - Elasticsearch can be downloaded directly from href="https://www.elastic.co/downloads/elasticsearch" in zip, tar.gz, deb, or rpm packages. @@ -60,7 +60,7 @@ Latest API Docs is elasticsearch *(Store)*

Elasticsearch store implementation uses Elasticsearch indexing document for underlying data storage. The events are converted to Elasticsearch index documents when the events are inserted into the elasticsearch store. Elasticsearch indexing documents are converted to events when the documents are read from Elasticsearch indexes. The internal store is connected to the Elastisearch server via the Elasticsearch Java High Level REST Client library.

+* elasticsearch *(Store)*

Elasticsearch store implementation uses Elasticsearch indexing document for underlying data storage. The events are converted to Elasticsearch index documents when the events are inserted into the elasticsearch store. Elasticsearch indexing documents are converted to events when the documents are read from Elasticsearch indexes. The internal store is connected to the Elastisearch server via the Elasticsearch Java High Level REST Client library.

## How to Contribute diff --git a/mkdocs.yml b/mkdocs.yml index 97eae12..ae6c3d6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,6 +32,7 @@ markdown_extensions: pages: - Welcome: index.md - API Docs: + - 2.1.0: api/2.1.0.md - 2.0.0: api/2.0.0.md - 1.1.4: api/1.1.4.md - 1.1.3: api/1.1.3.md