This topic describes the data types and parameters that Stream Reader supports and how to configure it by using the code editor.

Stream Reader automatically generates data from the memory. It is mainly used to test data synchronization performance and basic features.

The following table describes the data types that Stream Reader supports.
Stream Reader data type Category
STRING String
LONG Long integer
DATE Date and time
BOOLEAN Boolean
BYTES Byte

Parameters

Parameter Description Required Default value
column The data and type of columns in the source table. You can specify multiple columns. You can set this parameter to generate random strings of specific length. Example:
"column" : [
      {
          "random": "8,15"
      },
      {
          "random": "10,10"
      }
]
Parameter description:
  • "random": "8,15": generates a random string that is 8 to 15 bytes in length.
  • "random": "10,10": generates a 10-byte random string.
Yes N/A
sliceRecordCount The number of columns that are to be repeatedly generated. Yes N/A

Configure Stream Reader by using the codeless UI

The codeless user interface (UI) is not supported for Stream Reader.

Configure Stream Reader by using the code editor

The following example shows how to configure a sync node to read data from the memory:
{
    "type":"job",
    "version":"2.0",// The version number.
    "steps":[
        {
            "stepType":"stream",// The reader type.
            "parameter":{
                "column":[// The columns to be synchronized from the source table.
                    {
                        "type":"string",// The data type.
                        "value":"field" // The value.
                    },
                    {
                        "type":"long",
                        "value":100
                    },
                    {
                        "dateFormat":"yyyy-MM-dd HH:mm:ss",// The format of the time.
                        "type":"date",
                        "value":"2014-12-12 12:12:12"
                    },
                    {
                        "type":"bool",
                        "value":true
                    },
                    {
                        "type":"bytes",
                        "value":"byte string"
                    }
                ],
                "sliceRecordCount":"100000"// The number of columns that are to be repeatedly generated.
            },
            "name":"Reader",
            "category":"reader"
        },
        { 
            "stepType":"stream",
            "parameter":{},
            "name":"Writer",
            "category":"writer"
        }
    ],
    "setting":{
        "errorLimit":{
            "record":"0"// The maximum number of dirty data records allowed.
        },
        "speed":{
            "throttle":false,// Specifies whether to enable bandwidth throttling. A value of false indicates that the bandwidth is not throttled. A value of true indicates that the bandwidth is throttled. The maximum transmission rate takes effect only if you set this parameter to true.
            "concurrent":1,// The maximum number of concurrent threads.
        }
    },
    "order":{
        "hops":[
            {
                "from":"Reader",
                "to":"Writer"
            }
        ]
    }
}