Hello. Yorozu Counselor Sugimon: yum :. This time, I will try to develop a component (adapter) using the SDK of HULFT IoT Edge Streaming. It is described so that it will be completed in all three parts.
This time, as the third step, I will try to build and execute the plug-in developed with the HULFT IoT EdgeStreaming Plugin SDK. The first and second articles are below, so please refer to them.
: arrow_forward: [I tried to create a plug-in with HULFT IoT Edge Streaming Setup] (https://qiita.com/sugimon/items/cf7503479c6e4c46c3b3) : arrow_forward: [I tried to create a plug-in with HULFT IoT Edge Streaming Development](https://qiita.com/sugimon/items/67bdd6f610e03cdfcef2) : arrow_forward: I tried to create a plug-in with HULFT IoT Edge Streaming Execution
This time, let's build the created plug-in. * I am trying using a Windows PC. In addition, it should be noted $ SDK_HOME points to the EdgeStreaming SDK home directory. $ DATASPIDER_HOME points to the Edge Streaming home directory.
To build the plugin, execute the following command from $ SDK_HOME / dev / sample_adapter
.
$ ant
After executing the command, BUILD SUCCESSFUL
is output, and if the following files are created, the build is successful.
・ $ SDK_HOME / dev / sample_adapter / build
sample_adapter.jar
・ $ SDK_HOME / dev / sample_adapter / build / plugin / sample_plugin
Go executable for each target
Create an icon file that will actually be used on the Edge Streaming Studio screen.
After a successful build, $ SDK_HOME / dev / sample_adapter / META-INF
will be generated, so copy the sample file of the icon and rename it.
-Copy of Icon for Source Operation
$SDK_HOME/dev/conf/operation.source.icon
⇒ $SDK_HOME/dev/sample_adapter/META-INF/operation.sample_source.icon
-Copy of icon for Sink Operation
$SDK_HOME/dev/conf/operation.sink.icon
⇒ $SDK_HOME/dev/sample_adapter/META-INF/operation.sample_sink.icon
-Copy of UDSF Operation icon
$SDK_HOME/dev/conf/operation.udsf.icon
⇒ $SDK_HOME/dev/sample_adapter/META-INF/operation.sample_udsf.icon
Confirm that the $ SDK_HOME / dev / sample_adapter / META-INF / module.properties
file was created successfully.
This properties file is based on the properties defined in the $ SDK_HOME / dev / sample_adapter / config.properties
file.
To install the adapter, specify the install target as the first argument of the ant command from $ SDK_HOME / dev / sample_adapter
.
$ ant install
After executing ant install, it will be installed as follows.
-The Java module will be installed.
Under $ DATASPIDER_HOME / server / plugin / data_processing / modules
-The Golang module will be installed.
Under $ DATASPIDER_HOME / server / es-agent / plugin
Now, let's execute the created plug-in.
-Start Edge Streaming.
・ Let's check the created plug-in. Create a project from a new project.
Create a script.
Confirm that the created plug-in is created in the "Tool Palette". I think that the following plug-ins are created under "Sample" in the "Tool Palette".
**-Input processing (operation to generate pseudo-random numbers at regular time intervals) ** Place the process created by Source Operation. Drag and drop Sample source from Sample on the tool palette to move it to the center.
**-Output processing (operation to truncate to the number of valid decimal places and output to the log) ** Place the process created by Sample Sink. Drag and drop the Sample sink from Sample on the tool palette to move it to the center.
** Mapping process ** Drag and drop the input processing icon to connect the icon to the output processing. Right-click on the connected line and select Add Mapping.
Open the mapping icon.
-Connect the input source "value" and the output destination "value". -Place the tool palette-> character string-> basic-> character string constant in the output destination "formula", Specify any character string and connect it to "formula".
** entire script ** You have created a script like this.
Let's execute the script created from the green arrow on the screen menu.
You can see that pseudo-random numbers are generated for each specified interval and the value is output with the specified number of decimal places.
Also, by using the created UDSF operation icon, you can perform four arithmetic operations on the acquired value. Please combine and try various things.
As the final part of the trilogy, this time I tried to build and execute the plugin. In this way, it is possible to implement plug-in processing using the SDK. I hope this article will guide you in the development of plugins.
In this blog, I would like to continue to introduce the contents of consultations at the "Yorozu Consultation Counter" of technology and the tricks that were born.
Please continue to check it out and follow us if you like.
See you again!
Recommended Posts