# US 10,503,555 B2 · Selecting type and quantity of application masters that need to be started in advance

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,503,555 B2
- Document ID: US10503555B2
- Status: Granted
- Kind: B2
- Application number: 15/208,510
- Filed: 2016-07-12
- Published: 2016-11-03
- Granted: 2019-12-10
- Earliest claimed: 2014-01-13
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Guangwu He; Junhua Zhu
- Web page: https://patentgrep.com/patent/US10503555B2

## CPC

- G06F 9/5027: {the resource being a machine, e.g. CPUs, Servers, Terminals}
- H04L 67/1008: based on parameters of servers, e.g. available memory or workload (monitoring of computer activity G06F11/30)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A resource management method and apparatus are provided. The resource management method includes: selecting, by a resource manager RM, according to a type and a quantity of application masters AMs that need to be started in advance, resources from resources registered by a node manager, encapsulating the resources into multiple containers matching the AMs, and starting the AMs in the matching containers; and when the RM receives a job submitted by a client, checking, in the AMs according to information about the job, whether there is a matching AM to be used to execute the job, and if there is a matching AM, submitting the job to the matching AM for execution. Such that, when a client submits a job, the job can be submitted to an AM that has been started in advance for execution, thereby reducing latency resulting from resource allocation and AM startup.

## Claims

### Claim 1

A resource management method, comprising:
selecting, by a resource manager (RM) of a Hadoop YARN system, according to a type and a quantity of application masters (AMs) of the Hadoop YARN system that are to be started in advance, first resources from resources registered by a node manager (NM), wherein the AMs that are to be started in advance are to be started prior to receiving a job from a client by the RM;
encapsulating the first resources into multiple containers matching the AMs that are to be started in advance;
starting the AMs that are to be started in advance in the matching containers;
checking, in the AMs that have been started in advance and according to information about the job received from the client, whether there is a matching AM to be used to execute the job, when the RM receives the job;
when there is a matching AM to be used to execute the job, submitting the job to the matching AM for execution;
recording, by the RM, information about the AMs that are to be started in advance, wherein the information comprises host names, IP addresses, port numbers, application types and statuses of the AMs that are to be started in advance; and
checking, by the RM, whether the AMs that are to be started in advance are in a normal state, and if there is an AM in an abnormal state among the AMs that are to be started in advance, reallocating a resource to start the AM that is in the abnormal state which is an AM that has failed.

### Claim 2 (depends on 1)

The method according to claim 1, wherein after submitting the job to the matching AM for execution, the method further comprises:
receiving, by the RM, a resource request from the matching AM, allocating at least one of the resources registered by the NM, encapsulating the at least one resource into a container, and executing a task of the job in the encapsulated container.

### Claim 3 (depends on 1)

The method according to claim 1, wherein:
before the RM receives the job submitted by the client, the method further comprises:
reserving, by the RM, resources and encapsulating the reserved resources into multiple containers; and
the method further comprises:
determining, by the RM, according to the information about the job, whether there is a matching container of a reserved resource to be used for starting a new AM to execute the job, when there is no matching AM to be used to execute the job; and
allocating the matching container of the reserved resource to start the new AM to execute the job, when there is a matching container of a reserved resource to be used for starting a the new AM to execute the job.

### Claim 4 (depends on 1)

The method according to claim 1, wherein:
before the RM receives the job submitted by the client, the method further comprises:
reserving, by the RM, resources and encapsulating the reserved resources into multiple containers; and
the method further comprises:
checking, by the RM, according to the information about the job, whether there is a matching container of a reserved resource to be used for the matching AM to execute a task of the job, when there is a matching AM to be used to execute the job; and
allocating the matching container of the reserved resource to the AM for executing the task of the job, when there is a matching container of a reserved resource to be used for the matching AM to execute the task of the job.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the information about the job comprises information about executing the job on a designated AM, or information about executing the job on an AM of a designated application type, or application information of the job.

### Claim 6 (depends on 3)

