The Realtime Compute development platform provides an online debugging environment for you to debug your Realtime Compute jobs. Compared with local debugging, online debugging consumes more resources but validates business logic more accurately.

Online debugging uses real data storage resources to reduce the output differences between debugging and production. This helps you identify issues in the debugging phase.

Procedure

  1. Develop a job. For more information, see Develop a job.
  2. Modify the type parameter in the data definition language (DDL) statements of data storage resources.
    • Source table: type = 'random'
    • Result table: type = 'print'
  3. Publish the job. For more information, see Publish a job.
  4. Start the job. For more information, see Start a job.

Connectors

The Realtime Compute development platform provides the following two types of connectors for online debugging:
  • Source table random: periodically generates random data of a specific type.
  • Result table print: generates computing results.

Parameters in a connector table

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

Example

  • Test statements
    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

Query online debugging results

Note
  • Before you query the results of online debugging, make sure that you have published and started the job. For more information, see Publish a job and Start a job.
  • Online debugging consumes compute units (CUs).
To query the results of online debugging, follow these steps:
  1. Log on to the Realtime Compute development platform.
  2. In the top navigation bar, click Administration to go to the Administration page.
  3. In the Job Name column, click the name of the target job to go to the Job Administration page.
  4. In the Vertex Topology section, click the required result table node.
  5. On the top of the Execution Vertex page, navigate to Subtask List > View Logs to go to the View Logs page.
  6. View the logs.
    • Output of the print result table

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

    • UDX logs
      If you use UDXs (see UDX overview), you can view the logs by using one of the following 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.