现在的位置: 首页 > 综合 > 正文

一道题目

2017年12月08日 ⁄ 综合 ⁄ 共 2203字 ⁄ 字号 评论关闭

最近拿到一道题目,有兴趣的可以看下。我的想法是用模板模式,有什么思路的话可以讨论下。

In this exercise, you are required to design a framework for a data processing job scheduler.

The environment includes a group of hetorogeneous servers to process data. Each job consists of a command of either an execuable or a script. A job can be started on any of the servers in the group. Once started, the job will keep running on the server until finishes. Starting a job is issuing the command on the particular server. 

Each job has the following attributes when created:
?Unique ID
?Name
?Command
?Start time
?CPU requirement
?Memory requirement 
?Other attributes

For each job, the scheduler is responsible for
1.Determining when to start the job, based on the start time
2.Determining which server in the group has sufficient capacity to run the job, based on the server current resource usage, and the job CPU, memory requirement.
3.Remote login to the identified server (such as ssh)
4.Starting the job by issuing the corresponding command
5.Checking the status of the job
6.Updating UI the job status (running, failed, completed)

Due to platform differences, each type of server has specific interface to provide the current resource usage and job status. In other words, the implementation of checking the available capacity and job status varies depending on platform.

Assuming there are Linux, AIX, Solaris, and Windows servers in the group, and the scheduler is running on a separate server.

You are not required to have the actual implementation of each of the steps above. You may use the pseudo code for the methods. UI is not part of the assignment.

是关于作业调度的一道题目,看了两天,写了一部分代码。应该挺简单的,但是没有完全实现。

几天之后,给了一点提示。如下:

1) I would avoid using the term "system calls". Here we are talking about the methods or procedures 
to remotely start a program.

2) Feel free to choose any algorithm, even if you choose randomly. 
The point is that the design should be able to replace algorithm flexiblely. 
3) The scheduler does not deal with data at all.
 It just know how to start a job. Each job knows where to get its data. 
Could be from shared storage, or database. It doesn't matter.

1. Please refer to my comment in the other homework 4 thread.
2. At high-level, the job status could be waiting to start,
 running, completed, failed, and etc. In more detail, 
the job status is the progress of the program, which is application specific. 
For example, how many records have been processed.
 The point is that the method to get the job status varies depending on platform.
In your pseudo code, of course you may simply print out a message.

后记:这个题目已经完成,只是完成了一个框架,很多地方具体的功能实现是使用伪代码代替的。使用的是模板模式。

抱歉!评论已关闭.