Official | HULFT IoT EdgeStreaming Plugin SDK Getting Started Third Edition: July 1, 2021

Registration of Source, Sink, and UDSF Operations

To use created Source, Sink, and UDSF Operations through BQL, the registration process is required.

Create plugin.go in the "plugin" directory and implement the registration process for the Source, Sink, and UDSF Operations.

 

  1. Implement plugin.go as follows:

    package plugin
    
    import (
        "github.sis.saison.co.jp/sherpa/es-agent/sample" 
        "gopkg.in/sensorbee/sensorbee.v0/bql" 
        "gopkg.in/sensorbee/sensorbee.v0/bql/udf" 
    )
    
    func init() {
        bql.MustRegisterGlobalSourceCreator("sample_source", bql.SourceCreatorFunc(sample.CreateSource))
        bql.MustRegisterGlobalSinkCreator("sample_sink", bql.SinkCreatorFunc(sample.CreateSink))
        udf.MustRegisterGlobalUDSFCreator("sample_udsf", udf.MustConvertToUDSFCreator(sample.CreateUDSF))
    }
         

     

  2. Use "Register function" and "CreatorFunc" shown below to register Source, Sink, and UDSF of the init function.

     

    Object

    Register function

    CreatorFunc

    Source

    bql.MustRegisterGlobalSourceCreator

    bql.SourceCreatorFunc

    Sink

    bql.MustRegisterGlobalSinkCreator

    bql.SinkCreatorFunc

    UDSF

    udf.MustRegisterGlobalUDSFCreator

    udf.MustConvertToUDSFCreator

     

    = Remarks =

    The character strings specified as the first argument of the Register function are used as the identifier names for Source, Sink, and UDSF in BQL.

     

 

 

Official | HULFT IoT EdgeStreaming Plugin SDK Getting Started Third Edition: July 1, 2021