tencent cloud

피드백

Step 2. Create Mapper and Reducer Functions

마지막 업데이트 시간:2021-03-19 15:15:22

    Creating Mapper Function

    Creating in console through template function

    1. Log in to the SCF console and select Function Service on the left sidebar.
    2. At the top of the Function Service page, select the Beijing region and click Create to enter the function creating page and configure the function as shown below:
      • Creation method: select Template.
      • Fuzzy search: enter "map_function", search, and select the "map_function" template.
        Click Learn More in the template to view relevant information in the Template Details pop-up window, which can be downloaded.
    3. Click Next. The function name is automatically generated by default and can be modified as needed. Follow the prompts to configure the execution role:
      • Execution Role: check Enable. Configure and use SCF template role is selected here as an example as shown below:
      • Configure and use SCF template role: select this option and the system will automatically create and select an SCF template execution role associated with full access permissions of COS.
      • Use the existing role: you need to select an existing role that contains the above permissions in the drop-down list.

        Note:

        During execution, the function will use the execution role to get a temporary key to manipulate relevant Tencent Cloud resources.

    4. Click to expand the Function Code tab, where you can browse the code information. If you want to modify the parameter values such as variables, you can modify and save them online.

    Configuring COS trigger

    1. In the Trigger Configurations section, select Custom and enter relevant information according to the displayed parameters as shown below:

      Main parameters are as follows:
      • Trigger Method: select COS trigger.
      • COS Bucket: select srcmr.
      • Event Type: select All Creation Events.
    2. Click Complete.

    Creating Reducer Function

    Creating in console through template function

    1. Log in to the SCF console and select Function Service on the left sidebar.
    2. At the top of the Function Service page, select the Beijing region and click Create to enter the function creating page and configure the function as shown below:
      • Creation method: select Template.
      • Fuzzy search: enter "reduce_function", search, and select the "reduce_function" template.
        Click Learn More in the template to view relevant information in the Template Details pop-up window, which can be downloaded.
    3. Click Next. The function name is automatically generated by default and can be modified as needed. Follow the prompts to configure the execution role:
      • Execution Role: check Enable. Configure and use SCF template role is selected here as an example as shown below:
      • Configure and use SCF template role: select this option and the system will automatically create and select an SCF template execution role associated with full access permissions of COS.
      • Use the existing role: you need to select an existing role that contains the above permissions in the drop-down list.
    4. Click to expand the Function Code tab, where you can browse the code information. If you want to modify the parameter values such as variables, you can modify and save them online.

    Configuring COS trigger

    1. In the Trigger Configurations section, select Custom and enter relevant information according to the displayed parameters as shown below:

      Main parameters include:
      • Trigger Method: select COS trigger.
      • COS Bucket: select middlestagebucket.
      • Event Type: select All Creation Events.
    2. Click Complete.
    문의하기

    고객의 업무에 전용 서비스를 제공해드립니다.

    기술 지원

    더 많은 도움이 필요하시면, 티켓을 통해 연락 바랍니다. 티켓 서비스는 연중무휴 24시간 제공됩니다.

    연중무휴 24시간 전화 지원