The Realtime Compute development platform provides you with the online debugging feature for Realtime Compute jobs. Compared with local debugging, online debugging consumes more resources, but validates the business logic in a more authentic way.

Online debugging uses real data storage resources to effectively reduce the differences between debugging outputs and production outputs, thus helping you identify issues during the debugging phase.

Procedure

  1. Develop a job. For more information about how to develop a job, see Develop a job
  2. Modify the type parameter in the Data Definition Language (DDL) statements for data storage resources.
    • Source table: type = 'random'
    • Result table: type = 'print'
  3. Publish the job. For more information about how to publish a job, see Publish a job.
  4. Start the job. For more information about how to start a job, see Start a job.

Connector

The Realtime Compute development platform provides the following two types of connectors for online debugging:
  • Random source table: periodically generates random data of the corresponding type.
  • Print result table: generates the computing results.

Connector table parameters

  • Random table parameters
    Parameter Description
    type Required. The type of the connector. The value can only be set to random.
    interval Optional. The time interval for data generation, in milliseconds. Default value: 500.
  • Print table parameters
    Parameter Description
    type Required. The type of the connector. The value can only be set to print.
    ignoreWrite Optional. Specifies whether to ignore write operations. Default value: false. Valid values:
    • false: Data is written to the result table and the corresponding logs are generated.
    • true: Data is not written to the result table. The result table is empty and no logs are generated.

Example

  • Test code
    CREATE TABLE random_source (
      instr               VARCHAR
    ) WITH (
      type = 'random'
    );
    
    CREATE TABLE print_sink(
      instr VARCHAR,
      substr VARCHAR,
      num INT
    )with(
      type = 'print'
    );
    
    INSERT INTO print_sink
    SELECT
      instr,
      SUBSTRING(instr,0,5) AS substr,
      CHAR_LENGTH(instr) AS num
    FROM random_source
  • Test results

Procedure for querying online debugging results

Note
  • Before querying the online debugging results, make sure that you have Publish a job and Start a job.
  • Online debugging consumes some compute units (CUs).

To query online debugging results, follow these steps:

  1. Log on to the Realtime Compute Console.
  2. In the top navigation bar, click Administration to go to the Administration page.
  3. Click the target job name under the Job Name field to go to the Job Administration page.
  4. In the Vertex Topology section, click the corresponding result table node.
  5. At the top of the Execution Vertex page, click Subtask List, and then click View Logs in the Actions column to go to the View Logs page.
  6. View the corresponding logs.
    • Print result table output

      Click View Logs in the Actions column of taskmanager.out.

    • UDX logs

      If you use user-defined extensions (UDX overview), you can view the logs by using either the following two methods:

      • System.out or System.err method

        Click View Logs in the Actions column of taskmanager.out or taskmanager.err.

      • SLF4J Logger method

        Click View Logs in the Actions column of taskmanager.log.