This topic describes the data types and parameters that are supported by Stream Reader and how to configure Stream Reader by using the codeless user interface (UI) and code editor.

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

The following table lists the data types that are supported by 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 types of columns in the source table. You can specify multiple columns. You can set this parameter to generate random strings of a specific length. The following code provides an example:
"column" : [
      {
          "random": "8,15"
      },
      {
          "random": "10,10"
      }
]
Configuration items:
  • "random": "8, 15": generates a random string that is 8 bytes to 15 bytes in length.
  • "random": "10, 10": generates a 10-byte random string.
Yes No default value
sliceRecordCount The number of columns that are repeatedly generated. Yes No default value

Configure Stream Reader by using the codeless UI

This method is not supported.

Configure Stream Reader by using the code editor

In the following code, a synchronization node is configured to read data from the memory:
{
    "type":"job",
    "version":"2.0",// The version number. 
    "steps":[
        {
            "stepType":"stream",// The reader type. 
            "parameter":{
                "column":[// The data and types of columns in the source table. 
                    {
                        "type":"string",// The data type. 
                        "value":"field"// The value. 
                    },
                    {
                        "type":"long",
                        "value":100
                    },
                    {
                        "dateFormat":"yyyy-MM-dd HH:mm:ss",// The time format. 
                        "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 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":true,// Specifies whether to enable bandwidth throttling. The value false indicates that bandwidth throttling is disabled, and the value true indicates that bandwidth throttling is enabled. The mbps parameter takes effect only when the throttle parameter is set to true. 
            "concurrent":1,// The maximum number of parallel threads. 
           "mbps":"12"// The maximum transmission rate.
        }
    },
    "order":{
        "hops":[
            {
                "from":"Reader",
                "to":"Writer"
            }
        ]
    }
}