The GBase 8a node in DataWorks lets you develop, periodically schedule, and integrate GBase 8a tasks with other jobs. This topic describes the main workflow for developing tasks by using a GBase 8a node.
Background information
GBase 8a is a relational database management system (RDBMS) that supports large-scale data storage and high-concurrency read and write operations. It is commonly used in sectors such as government, finance, telecommunications, and energy. GBase 8a supports the SQL standard and provides a range of enterprise-level features, such as data partitioning, load balancing, and disaster recovery and backup. For more information, see the official GBase 8a website.
Prerequisites
-
The business process has been created.
Data Studio performs engine-specific development operations based on business flows. Before creating a node, create a business flow first. For more information, see Create a business flow.
-
A GBase 8a data source is created.
To access your GBase 8a database, you must first add it as a GBase 8a data source in DataWorks. For information about how to create a data source, see Data source management. For information about how to use a GBase 8a data source in DataWorks, see GBase 8a data source.
NoteGBase 8a nodes support only GBase 8a data sources created with a JDBC connection string.
-
A network connection is established between your data source and a resource group.
You must make sure that the desired data source is connected to the resource group that you want to use. For more information about how to configure network connectivity, see Establish a network connection between a resource group and a data source.
-
(Optional; required for Resource Access Management (RAM) users) The RAM user used for task development has been added to the target workspace and assigned either the Development or Workspace Administrator role (which grants broad permissions—assign with caution). For more information about adding members and granting permissions, see Add members to a workspace.
Limitations
Supported regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), China (Chengdu), China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), Germany (Frankfurt), US (Silicon Valley), and US (Virginia).
Step 1: Create a GBase 8a node
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Development.
-
Right-click the target workflow and choose .
-
In the Create Node dialog box, enter a Name for the node and click OK. After the node is created, you can develop and configure tasks within it.
Step 2: Develop a GBase 8a task
(Optional) Select a GBase 8a data source
If multiple GBase 8a data sources exist in your workspace, you must select the appropriate data source on the GBase 8a node editing page. If only one GBase 8a data source exists, the node uses it by default.
GBase 8a nodes support only GBase 8a data sources created with a JDBC connection string.
Develop SQL code: Simple example
In the code editor of the GBase 8a node, write your task code. The following code provides an example.
SELECT * FROM usertablename;
Develop SQL code: Use scheduling parameters
DataWorks provides Scheduling Parameter to dynamically pass values to your code in periodic scheduling scenarios. You can define variables in your task code by using the ${variable_name} format and then assign a value to the variable. In the right-side navigation pane, go to the Properties tab and find the Scheduling Parameter section. For more information about the supported formats and how to configure scheduling parameters, see Supported formats of scheduling parameters and Configure and use scheduling parameters.
The following code provides an example.
SELECT '${var}'; -- Use with scheduling parameters.
Step 3: Configure task scheduling
To periodically run the node task, click Scheduling on the right side of the node editing page and configure scheduling settings based on your needs. For more information, see Overview of task scheduling properties.
You must configure the node’s Rerun attribute and Parent Nodes before you can submit the node.
Step 4: Test task code
Perform the following test operations as needed to verify that the task behaves as expected.
-
(Optional) Select a resource group and assign custom parameter values.
-
Click the
icon in the toolbar. In the Parameter dialog box, select the schedule resource group for testing. -
If your task code uses scheduling parameter variables, assign values to them here for testing. For more information about parameter assignment logic, see Task debugging process.
-
-
Save and run the task code.
Click the
icon in the toolbar to save your task code. Then click the
icon to run the task. -
(Optional) Perform smoke testing.
To run smoke testing in the development environment and verify that the scheduled node task executes as expected, perform smoke testing either during or after node submission. For more information, see Perform smoke testing.
Step 5: Submit and publish the task
After configuring the node task, submit and publish it. Once published, the node runs periodically based on its scheduling configuration.
-
Click the
icon in the toolbar to save the node. -
Click the
icon in the toolbar to submit the node task.In the Submission dialog box, enter a Change Description. Optionally, choose whether to require code review after submission.
Note-
You must configure the node’s Rerun attribute and Parent Nodes before you can submit the node.
-
Code review helps ensure code quality and prevents errors caused by unreviewed code being published directly to production. If code review is enabled, the submitted node code must be approved by reviewers before it can be published. For more information, see Code review.
-
If you are using a workspace in standard mode, after successfully submitting the task, click Publish in the upper-right corner of the node editing page to deploy the task to the production environment. For more information, see Publish a task.
Next steps
Task operations: After a task is committed and published, it runs periodically based on the node's configuration. You can click O&M in the top-right corner of the node editing page to go to the Operation Center and view the scheduling and running status of the scheduled task. For more information, see Managing Scheduled Tasks.