The method according to claim 3, wherein after the container completes execution of a task of the job, the method further comprises:
determining whether the container that executes the task of the job needs to serve as a container of a reserved source;
if the container that executes the task of the job needs to serve as a container of a reserved source, adding the container that executes the task of the job to the reserved resources; and
if the container that executes the task of the job does not need to serve as a container of a reserved source, removing the container that executes the task of the job and releasing the resource.

### Claim 7 (depends on 4)

The method according to claim 4, wherein after the container completes execution of the task of the job, the method further comprises:
determining whether the container that executes the task of the job needs to serve as a container of a reserved source;
if the container that executes the task of the job needs to serve as a container of a reserved source, adding the container that executes the task of the job to the reserved resources; and
if the container that executes the task of the job does not need to serve as a container of a reserved source, removing the container that executes the task of the job and releasing the resource.

### Claim 8

A resource manager of a Hadoop YARN system, the resource manager comprising:
a memory, configured to store executable instructions;
a processor configured, when executing the executable instructions in the memory, to:
select, according to a type and a quantity of application masters (AMs) of the Hadoop YARN system that are to be started in advance, first resources from resources registered by a node manager (NM), wherein the AMs that are to be started in advance are to be started prior to receiving a job from a client by the resource manager;
encapsulate the first resources into multiple containers matching the AMs that are to be started in advance;
start the AMs that are to be started in advance in the matching containers;
check, in the AMs that have been started in advance and according to information about the job received from the client, whether there is a matching AM to be used to execute the job, when the job is received;
when there is a matching AM to be used to execute the job, submit the job to the matching AM for executions;
record information about the AMs that are to be started in advance, wherein the information comprises host names, IP addresses, port numbers, application types and statuses of the AMs that are to be started in advance; and
check whether the AMs that are to be started in advance are in a normal state, and if there is an AM in an abnormal state among the AMs that are to be started in advance, re-allocate a resource to start the AM that is in the abnormal state which is an AM that has failed.

### Claim 9 (depends on 8)

The resource manager according to claim 8, wherein
the processor is further configured to:
receive a resource request from the matching AM;
allocate at least one of the resources registered by the NM;
encapsulate the at least one resource into a container; and
execute a task of the job in the encapsulated container.

### Claim 10 (depends on 8)

The resource manager according to claim 8, wherein the processor is further configured to:
reserve resources and encapsulate the reserved resources into multiple containers before the job submitted by the client is received; and
determine, according to the information about the job, whether there is a matching container of a reserved resource to be used for starting a new AM to execute the job, when there is no matching AM to be used to execute the job; and
allocate the matching container of the reserved resource to start the new AM to execute the job, when there is a matching container of a reserved resource to be used for starting the new AM to execute the job.

### Claim 11 (depends on 8)

The resource manager according to claim 8, wherein the processor is further configured to:
reserve resources and encapsulate the reserved resources into multiple containers before the job submitted by the client is received; and
check, according to the information about the job, whether there is a matching container of a reserved resource to be used for the matching AM to execute a task of the job, when there is a matching AM to be used to execute the job; and
allocate the matching container of the reserved resource to the AM for executing the task of the job, when there is a matching container of a reserved resource to be used for the matching AM to execute the task of the job.

### Claim 12 (depends on 8)

The resource manager according to claim 8, wherein the information about the job comprises: information about executing the job on a designated AM, or information about executing the job on an AM of a designated application type, or application information of the job.

### Claim 13 (depends on 10)

The resource manager according to claim 10, wherein the processor is further configured to:
determine whether the container that executes a task of the job needs to serve as a container of a reserved source, after the container completes execution of the task of the job;
if the container that executes the task of the job needs to serve as a container of a reserved source, add the container that executes the task of the job to the reserved resources; and
if the container that executes the task of the job does not need to serve as a container of a reserved source, remove the container that executes the task of the job and release the resource.

### Claim 14 (depends on 11)

The resource manager according to claim 11, wherein the processor is further configured to:
determine whether the container that executes the task of the job needs to serve as a container of a reserved source, after the container completes execution of the task of the job;
if the container that executes the task of the job needs to serve as a container of a reserved source, add the container that executes the task of the job to the reserved resources; and
if the container that executes the task of the job does not need to serve as a container of a reserved source, remove the container that executes the task of the job and release the resource.
