This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new c5e7466 Fixed camel-weka syntax
c5e7466 is described below
commit c5e74668e357f67d031a7baa0ae588c0a5e7e8ab
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Feb 4 08:42:13 2020 +0100
Fixed camel-weka syntax
---
.../camel-weka/src/main/docs/weka-component.adoc | 14 ++---
.../camel/component/weka/WekaConfiguration.java | 27 ++-------
.../apache/camel/component/weka/WekaEndpoint.java | 2 +-
.../endpoint/dsl/WekaEndpointBuilderFactory.java | 70 ++++++----------------
4 files changed, 28 insertions(+), 85 deletions(-)
diff --git a/components/camel-weka/src/main/docs/weka-component.adoc
b/components/camel-weka/src/main/docs/weka-component.adoc
index aa0cc93..3749998 100644
--- a/components/camel-weka/src/main/docs/weka-component.adoc
+++ b/components/camel-weka/src/main/docs/weka-component.adoc
@@ -50,24 +50,18 @@ The Weka component supports 2 options, which are listed
below.
The Weka endpoint is configured using URI syntax:
----
-weka:cmd
+weka:command
----
with the following path and query parameters:
-=== Path Parameters (7 parameters):
+=== Path Parameters (1 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *read* | The read command | | String
-| *write* | The write command | | String
-| *filter* | The filter command | | String
-| *model* | The model command | | String
-| *push* | The push command | | String
-| *pop* | The pop command | | String
-| *version* | The version command | | String
+| *command* | The command to use | | Command
|===
@@ -78,7 +72,6 @@ with the following path and query parameters:
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
-| *path* (producer) | An in/out path for the read/write commands | | String
| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic
property binding (Camel 2.x) or the newer property binding with additional
capabilities | false | boolean
| *synchronous* (advanced) | Sets whether synchronous processing should be
strictly used, or Camel is allowed to use asynchronous processing (if
supported). | false | boolean
| *apply* (filter) | The filter spec (i.e. Name Options) | | String
@@ -89,6 +82,7 @@ with the following path and query parameters:
| *saveTo* (model) | Path to save the model to | | String
| *seed* (model) | An optional seed for the randomizer | 1 | int
| *xval* (model) | Flag on whether to use cross-validation with the current
dataset | false | boolean
+| *path* (write) | An in/out path for the read/write commands | | String
|===
// endpoint options: END
// spring-boot-auto-configure options: START
diff --git
a/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaConfiguration.java
b/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaConfiguration.java
index 20ffd0b..91edc1f 100644
---
a/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaConfiguration.java
+++
b/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaConfiguration.java
@@ -29,25 +29,11 @@ public class WekaConfiguration {
filter, model, read, write, push, pop, version
}
- // Not used, only here for documentation
-
- @UriPath(description = "The read command")
- private String read;
- @UriPath(description = "The write command")
- private String write;
- @UriPath(description = "The filter command")
- private String filter;
- @UriPath(description = "The model command")
- private String model;
- @UriPath(description = "The push command")
- private String push;
- @UriPath(description = "The pop command")
- private String pop;
- @UriPath(description = "The version command")
- private String version;
-
+ @UriPath(description = "The command to use")
+ private Command command;
+
// Read/Write parameters
- @UriParam(description = "An in/out path for the read/write commands")
+ @UriParam(description = "An in/out path for the read/write commands",
label = "read,write")
private String path;
// Filter parameters
@@ -61,16 +47,15 @@ public class WekaConfiguration {
private boolean xval;
@UriParam(description = "The named dataset to train the classifier with",
label = "model")
private String dsname;
- @UriParam(description = "Numer of folds to use for cross-validation",
label = "model") @Metadata(defaultValue = "10")
+ @UriParam(description = "Numer of folds to use for cross-validation",
label = "model", defaultValue = "10")
private int folds = 10;
- @UriParam(description = "An optional seed for the randomizer", label =
"model") @Metadata(defaultValue = "1")
+ @UriParam(description = "An optional seed for the randomizer", label =
"model", defaultValue = "1")
private int seed = 1;
@UriParam(description = "Path to save the model to", label = "model")
private String saveTo;
@UriParam(description = "Path to load the model from", label = "model")
private String loadFrom;
- private Command command;
Command getCommand() {
return command;
diff --git
a/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaEndpoint.java
b/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaEndpoint.java
index 7333113..f223db5 100644
---
a/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaEndpoint.java
+++
b/components/camel-weka/src/main/java/org/apache/camel/component/weka/WekaEndpoint.java
@@ -27,7 +27,7 @@ import weka.core.Version;
/**
* The camel-weka component provides Data Mining functionality through Weka.
*/
-@UriEndpoint(firstVersion = "3.1.0", scheme = "weka", title = "Weka", syntax =
"weka:cmd", producerOnly = true, label = "Datamining")
+@UriEndpoint(firstVersion = "3.1.0", scheme = "weka", title = "Weka", syntax =
"weka:command", producerOnly = true, label = "Datamining")
public class WekaEndpoint extends DefaultEndpoint {
@UriParam
diff --git
a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java
b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java
index 3da42fb..4a6a271 100644
---
a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java
+++
b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java
@@ -78,17 +78,6 @@ public interface WekaEndpointBuilderFactory {
return this;
}
/**
- * An in/out path for the read/write commands.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: producer
- */
- default WekaEndpointBuilder path(String path) {
- doSetProperty("path", path);
- return this;
- }
- /**
* The filter spec (i.e. Name Options).
*
* The option is a: <code>java.lang.String</code> type.
@@ -215,6 +204,17 @@ public interface WekaEndpointBuilderFactory {
doSetProperty("xval", xval);
return this;
}
+ /**
+ * An in/out path for the read/write commands.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: write
+ */
+ default WekaEndpointBuilder path(String path) {
+ doSetProperty("path", path);
+ return this;
+ }
}
/**
@@ -292,28 +292,10 @@ public interface WekaEndpointBuilderFactory {
* Since: 3.1
* Maven coordinates: org.apache.camel:camel-weka
*
- * Syntax: <code>weka:cmd</code>
- *
- * Path parameter: read
- * The read command
- *
- * Path parameter: write
- * The write command
- *
- * Path parameter: filter
- * The filter command
- *
- * Path parameter: model
- * The model command
+ * Syntax: <code>weka:command</code>
*
- * Path parameter: push
- * The push command
- *
- * Path parameter: pop
- * The pop command
- *
- * Path parameter: version
- * The version command
+ * Path parameter: command
+ * The command to use
*/
default WekaEndpointBuilder weka(String path) {
return WekaEndpointBuilderFactory.weka(path);
@@ -327,28 +309,10 @@ public interface WekaEndpointBuilderFactory {
* Since: 3.1
* Maven coordinates: org.apache.camel:camel-weka
*
- * Syntax: <code>weka:cmd</code>
- *
- * Path parameter: read
- * The read command
- *
- * Path parameter: write
- * The write command
- *
- * Path parameter: filter
- * The filter command
- *
- * Path parameter: model
- * The model command
- *
- * Path parameter: push
- * The push command
- *
- * Path parameter: pop
- * The pop command
+ * Syntax: <code>weka:command</code>
*
- * Path parameter: version
- * The version command
+ * Path parameter: command
+ * The command to use
*/
static WekaEndpointBuilder weka(String path) {
class WekaEndpointBuilderImpl extends AbstractEndpointBuilder
implements WekaEndpointBuilder, AdvancedWekaEndpointBuilder {