El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Scenario

Updated on 2022-07-11 GMT+08:00

The concurrency of NettySource and the concurrency NettySink must be the same. Otherwise, the connection cannot be created.

Scenario

Assume that there are three jobs, a publisher and two subscribers. The publisher generates 10000 pieces of data each second. Data is sent by the NettySink operator from the publisher job to downstream subscribers which subscribe a same piece of data.

Data Planning

  1. The publisher uses customized operators to generate about 10000 pieces of data per second.
  2. The data contains two attributes, which are of integer and string types.
  3. Configuration file
    • nettyconnector.registerserver.topic.storage: (Mandatory) Configures the path (on a third-party server) to information about IP address, port numbers, and concurrency of NettySink. For example:
      nettyconnector.registerserver.topic.storage: /flink/nettyconnector
    • nettyconnector.sinkserver.port.range: (Mandatory) Configures the range of port numbers of NettySink. For example:
      nettyconnector.sinkserver.port.range: 28444-28943
    • nettyconnector.sinkserver.subnet: Configure the network domain. For example:
      nettyconnector.sinkserver.subnet: 10.162.0.0/16
  4. Description of APIs
    • RegisterServer API

      RegisterServerHandler stores information such as IP address, port number, and concurrency of NettySink for the connection with NettySource. Following APIs are provided for users:

      public interface RegisterServerHandler {
       
      /**
         * Start the RegisterServer
      
          *@param The configuration indicates the configuration type of Flink. 
      
         */
      void start(Configuration configuration) throws Exception;
      /**
              *Create a topic node (directory) on the RegisterServer
      )
              *@param The topic indicates the name of the topic node
      
              */
      void createTopicNode(String topic) throw Exception;
      /**
      *Register the information to a topic node (directory)
      
      * @param topic @param The topic indicates the directory to be registered with
      
      * @param The registerRecord indicates the information to be registered
      
      */
      void register(String topic, RegisterRecord registerRecord) throws Exception;
      /**
             *Delete the topic node.
             *@param The topic indicates the topic to be deleted.
             */
          void deleteTopicNode(String topic) throws Exception;
      /**
         * Deregister the registration inDeregister the registration information formation
         * @param The topic indicates the topic where the registration information locates.
         * @param The recordId indicates the ID of the registration information to be deregistered
         */
      void unregister(String topic, int recordId) throws Exception;
      /**
          * Query information
      * @param Topic where the query information locates
      * @param The recordId indicates the ID of the query information
      
      */
      RegisterRecord query(String topic, int recordId) throws Exception;
      /**
          * Query whether a topic exist.
          * @param topic
          */
      Boolean isExist(String topic) throws Exception;
      /**
          *Disable RegisterServerHandler.
         */
      void shutdown() throws Exception;

      In addition to the preceding APIs, Flink provides ZookeeperRegisterHandler.

    • NettySink operator
      Class NettySink(String name, 
      String topic, 
      RegisterServerHandler registerServerHandler,
      int numberOfSubscribedJobs)
      • name: Name of a current NettySink.
      • topic: The topic that generates data for the current NettySink. Different NettySinks must use different topics. Otherwise, the subscription may be disordered and data transmission may be abnormal.
      • registerServerHandler: Handler of the registration server.
      • numberOfSubscribedJobs: Specific number of jobs that subscribe the current NettySink. NettySink sends data only when all subscribers are connected to NettySink.
    • NettySource operator
      Class  NettySource(String name,
      String topic,
      RegisterServerHandler registerServerHandler)
      • name: name of the NettySource. The NettySource must be unique (concurrency excluded). Otherwise, connection with NettySink may be conflicted.
      • topic: topic of subscribed NettySink.
      • registerServerHandler: Handler of the registration server.
NOTE:

The concurrency of NettySource and the concurrency NettySink must be the same. Otherwise, the connection cannot be created.

Development Approach

1. There are three jobs, on publisher and two subscribers.

2. The publisher transforms generated data into byte[] and send them the subscribers.

3. After receiving the byte[], subscribers transform data into the string type and print sampled data.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback