WO2017072938A1 - 計算機のスケールアウト方法、計算機システム及び記憶媒体 - Google Patents

計算機のスケールアウト方法、計算機システム及び記憶媒体 Download PDF

Info

Publication number
WO2017072938A1
WO2017072938A1 PCT/JP2015/080680 JP2015080680W WO2017072938A1 WO 2017072938 A1 WO2017072938 A1 WO 2017072938A1 JP 2015080680 W JP2015080680 W JP 2015080680W WO 2017072938 A1 WO2017072938 A1 WO 2017072938A1
Authority
WO
WIPO (PCT)
Prior art keywords
computer
query
scale
rewrite
server computer
Prior art date
Application number
PCT/JP2015/080680
Other languages
English (en)
French (fr)
Inventor
馬場 恒彦
常之 今木
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2015/080680 priority Critical patent/WO2017072938A1/ja
Priority to US15/557,545 priority patent/US20180046671A1/en
Priority to JP2017547300A priority patent/JP6535386B2/ja
Publication of WO2017072938A1 publication Critical patent/WO2017072938A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24542Plan optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24568Data stream processing; Continuous queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries

Definitions

  • the present invention relates to a computer system that processes stream data.
  • Stream data processing requires a high real-time processing performance by strictly guaranteeing the execution order with a tuple with a time stamp.
  • it is necessary to realize scalable performance improvement in order to acquire processing performance for higher-performance real-time data.
  • Patent Document 3 is known as an example of scalable stream data processing.
  • the input stream of the active computer and the internal state of each window query are replicated to a standby computer from a certain time, and the active system and the standby system are guaranteed to be synchronized based on the time.
  • Patent Document 2 discloses a technique for extracting a query having a low movement cost from the data inflow amount to the query, the window size, or the CPU usage rate, and dynamically moving the query to another server. ing. Patent Document 2 is a technology that realizes scale-out by moving a part of a query graph to another server.
  • Patent Document 1 discloses a technique for optimizing a query using a cost model in a scalable distributed cluster type streaming system and arranging the query on the distributed system.
  • Patent Document 1 is a technique for optimizing the placement of a static query, and there is a problem that the optimization query needs to be changed or rearranged in order to perform dynamic scale-out.
  • Patent Document 2 a part of a query graph is moved to another node to scale out the processing load to other nodes, and a query with a high processing load is executed in parallel on a plurality of nodes. There was a problem that it was not possible.
  • dynamic scale-out can be realized by dynamically replicating the active query to the standby system and further changing the streams input to the active system and the standby system. it can.
  • Patent Document 3 the same input stream is divided and distributed to the active system and the standby system. For this reason, if the query in the active system and the added standby system is a query that processes a continuous input stream, such as aggregation processing and sort processing, the result stream processed in each system is reprocessed in other nodes. (Aggregate) needs to be performed.
  • Patent Document 3 there is a problem that not only the load of dividing and distributing the input stream is increased, but also a load of reprocessing is added, and computer resources may be insufficient.
  • an object of the present invention is to dynamically distribute and execute a query executed on one computer to a plurality of computers.
  • the present invention relates to a computer scale-out method in which a second computer that executes a query is added to a first computer that receives stream data from a data source and executes the query.
  • a third step in which the management computer transmits a scale-out command including the rewrite query to the first computer and the second computer, and the first computer and the second computer include the step A fourth step of receiving a scale-out command, extracting the rewrite query, and switching to the extracted rewrite query; and the first calculation Or a fifth step in which the second computer notifies the management computer that the rewriting query is ready, and the management computer sends the stream data to the data source as the destination of the stream data. And a sixth step of transmitting the same stream data to the first computer and the second computer.
  • a query executed on one computer can be dynamically distributed to a plurality of computers and executed. Can be leveled.
  • FIG. 1 is a block diagram illustrating an example of a computer system that processes stream data according to a first embodiment of this invention.
  • FIG. It is a block diagram which shows a 1st Example of this invention and shows an example of a stream transmission / reception computer. It is a block diagram which shows a 1st Example of this invention and shows an example of an operation management computer. It is a block diagram which shows a 1st Example of this invention and shows an example of a server computer. It is a sequence diagram which shows a 1st Example of this invention and shows an example of the scale-out process performed with a computer system. It is a figure which shows the 1st Example of this invention and shows an example of a data transmission destination management table.
  • FIG. 1 is a block diagram showing an example of a computer system for processing stream data according to the first embodiment of this invention.
  • the computer system includes a transmission / reception computer 2 for transferring stream data, a first server computer 1-1 for processing stream data, a second server computer 1-2, an operation management computer 3, and a result of stream data processing.
  • a user terminal 6 that uses.
  • the stream transmission / reception computer 2, the first server computer 1-1, the second server computer 1-2, and the user terminal 6 are connected via the business network 4, and the stream transmission / reception computer 2 is connected to the first server computer 1- Stream data is supplied to the first and second server computers 1-2.
  • the calculation results of the first server computer 1-1 and the second server computer 1-2 are output to the user terminal 6 via the business network 4.
  • the first server computer 1-1 and the second server computer 1-2 are connected to the operation management computer 3 and the stream transmission / reception computer 2 via the management network 5.
  • the generic name of the first server computer 1-1 and the second server computer 1-2 is displayed as a server computer 1 without a sign after “-”.
  • an example in which stream data processing is performed by two server computers 1 is shown, but two or more servers may be used.
  • the stream transmission / reception computer 2 is connected to a stream data source (not shown).
  • the stream transmission / reception computer 2 is a stream data source for transferring stream data, which is data that arrives from time to time, such as information acquired from various sensors and IC tags, and stock price information, to the server computer 1 via the business network 4.
  • stream data which is data that arrives from time to time, such as information acquired from various sensors and IC tags, and stock price information
  • the server computer 1 via the business network 4.
  • the data source is the stream transmission / reception computer 2
  • communication devices connected to a plurality of sensors and computers may be used as the data source.
  • a stream ID is given to the stream data as an identifier for identifying the stream data.
  • the stream ID is used to identify a query for processing the stream data.
  • the stream ID is set in advance by a user or the like.
  • the stream ID includes character strings such as S1, S2, and S3. Assigned.
  • FIG. 2 is a block diagram illustrating an example of the stream transmission / reception computer 2.
  • the stream transmission / reception computer 2 includes a main storage device 21, a central processing unit 22, and a communication interface 23.
  • the main storage device 21 is a device for storing programs and data, and is composed of, for example, a RAM (Random Access Memory).
  • the main memory device 21 is loaded with the stream transmission program 200 and executed by the central processing unit 22.
  • the stream transmission program 200 is a program for transmitting, for example, the stream data input to the stream transmission / reception computer 2 to a destination (server computer 1), and includes a data transmission unit 201 and a data transmission destination management table 202. Including.
  • the central processing unit 22 includes, for example, a CPU (Central Processing Unit) and executes various programs read into the main storage device 21.
  • the central processing unit 22 executes the stream transmission program 200 read into the main storage device 21, as shown in FIG.
  • the communication interface 23 is connected to the business network 4 and the management network 5 respectively.
  • the stream transmission / reception computer 2 performs data communication (information communication) between the stream data source and the first server computer 1-1 and the second server computer 1-2 via the business network 4. .
  • the communication interface 23 is also used when the stream transmission / reception computer 2 performs data communication (information communication) with the operation management computer 3 via the management network 5.
  • stream data from the stream transmission / reception computer 2 is transferred to the first server computer 1-1 or the second server computer 1-. 2 respectively.
  • a predetermined command is transmitted from the operation management computer 3 to the stream transmission / reception computer 2.
  • the command includes a command for changing (adding or deleting) a destination (server computer).
  • Ethernet is used as the communication interface 23, but other than Ethernet, FDDI (optical fiber interface), serial interface, USB, and the like can be used.
  • FDDI optical fiber interface
  • serial interface serial interface
  • USB USB
  • the data transmission unit 201 of the stream transmission program 200 receives the stream data received by the stream transmission / reception computer 2 from the communication interface 23 via the business network 4 as the first server computer 1-1 or the second server computer 1. To -2.
  • the data transmission unit 201 acquires a stream ID from the received stream data, and acquires destination information corresponding to the stream ID from the data transmission destination management table 202.
  • the data transmission unit 201 transmits (transfers) the stream data to the server computer 1 having the extracted destination information.
  • FIG. 6 and 7 are diagrams illustrating an example of the data transmission destination management table 202.
  • FIG. FIG. 7 is a diagram showing an example of the data transmission destination management table 202 after rewriting by the scale-out process.
  • the data transmission destination management table 202 includes a stream ID 2021 for storing an identifier of stream data and a destination IP 2022 for storing a destination IP address (destination information) in one entry.
  • FIG. 3 is a block diagram illustrating an example of the operation management computer 3.
  • the operation management computer 3 includes a main storage device 31, a central processing unit 32, a communication interface 33, and an auxiliary storage device 34.
  • the main storage device 31 is a device for storing programs and data similarly to the main storage device 21 of the stream transmission / reception computer 2 described above. For example, a RAM is used.
  • the main storage device 31 is loaded with an operation management program 300 and a query conversion template 310.
  • the operation management program 300 executes scale-out for adding the server computer 1 that performs stream data processing.
  • a query that is being executed by a server computer that is currently in operation (in this embodiment, the first server computer 1-1 that is the active system) is added to the newly added server computer (this book In the embodiment, the second server computer 1-2) serving as the standby system is also executed.
  • the second server computer 1-2 is the server computer 1 set in advance as a standby system.
  • the scale-out of the present embodiment is performed by rewriting the query of the server computer 1 that is currently being executed and distributing the query whose execution timing is changed to the newly added server computer 1 and using a plurality of servers with the same stream data.
  • the computer 1 is executed in parallel, and the load on the computer is distributed.
  • the query execution timing after rewriting is set so that the first server computer 1-1 and the second server computer 1-2 alternately output the processing result of the stream data.
  • the operation management computer 3 outputs a scale-out command to the server computer 1 .
  • the trigger for outputting the command is determined by an instruction from an administrator or a monitoring unit (not shown).
  • a known or well-known technique can be used when the above condition is satisfied.
  • the operation management program 300 monitors the load of the server computer 1 that is executing a query, and the load on the computer exceeds a predetermined threshold value.
  • the scale-out request may be output.
  • a scale-out target query may be specified in the scale-out command.
  • the operation management program 300 includes a command transmission unit 301, a query generation unit 302, and a query management table 303.
  • the operation management program 300 uses the query conversion template 310 to instruct the server computer 1 to rewrite a query when scaling out.
  • the auxiliary storage device 34 is a non-volatile storage medium that stores programs such as the operation management program 300 and the query conversion template 310 and data.
  • the operation management computer 3 performs data communication (information communication) with the first server computer 1-1 or the second server computer 1-2 via the business network 4.
  • the communication interface 33 is connected to the stream transmission / reception computer 2 and the server computer 1 via the management network 5, and transmits a scale-out command, information on the added server computer 1, and the like.
  • the central processing unit 32 is the same as the central processing unit 22 of the stream transmission / reception computer 2 and executes, for example, a program loaded on the main storage device 31 including a CPU. In the present embodiment, the central processing unit 32 executes the operation management program 300 read into the main storage device 31, as shown in FIG.
  • Each function unit of the command transmission unit 301 and the query generation unit 302 constituting the operation management program 300 is loaded into the main storage device 31 as a program.
  • the central processing unit 32 operates as a function unit that provides a predetermined function by processing according to the program of each function unit.
  • the central processing unit 32 functions as the command transmission unit 301 by performing processing according to the command generation program. The same applies to other programs.
  • the central processing unit 32 also operates as a function unit that provides each function of a plurality of processes executed by each program.
  • a computer and a computer system are an apparatus and a system including these functional units.
  • auxiliary storage device 34 nonvolatile semiconductor memory, hard disk drive, storage device such as SSD (Solid State Drive), IC card, SD card, It can be stored in a computer-readable non-transitory data storage medium such as a DVD.
  • SSD Solid State Drive
  • the operation management program 300 manages the server computer 1 and receives a scale-out request, determines a scale-out destination and a query to be scaled-out, and instructs the server computer 1 and the stream transmission / reception computer 2.
  • the operation management program 300 manages queries executed by each server computer 1 using the query management table 303.
  • the operation management program 300 may generate a scale-out request when a predetermined condition is established for the server computer 1.
  • the command transmission unit 301 of the operation management program 300 generates a scale-out instruction and a scale-out destination addition instruction and transmits them to the server computer 1 and the stream transmission / reception computer 2.
  • the scale-out command includes the rewrite query generated by the query generation unit 302.
  • the query generation unit 302 of the operation management program 300 reads a rewrite query corresponding to a query to be scaled out from the query conversion template 310 and generates an execution format query.
  • This rewrite query is a query based on the rewrite content preset in the query conversion template 310, and causes a plurality of server computers 1 to execute queries of the same process with different execution timings for each server computer 1.
  • FIG. 8 is a diagram illustrating an example of the query management table 303.
  • the query management table 303 includes a query ID 3031 for storing a query identifier, a query character string 3032 for storing the contents of the query, an execution target stream ID 3033 for storing an identifier of stream data processed by the query, and a server that executes the query.
  • the target node 3034 for storing the information of the computer 1 is included in one entry.
  • the operation management program 300 updates the query management table 303 when the server computer 1 that executes a query is added, changed, or deleted.
  • two queries Q1 and Q2 are executed by the first server computer 1-1 (192.168.0.2).
  • the query management table 303 is used by the first server computer 1-1 to identify a query to be processed according to stream data received from the stream transmission / reception computer 2, for example. Therefore, the query management table 303 includes a query identifier record field, a query character string record, a query execution format storage destination record, and a stream ID record field that is a query execution target.
  • the query identifier refers to a character string used to distinguish registered queries, and hereinafter, the character string may be referred to as a “query ID”.
  • the query execution target stream ID is used when acquiring stream data to be processed by the query.
  • FIG. 9 is a diagram illustrating an example of a query conversion template 310 that is a conversion rule for generating a rewrite query.
  • the query conversion template 310 executes a query, a query ID 3101 for storing a query identifier, an original query 3102 for storing the contents of a query to be rewritten, an execution target stream ID 3103 for storing an identifier of stream data processed by the query, and the query.
  • One entry includes a target node 3104 for storing information of the server computer 1 to be executed, a query ID 3105 for storing the identifier of the rewritten query, and a rewritten query 3106 for storing the content of the rewritten query.
  • two queries Q1 and Q2 executed by the first server computer 1-1 are scaled out by adding the server computer 1-2 (192.168.0.3).
  • the query conversion template 310 is set in advance in the operation management computer 3 by an administrator or the like.
  • the query conversion template 310 is stored in the operation management computer 3, but may be stored in each of the server computers 1.
  • the query conversion template may be a method of describing a template for only a part of a query to be converted, or a method of applying a combination of one or more of these templates.
  • FIG. 4 is a block diagram showing an example of the first server computer 1-1.
  • the second server computer 1-2 has the same configuration as that of the first server computer 1-1, and a duplicate description is omitted.
  • the server computer 1 includes a main storage device 11, a central processing unit 12, a communication interface 13, and an auxiliary storage device 14.
  • the main storage device 11 is a device for storing programs and data similarly to the main storage device 21 of the stream transmission / reception computer 2 described above. For example, a RAM is used.
  • the main storage device 11 is loaded with a stream data processing program 100.
  • the stream data processing program 100 executes query switching and synchronization of execution environments such as windows with the added server computer 1 when executing scale-out.
  • the stream data processing program 100 includes a data communication unit 110, a query processing unit 120, and an instruction receiving unit 130. As described later, there are a cold standby type and a warm standby type for synchronization of execution environments.
  • the central processing unit 12 is the same as the central processing unit 22 of the stream transmission / reception computer 2 and executes, for example, a program loaded on the main storage device 11 including a CPU. In the present embodiment, the central processing unit 12 executes the stream data processing program 100 read into the main storage device 11 as shown in FIG.
  • the communication interface 13 is connected to the business network 4 and the management network 5, receives stream data from the stream transmission / reception computer 2, and receives commands such as scale-out from the operation management computer 3.
  • the auxiliary storage device 14 is composed of a nonvolatile storage medium that stores programs such as the stream data processing program 100 and data.
  • the central processing unit 12 operates as a functional unit that provides a predetermined function by processing according to the program of each functional unit.
  • the central processing unit 12 functions as the query processing unit 120 by performing processing according to the query processing program in the stream data processing program 100. The same applies to other programs.
  • the central processing unit 12 also operates as a functional unit that provides each function of a plurality of processes executed by each program.
  • a computer and a computer system are an apparatus and a system including these functional units.
  • Information such as programs and tables for realizing each function of the server computer 1 can be read by a computer such as an auxiliary storage device 14, a nonvolatile semiconductor memory, a hard disk drive, an SSD, or an IC card, an SD card, a DVD, etc. Can be stored on any non-transitory data storage medium.
  • the stream data processing program 100 includes a data communication unit 110, a query processing unit 120, and an instruction receiving unit 130.
  • the data communication unit 110 receives stream data transmitted from the stream transmission / reception computer 2 to the first server computer 1-1 via the communication interface 13 and the business network 4, and receives the received stream data. Is output to the query processing unit 55.
  • the query processing unit 120 includes an input unit 121, an arithmetic processing execution unit 122, a work area 123, and an output unit 124.
  • the query processing unit 120 executes stream data processing according to the registered query.
  • the first server computer 1-1 executes a query preset by the operation management computer 3 or the like.
  • the input unit 121 inputs the stream data output from the data communication unit 110, and outputs the input stream data to the arithmetic processing execution unit 122.
  • the work area 123 stores the stream data to be processed output from the arithmetic processing execution unit 122, and outputs the stream data stored in response to the data read request from the arithmetic processing execution unit 122 to the arithmetic processing execution unit 122. To do.
  • the arithmetic processing execution unit 122 reads the stream data given from the input unit 121 and executes stream data processing by a preset query.
  • a query is executed using stream data input in the past by a sliding window. For this reason, the arithmetic processing execution unit 122 stores the stream data (tuple) to be subject to arithmetic processing in the work area 123.
  • the sliding window refers to a data storage unit for temporarily storing stream data to be subjected to arithmetic processing set in the query.
  • the stream data cut out by the sliding window is stored in, for example, the main storage device 11 of the server computer 1-1 and used when the arithmetic processing execution unit 122 executes the query.
  • a preferred example of the query description language including the designation of the sliding window is CQL (Continuous Query Language) described in the above-mentioned Patent Document 2.
  • queries There are two types of queries: a query that specifies the range of stream data to be processed by time, and a query that specifies the range of stream data to be processed by the number of stream data to be processed.
  • a query that specifies the range of stream data to be processed by time a query that specifies the range of stream data to be processed by the number of stream data to be processed.
  • a query that specifies the range of stream data that will be processed in time will be referred to as a “time-based query”.
  • a query that specifies the range of stream data to be processed by the number of stream data to be processed is referred to as a “number-based query”.
  • the arithmetic processing execution unit 122 converts the stream data input from the data communication unit 110 via the input unit 121 into the work area 123. Save to Then, the arithmetic processing execution unit 122 deletes, from the work area 123, the stream data whose storage time has elapsed among the stream data stored in the work area 123.
  • the arithmetic processing execution unit 122 stores the input stream data in the work area 123. However, when the number of stream data stored in the work area 123 exceeds a predetermined number, for example, the arithmetic processing execution unit 122 starts from the stream data having a long storage time in the work area 123 in order from the work area 123. Delete from 123.
  • the output unit 124 outputs the execution result of the query by the arithmetic processing execution unit 122 to the outside via the data communication unit 110 and the communication interface 13.
  • the work area 123 is represented as “window”, the data (stream data) stored (stored) in the work area 123 is represented as “window data”, and the stream in the work area 123 is represented.
  • the data storage time or the number of data may be expressed as “window size”.
  • the command receiving unit 130 receives commands from the operation management computer 3 or the cluster at the time of scale-out. Examples of the command given to the command receiving unit 130 include a scale-out command, a query registration command, and a query deletion command.
  • the query registration instruction is an instruction for causing the query processing unit 120 to register a query for causing the first server computer 1-1 to sequentially process data (stream data) input to the stream data processing program 100. .
  • FIG. 5 is a sequence diagram illustrating an example of the scale-out process performed in the computer system. This process is executed when the operation management computer 3 receives a scale-out request. As described above, the operation management computer 3 outputs a scale-out command to the server computer 1 when a predetermined condition is satisfied or based on a scale-out request such as an instruction from the administrator. In the illustrated example, the standby second server computer 1-2 is added to the cluster that executes the query of the first server computer 1-1.
  • the command transmission unit 301 of the operation management program 300 of the operation management computer 3 accepts a scale-out request in response to establishment of a predetermined condition or an instruction from the administrator (S11).
  • the operation management computer 3 acquires the query ID to be scaled out, and acquires the target node 3104, the query ID 3105, and the rewrite query 3106 from the query conversion template 310 shown in FIG. 5 (S12).
  • the rewrite query Q1-1 of the first server computer 1-1 indicates a query to be switched to the query Q1 currently being executed by the first server computer 1-1, and the second server computer 1-
  • the second rewrite query Q1-2 is a query that is newly activated by the second server computer 1-2.
  • the rewrite query Q2-1 of the first server computer 1-1 also indicates a query to be switched to the query Q2 currently being executed by the first server computer 1, and the rewrite query Q2- of the second server computer 1-2.
  • 2 is a query that is newly activated by the second server computer 1-2.
  • the command transmission unit 301 of the operation management program 300 transmits the acquired rewrite query 3106 to the target node 3104 and the stream transmission / reception computer 2 in a scale-out command (S13).
  • the execution timing of queries that perform the same processing is rewritten for each target node 3104, and stream data processing is executed in parallel by the two server computers 1.
  • the stream transmission / reception computer 2 When the stream transmission / reception computer 2 receives the scale-out command, the stream transmission / reception computer 2 starts buffering the stream data transmitted to the first server computer 1-1, and transmits the stream data to the first server computer 1-1. Transmission is temporarily stopped (S14).
  • the first server computer 1-1 receives the scale-out command from the operation management computer 3 at the command receiving unit 130.
  • the instruction receiving unit 130 extracts the rewrite queries Q1-1 and Q2-1 included in the scale-out command and transmits them to the query processing unit 120 (S15).
  • the query processing unit 120 of the first server computer 1-1 prepares to rewrite the queries Q1 and Q2 being executed by expanding the received rewrite queries Q1-1 and Q2-1 (S16). Then, the query processing unit 120 notifies the instruction receiving unit 130 to the stream transmission / reception computer 2 that preparation for rewriting is completed (S17).
  • the second server computer 1-2 receives the scale-out command from the operation management computer 3 at the command receiving unit 130.
  • the instruction receiving unit 130 extracts the rewrite queries Q1-2 and Q2-2 included in the scale-out command and transmits them to the query processing unit 120 (S18).
  • the query processing unit 120 of the second server computer 1-2 expands the received rewrite queries Q1-2 and Q2-2 (S19). Then, the query processing unit 120 notifies the instruction receiving unit 130 that the preparation for rewriting the query is completed to the stream transmission / reception computer 2 (S20). The instruction receiving unit 130 of the second server computer 1-2 notifies the instruction receiving unit 130 of the first server computer 1-1 that the preparation for query rewriting has been completed (S21). Since the second server computer 1-2 is not currently executing a query, it is only necessary to expand the rewrite query 3106.
  • the query processing unit 120 reads the data in the windows of the queries Q1 and Q2 (S22), the contents of the window are transferred to the instruction receiving unit 130 to the second server computer 1 -2 is sent to the rewrite query window -2 (S23).
  • the query processing unit 120 writes the data of the windows of the queries Q1 and Q2 into the windows of the rewrite queries Q1-1 and Q2-1 and synchronizes them.
  • the first server computer 1-1 transmits an instruction to copy the data in the windows of the queries Q1 and Q2 read by the query processing unit 120 to the instruction receiving unit 130 of the second server computer 1-2 (S24). ).
  • the instruction receiving unit 130 of the second server computer 1-2 extracts the data copy in the windows of the queries Q1 and Q2 of the first server computer 1-1 from the window copy instruction, and sends the window of the window to the query processing unit 120.
  • a duplication instruction is transmitted (S25).
  • the query processing unit 120 of the second server computer 1-2 converts the contents (duplicates) of the windows of the queries Q1 and Q2 of the first server computer 1-1 from the received window duplication instruction to the second server computer 1 -2 rewrite queries Q1-2 and Q2-2 are written in the window (S26). As a result, the contents of the windows in the rewrite query of the first server computer 1-1 and the second server computer 1-2 are synchronized.
  • the query processing unit 120 of the second server computer 1-2 notifies the instruction receiving unit 130 of the notification that the window duplication has been completed (S27).
  • the instruction receiving unit 130 of the second server computer 1-2 notifies the instruction receiving unit 130 of the first server computer 1-1 of the notification that the window duplication has been completed (S28).
  • the first server computer 1-1 and the second server computer 1-2 are set with the same processing content query (rewrite query) that differs only in the execution timing, and the rewrite query windows are synchronized. It becomes a state.
  • the instruction receiving unit 130 of the first server computer 1-1 outputs an instruction to switch the query being executed to the expanded rewrite query to the query processing unit 120 (S29).
  • the query processing unit 120 stops the query being executed, and switches to the expanded rewrite query (S30).
  • the second server computer 1-2 has only to start executing the rewrite query by this time.
  • the command receiving unit 130 of the first server computer 1-1 notifies the operation management computer 3 that the preparation for executing the rewrite query is completed (S31).
  • the operation management computer 3 transmits to the stream transmission / reception computer 2 a command for adding a destination of a new computer to be scaled out (S32).
  • the stream transmission / reception computer 2 adds the destination of the stream data by adding the received destination to the data transmission destination management table 202 (S33).
  • the stream transmission / reception computer 2 cancels the buffering of the stream data, and transmits the stream data (S1) to the second server computer 1-2 in addition to the first server computer 1-1.
  • the stream transmission / reception computer 2 temporarily stops transmission by buffering the stream data. Then, the first server computer 1-1 and the second server computer 1-2 perform the expansion of the rewrite query and the synchronization of the query window state. When the window synchronization is completed, the first server computer 1-1 switches the currently executed query to the rewritten query. Then, the first server computer 1-1 notifies the operation management computer 3 that the preparation for the rewrite query is completed, and the operation management computer 3 sends the new computer (second server computer 1-2) to the stream data. To the stream transmission / reception computer 2 to be added to Then, the stream transmission / reception computer 2 adds a new computer to the transmission destination, stops buffering, and resumes transmission of stream data.
  • the process shown in FIG. 5 is called a warm standby type.
  • the operation management computer 3 In the warm standby system, the operation management computer 3 generates a rewrite query as described above and transmits it to the server computer 1 to be scaled out. Further, based on a command from the operation management computer 3, the stream transmission / reception computer 2 interrupts the transmission of the stream data to the first server computer 1-1.
  • the first server computer 1-1 duplicates the contents of the window, transmits it to the second server computer 1-2 to be added, and synchronizes the data in the window.
  • the first server computer 1-1 switches the query to be executed to the rewrite query.
  • the operation management computer 3 causes the stream transmission / reception computer 2 to resume transmission of stream data, thereby completing the dynamic scale-out by the warm standby. As a result, it is possible to dynamically scale out while using the same stream data.
  • the stream data buffering start time implemented by the stream transmission / reception computer 2 is delayed until the timing (S21) when the rewriting preparation completion is guaranteed by the first server computer 1-1 and the second server computer 1-2. It is possible to make it.
  • the window is duplicated after being stopped (stream data is temporarily stopped), but the present invention is not limited to this. If the data in the window can finally be synchronized among the multiple server computers 1 to be scaled out, the replication process is performed without pausing the transmission of the stream data (the updated window process is copied each time), and a predetermined amount
  • the stream data from the stream transmission / reception computer 2 may be quiesced after the above copying is completed. In this case, by shortening the time buffered in the stream transmission / reception computer 2, the stop time of the query processing performed in the server computer 1 can be shortened.
  • FIG. 10 is a diagram showing the relationship between tuples and time processed by the first server computer 1-1 and the second server computer 1-2.
  • a circle indicates a tuple
  • a solid line in the figure indicates a tuple that outputs a stream data processing result
  • a broken line in the figure indicates a tuple that does not output a stream data processing result.
  • the first server computer 1-1 and the second server computer 1-2 perform stream data processing with the same input tuple, and alternately output stream data processing calculation results every second.
  • the stream data calculation results of the first server computer 1-1 and the second server computer 1-2 can be used in a time series of tuples. There is no need to perform an aggregation operation or the like as in the conventional example.
  • the stream transmission / reception computer 2 that transmits stream data as an input tuple does not need to select or divide tuples as in the above-described conventional example, so that it is possible to suppress the load related to distributed processing.
  • the same tuple is input to the first and second server computers 1-1 and 1-2, but the output from the query having the same processing content with different execution timing is alternately performed. Results are output alternately.
  • query execution is performed alternately is shown, but the present invention is not limited to this.
  • both the first and second server computers 1-1, 1-2 execute the operations of tuples 1, 2, 3 and only the first server computer 1-1 streams.
  • Data processing results may be output. That is, a plurality of server computers 1 perform the same tuple operation, and output of stream data processing results may be permitted in a predetermined order such as alternating.
  • the plurality of server computers 1 perform the same tuple operation, but only the permitted server computer 1 outputs the processing result of the stream data, and the other server computer 1 outputs the processing result of the stream data. Prohibited (or skipped). The other server computer 1 may prohibit or skip the processing of the stream data.
  • FIG. 11 is a diagram showing the relationship between tuples and time processed by the first server computer 1-1 and the second server computer 1-2.
  • a circle indicates a tuple
  • a solid line in the figure indicates a tuple that outputs a stream data processing result
  • a broken line in the figure indicates a tuple that does not output a stream data processing result.
  • the first server computer 1-1 and the second server computer 1-2 perform stream data processing with the same input tuple, and alternately output the calculation results of the window three times.
  • the stream data calculation results of the first server computer 1-1 and the second server computer 1-2 can be used in a time series of tuples. There is no need to perform an aggregation operation or the like as in the conventional example. Therefore, a shortage of computer resources can be suppressed.
  • the stream transmission / reception computer 2 that transmits stream data does not need to divide the stream data as in the conventional example, it is possible to suppress a shortage of computer resources.
  • FIG. 12 is a diagram illustrating an example of the query conversion template 310.
  • FIG. 12 shows an example in which the first server computer 1-1 and the second server computer 1-2 alternately perform window operations.
  • FIG. 13 is a diagram showing the relationship between tuples and time processed by the first server computer 1-1 and the second server computer 1-2.
  • a circle indicates a tuple
  • a solid line in the figure indicates a tuple that outputs a stream data processing result
  • a broken line in the figure indicates a tuple that does not output a stream data processing result.
  • FIG. 14 is a sequence diagram showing a modification of the first embodiment and showing an example of the scale-out process performed in the computer system.
  • Steps S11 and S12 are the same as in FIG. 5, and the operation management computer 3 generates a scale-out request and generates rewrite queries Q1-1, Q1-2, Q2-1, and Q2-2 from the query conversion template 310. To do.
  • the operation management computer 3 transmits a scale-out command including a rewrite query to the server computer 1 to be scaled out.
  • the stream transmission / reception computer 2 does not interrupt the transmission of the stream data and continues to transmit the stream data to the first server computer 1-1.
  • the first server computer 1-1 and the second server computer 1-2 to be scaled out perform a rewrite query included in the scale-out command from the instruction receiving unit 130 as a query process.
  • the rewrite query is expanded in each server computer 1.
  • the stream transmission / reception computer 2 does not interrupt the transmission of the stream data and continues to transmit the stream data to the first server computer 1-1.
  • the server computer 1 of the present modification differs from that shown in FIG. 5 in that the instruction receiving unit 130 of the first server computer 1-1 does not duplicate the window.
  • the stream transmission / reception computer 2 instead of copying in the window, continues to transmit the stream data, so that the data in the windows of the rewrite queries Q1-1 to Q2-2 is satisfied to fill the first server.
  • the rewrite query windows of the computer 1-1 and the second server computer 1-2 are synchronized.
  • step S41 the operation management computer 3 indicates that the first server computer 1-1 and the second server computer 1-2 to be scaled out have completed expansion and are ready for a rewrite query. To notify.
  • the operation management computer 3 transmits to the stream transmission / reception computer 2 a command for adding a destination of a new computer to be scaled out (S42). Similarly to FIG. 5, the stream transmission / reception computer 2 adds the transmission destination of the stream data by adding the received destination to the data transmission destination management table 202 (S43).
  • the stream transmission / reception computer 2 switches the query to stream data in order to instruct the first server computer 1-1 and the second server computer 1-2 to start processing by the rewrite query.
  • a tuple is inserted (S44). Note that the query switching tuple is a tuple including preset data.
  • the stream transmission / reception computer 2 transmits a switching command for switching the query to be executed to the first server computer 1-1 and the second server computer 1-2 to be scaled out (S45).
  • the newly added query processing unit 120 of the second server computer 1-2 determines whether the windows in the query are filled with tuples, so that the windows of the first and second server computers 1 Is detected (S46), the second server computer 1-2 transmits a notification that the preparation for switching is completed to the stream transmission / reception computer 2 (S47).
  • the stream transmission / reception computer 2 When the stream transmission / reception computer 2 receives the notification that the preparation for switching has been completed, the stream transmission / reception computer 2 instructs each server computer 1 to switch queries (S48).
  • the first server computer 1-1 and the second server computer 1-2 switch processing to the expanded rewrite query (S49).
  • the first server computer 1-1 receives the query switching tuple
  • the first server computer 1-1 starts processing subsequent tuples with a rewrite query.
  • the second server computer 1-2 activates the rewrite query, waits until a query switching tuple is received, and executes stream data processing with the rewrite query for the tuples subsequent to the query switching tuple.
  • the stream transmission / reception computer 2 prepares a query to be rewritten by each server computer 1 without interrupting transmission of stream data.
  • Each server computer 1 then synchronizes the execution environment of the rewrite queries of the plurality of server computers 1 to be scaled out by satisfying the tuple in the window in the rewrite query, and then switches the query to be executed. Can be scaled out dynamically.
  • the process shown in FIG. 14 is called a cold standby type.
  • the operation management computer 3 generates a rewrite query as described above and transmits it to the server computer 1 to be scaled out.
  • the server computer 1 expands the rewrite query, inputs stream data to the window in the rewrite query, and fills the window to synchronize the windows between the server computers 1 to be scaled out. Thereafter, by switching the query to be executed on the server computer 1 to be scaled out, dynamic scale-out by the cold standby method can be performed.
  • the operation management computer 3 distributes queries having the same processing contents with different execution timings to the new server computer 1 and performs scale-out, thereby leveling the load on the server computer 1, It is possible to level the network bandwidth connected to the server computer 1. Further, in the first embodiment, the query execution timings of the plurality of server computers 1 are alternate, and therefore the stream data processing capability may not be improved.
  • the scale-out may be performed by three or more server computers 1, and the number of server computers 1 increases. Accordingly, the interval or number of times that one server computer 1 skips query processing (output) will increase.
  • the operation management computer 3 can be configured as one server computer in accordance with the number of server computers 1 to be scaled out.
  • the interval at which 1 executes the rewrite query (or outputs the result) may be changed.
  • the operation management computer 3 is shown as an independent computer in FIG. 1, but is included in either the first server computer 1-1 or the second server computer 1-2. You may do it. In the first embodiment.
  • the processing results of the first server computer 1-1 and the second server computer 1-2 may be processed by the next stream processing computer group.
  • the first embodiment an example is shown in which a query running on the first server computer 1-1 is scaled out to the second server computer 1-2.
  • a query is selected and scaled.
  • An example of performing out is shown.
  • the scale-out trigger is the same as in the first embodiment, and is when the predetermined condition is satisfied in the operation management computer 3 or when the administrator of the operation management computer 3 instructs the scale-out.
  • the server computer 1 to be scaled out is the same as in the first embodiment, and the query of the first server computer 1-1 serving as the active system is scaled to the second server computer 1-2 serving as the standby system. Out.
  • 15 and 16 are block diagrams showing an example of the server computer 1 and the operation management computer 3 according to the second embodiment of the present invention.
  • the first server computer 1-1 and the second server computer 1-2 are replaced with the server computer 1-1 of FIG. 15, and the operation management computer 3 of FIG. It is assumed that the operation management computer 3 is replaced.
  • Other configurations are the same as those of the first embodiment.
  • FIG. 15 shows the first server computer 1-1 of the second embodiment, and the second server computer 1-2 has the same configuration as in the first embodiment.
  • the first server computer 1-1 is obtained by adding a query management unit 140, a server status table 180, a query management table 190, and a query status table 195 to the configuration of the first embodiment shown in FIG. .
  • Other configurations are the same as those of the first embodiment.
  • the query management unit 140 has a function for registering or deleting a query executed in the query processing unit 120 of the stream data processing program 100 and a query character string (for example, source code so that the user can understand the contents of the query). And a function for generating a query execution format (for example, a machine language, an expression format understood by a machine).
  • a query execution format for example, a machine language, an expression format understood by a machine.
  • a method for generating the execution form of the query from the query character string in the query management unit 140 is not particularly limited, and a known or well-known method can be used.
  • the query analysis unit 150 has a function of analyzing the query character string described above. That is, the query analysis unit 150 analyzes the query character string given from the instruction receiving unit 130 when registering the query, and gives the analysis result to the arithmetic processing execution unit 160.
  • the query analysis unit 150 includes a query selection unit 151 that selects a query to be scaled out. The query selection by the query selection unit 151 is performed based on a CPU usage rate, a network usage bandwidth, a preset threshold value, and the like.
  • the arithmetic processing execution unit 160 functions to receive a query analysis result given from the query analysis unit 150 and select a more efficient query execution format from the analysis result (that is, to perform optimization processing). .
  • the query generation unit 170 generates the execution format of the query selected by the arithmetic processing execution unit 160.
  • the query management unit 140 manages the server status table 180, the query management table 190, and the query status table 195.
  • the query management table 190 is the same as the query management table 190 of the operation management computer 3 shown in FIG. In the second embodiment, an example in which a query executed for each server computer 1 is managed is shown.
  • FIG. 17 is a diagram showing an example of the query status table 195.
  • the query status table 195 includes a query ID 1951 that stores an identifier of a query that is running on the server computer 1, a CPU usage rate 1952 that stores a CPU usage rate as a resource usage amount for each query, and a resource usage amount for each query.
  • the query management unit 140 monitors the operating status of each query at a predetermined cycle, and updates the query status table 195 with the monitoring result.
  • the data input frequency represents the number of stream data to be processed by the query input to the server computer 1 per unit time, and is a value indicating the query processing amount.
  • FIG. 18 is a diagram illustrating an example of the server status table 180.
  • the server status table 180 is obtained by adding a server ID 1801 for storing the identifier of the server computer 1 to the query status table 195 of FIG.
  • the server status table 180 is transmitted to the operation management computer 3 at a predetermined timing.
  • FIG. 16 shows the operation management computer 3 of the second embodiment.
  • the operation management computer 3 includes a query state management unit 320, a cluster state management unit 330, and a cluster state management table 340 instead of the query generation unit 302 and the query management table 303 of the first embodiment shown in FIG. Other configurations are the same as those of the first embodiment.
  • the query state management unit 320 and the cluster state management unit 330 are executed by the central processing unit 32 as programs constituting the operation management program 300.
  • the cluster state management unit 330 collects the query states (that is, the contents of each server state table 180) on all the server computers 1.
  • the cluster state management unit 330 is a server under the management of the query management unit 140 of each server computer 1 (in the example shown in FIG. 1, the first server computer 1-1 and the second server computer 1-2).
  • the contents of the state table 180 are collected and a cluster state management table 340 is generated.
  • FIG. 19 is a diagram illustrating an example of the cluster state management table 340.
  • the cluster state management table 340 is obtained by combining the server state table 180 of FIG. 18 for each server ID of the server computer 1.
  • the cluster status management table 340 sets the identifier of the server status table 180 to the server ID 3450 for each server computer 1, and the other configuration is the same as the query status table 195 of FIG.
  • the illustrated cluster state management table 340 shows the state after the scale-out.
  • the query state management unit 320 newly creates a query from all the queries that should be processed in the currently running server computer (the first server computer 1-1 shown in FIG. 1). A query to be added to the added server computer (second server computer 1-2 shown in FIG. 1) is selected.
  • the query state management unit 320 calculates a cost (replication cost) for replicating the query to another server computer 1, and based on the replication cost, the first server computer 1-1 to the second server computer 1-
  • the query to be replicated to 2 is selected and executed.
  • the replication cost is the query status as the time (expected) that the query to be rewritten is replicated from the first server computer 1-1 that is currently in operation to the newly added second server computer 1-2. Calculated by the management unit 320.
  • the method for calculating the replication cost is the same as the migration cost disclosed in Patent Document 2 and will not be described in detail here.
  • the operation management computer 3 collects information related to all queries, calculates a replication cost from the collected information, and based on the calculated replication cost.
  • the query replication time from the active first server computer 1-1 to the standby second server computer 1-2 is short, and the load of the server computers 1 forming the cluster is equalized. Select one or more queries.
  • the operation management computer 3 replicates the selected query from the active first server computer 1-1 to the standby second server computer 1-2, and rewrites the execution timing.
  • query replication processing is performed by the cold standby method shown in the modification of the first embodiment.
  • FIG. 20 is a flowchart showing an example of the scale-out process. This process is executed by the operation management computer 3 when the scale-out is triggered.
  • the operation management computer 3 that executes the operation management program 300 acquires the server status table 180 from each server computer 1 (S101). Next, the operation management computer 3 combines the acquired server status table 180 to generate a cluster status management table 340 (S102).
  • the operation management computer 3 calculates, for each query, the replication cost of the scale-out process for copying from the active first server computer 1-1 to the standby second server computer 1-2 (S103). .
  • the operation management computer 3 executes a query selection process.
  • the details of the query selection process are the same as in Patent Document 2 and will not be described in detail here.
  • queries with query IDs “Q1” and “Q2” are respectively selected as scale-out target queries (step S104).
  • the operation management computer 3 executes the scale-out process for each of the selected queries by the loop process of steps S105 to S107.
  • the scale-out operation is completed, and the processing of the queries Q1 and Q2 is alternately executed in the active first server computer 1-1 and the standby second server computer 1-2.
  • the result of the stream data processing is output to the user terminal 6.
  • the resource usage target value is set to 50%, for example, and the operation management computer 3 starts the replication query selection process.
  • the operation management computer 3 selects the query Q2, which is the query with the shortest replication time, as the migration query.
  • the total CPU usage rate in the first server computer 1-1 that is the active server computer is 80%
  • the total CPU usage rate in the standby second server computer 1-2 is 20%. (See FIGS. 18 and 19).
  • the operation management computer 3 again scales out.
  • a query with the shortest replication time (probability) is selected as a query to be scaled out from queries not selected as the target query. That is, the query Q1 whose replication time is the second shortest after the query Q2 is selected as the query to be scaled out.
  • the total CPU usage rate in the first server computer 1-1 and the total CPU usage rate in the second server computer 1-2 are both 50% (see FIG. 19).
  • the operation management computer 3 ends the scale-out target query selection processing because the total CPU usage rate in the second server computer 1-2 has reached the resource usage target value of 50%.
  • the query Q1 and the query Q2 are selected as queries to be scaled out from the first server computer 1-1 to the second server computer 1-2.
  • FIG. 21 is a sequence diagram showing an example of the scale-out process performed in the computer system. Details of the scale-out process performed in steps S105 to S107 will be described below.
  • Step S11 is the same as FIG. 5 shown in the first embodiment, and the operation management computer 3 generates a scale-out request.
  • step S11A the operation management computer 3 selects a query to be scaled out by the process in step S104 in FIG.
  • Step S11 is the same as FIG. 5 shown in the first embodiment, and the operation management computer 3 refers to the query conversion template 310 to generate a rewrite query. Then, the operation management computer 3 transmits a scale-out command including a rewrite query to the first server computer 1-1 and the second server computer 1-2 to be scaled out.
  • the subsequent processing is the same as that of FIG. 14 of the modified example, and the stream transmission / reception computer 2 continues to transmit the stream data to the first server computer 1-1 without interrupting the transmission of the stream data. To do.
  • the operation management computer 3 selects a query to be scaled out, generates a rewrite query, and transmits the rewrite query to the server computer 1 to be scaled out. Then, the stream transmission / reception computer 2 continues to transmit the stream data, and each server computer 1 satisfies the tuple in the window in the rewrite query, thereby executing the rewrite query execution environment among the plurality of server computers 1 to be scaled out. Can be scaled out dynamically by switching the queries to be executed and then switching the queries to be executed.
  • the operation management computer 3 selects a query to be scaled out.
  • the server computer 1 selects a query to be scaled out is shown.
  • Other configurations are the same as those in the second embodiment.
  • FIG. 22 is a block diagram showing an example of a server computer according to the third embodiment of this invention.
  • the example shown in the figure shows the first server computer 1-1, but the second server computer 1-2 has the same configuration, and therefore a duplicate description is omitted.
  • the server computer 1 according to the third embodiment is different from the second embodiment in that a query conversion template 310A and a cluster state management table 340A are added to the main storage device 11. Other configurations are the same as those of the second embodiment.
  • the query conversion template 310A is a copy of the query conversion template 310 held by the operation management computer 3.
  • the cluster state management table 340A has the same configuration as the cluster state management table 340 held by the operation management computer 3.
  • FIG. 23 is a sequence diagram showing an example of the scale-out process performed in the computer system.
  • Step S11 is the same as FIG. 5 shown in the first embodiment, and the operation management computer 3 generates a scale-out request.
  • step S13B the operation management computer 3 transmits a scale-out command to the first server computer 1-1 and the second server computer 1-2 to be scaled out.
  • the second server computer 1-2 is the server computer 1 set in advance as a standby system.
  • the command reception unit 130 of the first server computer 1-1 transmits a query rewrite instruction to the query management unit 140 (S53).
  • the query management unit 140 Upon receiving the rewrite instruction, the query management unit 140 selects a query to be scaled out (S54). For the selection of the query to be scaled out, the query management unit 140 performs the same processing as in steps S101 to S104 shown in FIG. That is, the query management unit 140 generates the cluster state management table 340A, and calculates the scale-out cost for the query being executed from the cluster state management table 340A (S103). Then, a query is selected in the order of lowest scale-out cost to determine whether or not a resource usage target value is satisfied, and a query that satisfies the resource usage target value is selected as a scale-out target query ( S104).
  • the query management unit 140 refers to the query conversion template 310A and generates a rewritten query in which the execution timing of the selected query is rewritten (S56).
  • the query management unit 140 transmits the generated rewrite query to the query processing unit 120 (S56).
  • the query processing unit 120 expands the received rewrite query and prepares for new stream data processing (S57).
  • the query processing unit 120 transmits a notification that the rewrite query preparation is completed to the instruction receiving unit 130 (S58).
  • the processing of steps S53 to S58 is executed, and the rewrite query is developed.
  • the target node 3104 of the query conversion template 310A is different from the first server computer 1-1, the second server computer 1-2 has different rewrite queries with different execution timings. Generated.
  • the instruction receiving unit 130 of the second server computer 1-2 transmits a notification that the rewrite query preparation is completed to the first server computer 1-1 (S60).
  • the instruction receiving unit 130 of the first server computer 1-1 notifies the operation management computer 3 that the rewrite query preparation has been completed in the scale-out target server computer 1 (S61).
  • the operation management computer 3 transmits to the stream transmission / reception computer 2 a command for adding a destination of a new computer to be scaled out (S62).
  • the stream transmission / reception computer 2 adds a new stream data transmission destination by adding the received destination to the data transmission destination management table 202 as in FIG. 5 of the first embodiment (S63).
  • the stream transmission / reception computer 2 inserts a query switching tuple into the stream data (S64).
  • the stream transmission / reception computer 2 transmits a switching command for switching a query to be executed to the first server computer 1-1 and the second server computer 1-2 to be scaled out (S65).
  • the first server computer 1-1 and the second server computer 1-2 switch to the expanded rewrite query and start the stream data processing (S66).
  • the first server computer 1-1 receives the query switching tuple
  • the first server computer 1-1 starts processing subsequent tuples with a rewrite query.
  • the second server computer 1-2 activates the rewrite query, waits until a query switching tuple is received, and executes stream data processing with the rewrite query for the tuples subsequent to the query switching tuple.
  • the scale-out process can be dynamically executed by selecting the scale-out target query by the server computer 1-2.
  • FIG. 24 and 25 are sequence diagrams showing a modification of the third embodiment and showing an example of scale-out processing performed in the computer system.
  • FIG. 24 is the first half of a sequence diagram showing an example of the scale-out process performed in the computer system.
  • FIG. 25 is the second half of the sequence diagram showing an example of the scale-out process performed in the computer system.
  • FIGS. 24 and 25 are obtained by changing the cold standby type processing of FIG. 23 to the warm standby type shown in FIG. 5 of the first embodiment.
  • Step S11 is the same as FIG. 5 shown in the first embodiment, and the operation management computer 3 generates a scale-out request.
  • step S13C the operation management computer 3 transmits a scale-out command to the first server computer 1-1, the second server computer 1-2, and the stream transmission / reception computer 2 to be scaled out.
  • the second server computer 1-2 is the server computer 1 set in advance as a standby system.
  • step S14 when the stream transmission / reception computer 2 receives the scale-out command, the stream transmission / reception computer 2 starts buffering the stream data transmitted to the first server computer 1-1, and returns to the first server computer 1-1. The transmission of the stream data is temporarily stopped.
  • Steps S53 to S61 are the same as in FIG. 23, and the query management unit 140 of the first server computer 1-1 and the second server computer 1-2 selects a query to be scaled out and generates a rewrite query. , To complete the rewrite query expansion.
  • the query processing unit 120 of the first server computer 1-1 reads the current query window state (S70).
  • the query processing unit 120 notifies the command receiving unit 130 of the read window information.
  • the command receiving unit 130 transmits a window duplication command to the command receiving unit 130 of the second server computer 1-2 (S71).
  • Steps S70 to S76 are the same as steps S22 to S28 shown in FIG. 5 of the first embodiment, and the instruction accepting unit 130 of the second server computer 1-2 receives from the first server computer 1-1.
  • the data in the window is transmitted to the query processing unit 120, and the contents of the window in the rewrite query are replaced with a copy of the window of the first server computer 1-1 to synchronize.
  • the first server computer 1-1 and the second server computer 1-2 are set with the same query (rewrite query) that differs only in the execution timing, and the query windows are in a synchronized state.
  • the instruction receiving unit 130 of the first server computer 1-1 outputs an instruction to switch the query being executed to the expanded rewrite query to the query processing unit 120 (S77).
  • the query processing unit 120 stops the query being executed and switches to the expanded rewrite query (S78).
  • the command receiving unit 130 of the first server computer 1-1 notifies the operation management computer 3 that the preparation for executing the rewrite query is completed (S79).
  • the operation management computer 3 transmits to the stream transmission / reception computer 2 a command to add a destination of a new computer to be scaled out (S80).
  • the stream transmission / reception computer 2 adds transmission of stream data by adding the received destination to the data transmission destination management table 202 (S81). Then, the stream transmission / reception computer 2 cancels the buffering of the stream data, and transmits the stream data to the second server computer 1-2 in addition to the first server computer 1-1.
  • the server computer 1 can select a scale-out target query, and then perform dynamic scale-out using a warm standby method.
  • each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit.
  • each of the above-described configurations, functions, and the like may be realized by software by the processor interpreting and executing a program that realizes each function.
  • Information such as programs, tables, and files for realizing each function can be stored in a recording device such as a memory, a hard disk, and an SSD, or a recording medium such as an IC card, an SD card, and a DVD.
  • control lines and information lines indicate what is considered necessary for the explanation, and not all the control lines and information lines on the product are necessarily shown. Actually, it may be considered that almost all the components are connected to each other.
  • a computer scale-out method of adding a second computer that executes a query to a first computer that receives stream data from a data source and executes the query A management computer connected to the first computer and the second computer receives a scale-out request; A second step in which the management computer instructs the first computer and the second computer to scale out; A third step in which the first computer and the second computer respectively generate a rewrite query as a copy of the query in which the execution timing of the query is rewritten; A fourth step in which the first computer and the second computer switch to the rewrite query; A fifth step in which the first computer or the second computer notifies the management computer that the rewriting query is ready; The management computer transmits a command for adding the second computer as a transmission destination of the stream data to the data source, and transmits the same stream data to the first computer and the second computer. Steps, A computer scale-out method comprising:

Abstract

データソースからストリームデータを受信してクエリを実行する第1の計算機に、前記クエリを実行する第2の計算機を追加する計算機のスケールアウト方法であって、管理計算機が、スケールアウトの要求を受け付けて、前記クエリの実行タイミングを書き換えた前記クエリの複製として書換クエリを生成し、前記書換クエリを含むスケールアウトの指令を前記第1の計算機と第2の計算機に送信し、前記第1及び第2の計算機が、前記スケールアウトの指令を受け付けて前記書換クエリを抽出し、前記抽出した書換クエリに切り替え、前記管理計算機へ前記書換クエリの準備が完了したことを通知し、前記管理計算機が、前記データソースに前記ストリームデータの送信先として前記第2の計算機を追加させる指令を送信する。

Description

計算機のスケールアウト方法、計算機システム及び記憶媒体
 本発明は、ストリームデータを処理する計算機システムに関する。
 ストリームデータ処理では、タイムスタンプを付与したタプルによって実行順序を厳密に保証して、高いリアルタイム処理性能が要求される。ストリームデータ処理では、より高性能なリアルタイムデータに対する処理能力を獲得するために、スケーラブルな性能向上を実現する必要がある。
 スケーラブルなストリームデータ処理の一例として特許文献3が知られている。特許文献3では、現用系の計算機の入力ストリーム及び各ウィンドウクエリの内部状態を、ある時刻から待機系の計算機に複製し、前記時刻に基づいて現用系と待機系が同期したことを保証することで待機系を動的に追加する技術が開示されている。
 また、特許文献2には、クエリへのデータ流入量やウィンドウサイズ、またはCPUの利用率などから移動コストの低いクエリを抽出し、当該クエリを別のサーバへ動的に移動させる技術が開示されている。特許文献2は、クエリグラフの一部を他のサーバへ移動させることによるスケールアウトを実現する技術である。
 また、特許文献1には、スケーラブルな分散クラスタ型のストリーミングシステムで、コストモデルを用いてクエリの最適化を行い、分散システム上にクエリを配置する技術が開示されている。
米国特許出願公開第2013/0346390号明細書 米国特許第8190599号明細書 米国特許第8904225号明細書
 上記特許文献1は、静的なクエリの配置を最適化する技術であり、動的なスケールアウトを行うためには、最適化クエリの変更または再配置が必要となる、という問題があった。
 また、特許文献2では、クエリグラフの一部を他のノードへ移動させることで、処理負荷を他のノードに分散させるスケールアウトであって、処理負荷の高いクエリを複数のノードで並列実行することはできない、という問題があった。
 さらに、上記特許文献3では、動的に現用系のクエリを待機系に複製し、さらに、現用系と待機系とに入力するストリームを変更することで、動的なスケールアウトを実現することができる。
 しかしながら、上記特許文献3では、同一の入力ストリームを分割して現用系と待機系に分配することになる。このため、現用系と追加された待機系でのクエリが集計処理やソート処理のように連続した入力ストリームをウィンドウ処理するクエリの場合、各系で処理した結果ストリームを、他のノードで再加工(Aggregate)する必要が生じる。
 したがって、特許文献3では、入力ストリームの分割と配信の負荷が増大するだけではなく、再加工の負荷が加わることになり、計算機資源が不足する場合がある、という問題があった。
 そこで本発明は、上記問題点に鑑みてなされたものであり、ひとつの計算機で実行していたクエリを、動的に複数の計算機へ分散して実行することを目的とする。
 本発明は、データソースからストリームデータを受信してクエリを実行する第1の計算機に、前記クエリを実行する第2の計算機を追加する計算機のスケールアウト方法であって、前記第1の計算機と第2の計算機に接続された管理計算機が、スケールアウトの要求を受け付ける第1のステップと、前記管理計算機が、前記クエリの実行タイミングを書き換えた前記クエリの複製として書換クエリを生成する第2のステップと、前記管理計算機が、前記書換クエリを含むスケールアウトの指令を前記第1の計算機と第2の計算機に送信する第3のステップと、前記第1の計算機及び第2の計算機が、前記スケールアウトの指令を受け付けて前記書換クエリを抽出し、前記抽出した書換クエリに切り替える第4のステップと、前記第1の計算機または第2の計算機が、前記管理計算機へ前記書換クエリの準備が完了したことを通知する第5のステップと、前記管理計算機が、前記データソースに前記ストリームデータの送信先として前記第2の計算機を追加させる指令を送信し、前記第1の計算機と第2の計算機へ同一のストリームデータを送信させる第6のステップと、を含む。
 本発明によれば、計算機資源が不足するのを抑制しながら、ひとつの計算機で実行していたクエリを、動的に複数の計算機へ分散して実行することが可能となって、計算機の負荷を平準化させることが可能となる。
本発明の第1の実施例を示し、ストリームデータを処理する計算機システムの一例を示すブロック図である。 本発明の第1の実施例を示し、ストリーム送受信計算機の一例を示すブロック図である。 本発明の第1の実施例を示し、運用管理計算機の一例を示すブロック図である。 本発明の第1の実施例を示し、サーバ計算機の一例を示すブロック図である。 本発明の第1の実施例を示し、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。 本発明の第1の実施例を示し、データ送信先管理表の一例を示す図である。 本発明の第1の実施例を示し、書き換え後のデータ送信先管理表の一例を示す図である。 本発明の第1の実施例を示し、クエリ管理表の一例を示す図である。 本発明の第1の実施例を示し、クエリ変換テンプレートの一例を示す図である。 本発明の第1の実施例を示し、第1のサーバ計算機と第2のサーバ計算機で処理されるタプルと時間の関係を示す図である。 本発明の第1の実施例を示し、第1のサーバ計算機と第2のサーバ計算機で処理されるタプルと時間の関係を示す図である。 本発明の第1の実施例を示し、クエリ変換テンプレートの一例を示す図である。 本発明の第1の実施例を示し、第1のサーバ計算機と第2のサーバ計算機で処理されるタプルと時間の関係を示す図である。 本発明の第1の変形例を示し、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。 本発明の第2の実施例を示し、サーバ計算機の一例を示すブロック図である。 本発明の第2の実施例を示し、運用管理計算機の一例を示すブロック図である。 本発明の第2の実施例を示し、クエリ状態表の一例を示す図である。 本発明の第2の実施例を示し、サーバ状態表の一例を示す図である。 本発明の第2の実施例を示し、クラスタ状態表の一例を示す図である。 本発明の第2の実施例を示し、計算機システムで行われるスケールアウト処理の一例を示すフローチャートである。 本発明の第2の実施例を示し、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。 本発明の第3の実施例を示し、サーバ計算機の一例を示すブロック図である。 本発明の第3の変形例を示し、計算機システムで行われる処理の一例を示すシーケンス図である。 本発明の第3の変形例を示し、計算機システムで行われる処理の一例を示すシーケンス図の前半部である。 本発明の第3の変形例を示し、計算機システムで行われる処理の一例を示すシーケンス図の後半部である。
 以下、本発明の一実施形態について添付図面を用いて説明する。
 図1は、本発明の第1の実施例を示し、ストリームデータを処理する計算機システムの一例を示すブロック図である。計算機システムは、ストリームデータを転送する送受信計算機2と、ストリームデータを処理する第1のサーバ計算機1-1と、第2のサーバ計算機1-2と、運用管理計算機3と、ストリームデータ処理の結果を利用するユーザ端末6を含む。
 ストリーム送受信計算機2と、第1のサーバ計算機1-1と、第2のサーバ計算機1-2及びユーザ端末6は業務ネットワーク4を介して接続され、ストリーム送受信計算機2が第1のサーバ計算機1-1及び第2のサーバ計算機1-2へストリームデータを供給する。第1のサーバ計算機1-1及び第2のサーバ計算機1-2の演算結果は、業務ネットワーク4を介してユーザ端末6へ出力される。
 また、第1のサーバ計算機1-1及び第2のサーバ計算機1-2は管理ネットワーク5を介して運用管理計算機3とストリーム送受信計算機2に接続される。なお、本実施例では、第1のサーバ計算機1-1と第2のサーバ計算機1-2の総称を「-」以降の符号のないサーバ計算機1として表示する。また、本実施例では、2台のサーバ計算機1でストリームデータの処理を行う例を示すが、2台以上であればよい。
 ストリーム送受信計算機2は、図示しないストリームデータのソースに接続される。ストリーム送受信計算機2は、各種センサやICタグ等から取得した情報や、株価情報等の時々刻々と到来するデータであるストリームデータを、業務ネットワーク4を介してサーバ計算機1へ転送するストリームデータのソースとして機能する。なお、本実施例では、データソースをストリーム送受信計算機2として例を示すが、複数のセンサや計算機に接続された通信機器をデータソースとしてもよい。
 本実施例では、ストリームデータを識別する識別子としてストリームIDがストリームデータに付与されている。ストリームIDは、該ストリームデータが処理されるべきクエリを識別するためのものであり、ストリームIDは、予めユーザ等によって設定され、例えば、ストリームIDとして、S1、S2、及びS3等の文字列が割り当てられる。
 <ストリーム送受信計算機>
 図2は、ストリーム送受信計算機2の一例を示すブロック図である。ストリーム送受信計算機2は、主記憶装置21と、中央演算処理装置22と、通信インタフェース23と、を含む。
 主記憶装置21は、プログラムやデータを格納する装置で有あり、例えば、RAM(Random Access Memory)等で構成される。主記憶装置21には、ストリーム送信プログラム200がロードされて、中央演算処理装置22によって実行される。
 ストリーム送信プログラム200は、例えば、ストリーム送受信計算機2に入力されたストリームデータを宛先(サーバ計算機1)に送信するためのプログラムであって、データ送信部201と、データ送信先管理表202と、を含む。
 中央演算処理装置22は、例えば、CPU(Central Processing Unit)を含み、主記憶装置21に読み込まれた各種プログラムを実行する。本実施形態では、中央演算処理装置22は、図1に示すように、主記憶装置21に読み込まれたストリーム送信プログラム200を実行することになる。
 通信インタフェース23は、業務ネットワーク4と管理ネットワーク5にそれぞれ接続される。ストリーム送受信計算機2は、業務ネットワーク4を介してストリームデータソースと第1のサーバ計算機1-1との間、第2のサーバ計算機1-2との間で、それぞれデータ通信(情報通信)を行う。また、通信インタフェース23は、ストリーム送受信計算機2が、管理ネットワーク5を介して運用管理計算機3との間でデータ通信(情報通信)を行う際にも利用される。第1のサーバ計算機1-1または第2のサーバ計算機1-2との間のデータ通信においては、ストリーム送受信計算機2からストリームデータが第1のサーバ計算機1-1または第2のサーバ計算機1-2へそれぞれ送信される。
 また、ストリーム送受信計算機2と運用管理計算機3との間のデータ通信においては、所定のコマンドが運用管理計算機3からストリーム送受信計算機2へ送信される。該コマンドには、宛先(サーバ計算機)を変更(追加や削除)させるためのコマンド等が含まれる。
 本実施形態では、通信インタフェース23として、イーサネットが採用されているが、イーサネット以外にも、FDDI(光ファイバのインタフェース)や、シリアルインタフェースや、USB等を利用することが可能である。
 次に、ストリーム送受信計算機2の主記憶装置21にロードされたストリーム送信プログラム200について説明する。
 ストリーム送信プログラム200のデータ送信部201は、ストリーム送受信計算機2が受け付けたストリームデータを、通信インタフェース23から業務ネットワーク4を介して宛先となる第1のサーバ計算機1-1または第2のサーバ計算機1-2へ送信する。
 データ送信部201は、受信したストリームデータからストリームIDを取得して、ストリームIDに対応する宛先情報をデータ送信先管理表202から取得する。そして、データ送信部201は、抽出した宛先情報のサーバ計算機1に対しストリームデータを送信(転送)する。
 図6、図7は、データ送信先管理表202の一例を示す図である。なお、図7は、スケールアウト処理によって書き換え後のデータ送信先管理表202の一例を示す図である。データ送信先管理表202は、ストリームデータの識別子を格納するストリームID2021と、宛先のIPアドレス(宛先情報)を格納する宛先IP2022とをひとつのエントリに含む。
 図7のデータ送信先管理表202は、運用管理計算機3からのコマンドに応じて、ストリームID=S2に新たな送信先を追加した例を示す。データ送信部201は、データ送信先管理表202を書き換えた後は、ストリームID=S2のストリームデータを、2つのサーバ計算機1へそれぞれ送信する。
 <運用管理計算機>
 図3は、運用管理計算機3の一例を示すブロック図である。運用管理計算機3は、主記憶装置31と、中央演算処理装置32と、通信インタフェース33と、補助記憶装置34とを含む。主記憶装置31は、上述したストリーム送受信計算機2の主記憶装置21と同様に、プログラムやデータを格納するための装置であり、例えば、RAMが用いられる。主記憶装置31には、運用管理プログラム300とクエリ変換テンプレート310が搭載されている。
 運用管理プログラム300は、ストリームデータ処理を行うサーバ計算機1を追加するスケールアウトを実行する。本実施例のスケールアウトでは、現在稼働中のサーバ計算機(本実施例では、現用系となる第1のサーバ計算機1-1)で実行されているクエリを、新たに追加されるサーバ計算機(本実施例では、待機系となる第2のサーバ計算機1-2)でも実行させる。なお、第2のサーバ計算機1-2は、予め待機系として設定されたサーバ計算機1である。
 ここで、本実施例のスケールアウトは、現在実行中のサーバ計算機1のクエリを書き換えて、実行タイミングを変更したクエリを新たに追加したサーバ計算機1に配布し、同一のストリームデータにより複数のサーバ計算機1を並列的に実行させ、計算機の負荷を分散させる。なお、書き換え後のクエリの実行タイミングは、第1のサーバ計算機1-1と第2のサーバ計算機1-2が、交互にストリームデータの処理結果を出力するように設定される。
 なお、本実施例1では、運用管理計算機3がサーバ計算機1にスケールアウトの指令を出力する例を示すが、指令を出力する契機については管理者からの指示や、図示しない監視部などで所定の条件が成立したときなど、公知または周知の技術を用いることができる。所定の条件が成立したときにスケールアウトの指令を送出する例としては、運用管理プログラム300がクエリを実行中のサーバ計算機1の負荷を監視し、計算機の負荷が所定の閾値を超えたときに、スケールアウトの要求を出力すればよい。また、サーバ計算機1が複数のクエリを実行している場合には、スケールアウトの指令にスケールアウト対象のクエリを指定しても良い。
 運用管理プログラム300は、コマンド送信部301と、クエリ生成部302と、クエリ管理表303とを含む。運用管理プログラム300は、クエリ変換テンプレート310を用いて、スケールアウトする際にクエリの書き換えをサーバ計算機1に指令する。
 補助記憶装置34は、運用管理プログラム300やクエリ変換テンプレート310等のプログラムやデータを格納する不揮発性記憶媒体である。
 通信インタフェース33は、運用管理計算機3が業務ネットワーク4を介して第1のサーバ計算機1-1または第2のサーバ計算機1-2との間でデータ通信(情報通信)を行う。また、通信インタフェース33は、管理ネットワーク5を介してストリーム送受信計算機2とサーバ計算機1に接続され、スケールアウトの指令や追加したサーバ計算機1の情報などを送信する。
 中央演算処理装置32は、ストリーム送受信計算機2の中央演算処理装置22と同様であり、例えば、CPUを含んで主記憶装置31にロードされたプログラムを実行する。本実施形態では、中央演算処理装置32は、図3に示すように、主記憶装置31に読み込まれた運用管理プログラム300を実行する。
 運用管理プログラム300を構成するコマンド送信部301とクエリ生成部302の各機能部はプログラムとして主記憶装置31にロードされる。
 中央演算処理装置32は、各機能部のプログラムに従って処理することによって、所定の機能を提供する機能部として稼働する。例えば、中央演算処理装置32は、コマンド生成プログラムに従って処理することでコマンド送信部301として機能する。他のプログラムについても同様である。さらに、中央演算処理装置32は、各プログラムが実行する複数の処理のそれぞれの機能を提供する機能部としても稼働する。計算機及び計算機システムは、これらの機能部を含む装置及びシステムである。
 運用管理計算機3の各機能を実現するプログラム、テーブル等の情報は、補助記憶装置34や不揮発性半導体メモリ、ハードディスクドライブ、SSD(Solid State Drive)等の記憶デバイス、または、ICカード、SDカード、DVD等の計算機読み取り可能な非一時的データ記憶媒体に格納することができる。
 運用管理プログラム300は、サーバ計算機1を管理し、スケールアウトの要求を受け付けると、スケールアウト先とスケールアウトするクエリを決定し、サーバ計算機1やストリーム送受信計算機2に指令する。なお、運用管理プログラム300は、各サーバ計算機1で実行するクエリをクエリ管理表303で管理する。また、運用管理プログラム300は、サーバ計算機1を関して所定の条件が成立したときに、スケールアウトの要求を生成してもよい。
 運用管理プログラム300のコマンド送信部301は、スケールアウトの指令やスケールアウト先の追加指令を生成してサーバ計算機1やストリーム送受信計算機2に送信する。スケールアウトの指令には、クエリ生成部302が生成した書換クエリが含まれる。
 運用管理プログラム300のクエリ生成部302は、スケールアウトを実施するクエリに対応する書換クエリをクエリ変換テンプレート310から読み込んで、実行形式のクエリとして生成する。この書換クエリは、クエリ変換テンプレート310に予め設定された書換内容に基づいたクエリで、サーバ計算機1毎に実行タイミングが異なる同一処理のクエリを複数のサーバ計算機1に実行させるものである。
 図8は、クエリ管理表303の一例を示す図である。クエリ管理表303は、クエリの識別子を格納するクエリID3031と、クエリの内容を格納するクエリ文字列3032と、クエリで処理するストリームデータの識別子を格納する実行対象ストリームID3033と、クエリを実効するサーバ計算機1の情報を格納する対象ノード3034と、をひとつのエントリに含む。
 本実施例では、サーバ計算機1の情報としてIPアドレスを用いる例を示すが、サーバ計算機1を特定可能な情報であればよい。運用管理プログラム300は、クエリを実行するサーバ計算機1の追加、変更あるいは削除があったとき等にクエリ管理表303を更新する。図示の例では、第1のサーバ計算機1-1(192.168.0.2)で2つのクエリQ1、Q2が実行される例を示す。
 クエリ管理表303は、第1のサーバ計算機1-1が、例えばストリーム送受信計算機2から受信したストリームデータに応じて、処理対象とするクエリを特定するために使用されるものである。そのため、クエリ管理表303は、クエリの識別子記録欄、クエリ文字列記録、クエリの実行形式格納先記録、及びクエリの実行対象となるストリームID記録欄を含む。ここで、クエリの識別子とは、登録されたクエリを区別するために用いられる文字列のことを指し、以下では、該文字列を「クエリID」と表記してもよい。また、クエリの実行対象のストリームIDとは、該クエリが処理対象とするストリームデータを取得するに際して用いられるものである。
 図9は、書換クエリを生成するための変換ルールであるクエリ変換テンプレート310の一例を示す図である。クエリ変換テンプレート310は、クエリの識別子を格納するクエリID3101と、書換対象のクエリの内容を格納する元クエリ3102と、クエリで処理するストリームデータの識別子を格納する実行対象ストリームID3103と、クエリを実行するサーバ計算機1の情報を格納する対象ノード3104と、書き換え後のクエリの識別子を格納するクエリID3105と、書き換え後のクエリの内容を格納する書換クエリ3106と、をひとつのエントリに含む。
 図示の例では、第1のサーバ計算機1-1で実行する2つのクエリQ1、Q2を、サーバ計算機1-2(192.168.0.3)を加えてスケールアウトする例を示す。また、クエリ変換テンプレート310は、管理者などが運用管理計算機3に予め設定しておいたものである。
 例えば、クエリIDがQ1-1に示される書換クエリの場合、クエリを実行するサーバ計算機1における計算機の識別番号(サーバ計算機1-1ではn=1、サーバ計算機1-2ではn=2)を表す変数nを用いた書換クエリが記載されている。このテンプレートにより、書換クエリは、サーバ計算機1-1上で奇数秒(2n+1秒)に実行される。
 なお、本実施例では、クエリ変換テンプレート310を運用管理計算機3に保持する例を示すが、サーバ計算機1のそれぞれに保持させてもよい。また、クエリ変換テンプレートは、変換対象となるクエリの一部のみについてテンプレートを記載する方法や、それらのテンプレートを一つ以上組合せて適用する方法でもよい。
 <サーバ計算機>
 図4は、第1のサーバ計算機1-1の一例を示すブロック図である。なお、第2のサーバ計算機1-2は第1のサーバ計算機1-1と同様の構成であるので、重複した説明は省略する。
 サーバ計算機1は、主記憶装置11と、中央演算処理装置12と、通信インタフェース13と、補助記憶装置14とを含む。主記憶装置11は、上述したストリーム送受信計算機2の主記憶装置21と同様に、プログラムやデータを格納するための装置であり、例えば、RAMが用いられる。主記憶装置11には、ストリームデータ処理プログラム100がロードされている。
 ストリームデータ処理プログラム100は、スケールアウトを実行する際に、クエリの切り替えと、追加されたサーバ計算機1との間でウィンドウ等の実行環境の同期を実施する。ストリームデータ処理プログラム100は、データ通信部110と、クエリ処理部120と、命令受付部130とを含む。なお、実行環境の同期については、後述するように、コールドスタンバイ式とウォームスタンバイ式がある。
 中央演算処理装置12は、ストリーム送受信計算機2の中央演算処理装置22と同様であり、例えば、CPUを含んで主記憶装置11にロードされたプログラムを実行する。本実施形態では、中央演算処理装置12は、図4で示すように、主記憶装置11に読み込まれたストリームデータ処理プログラム100を実行する。
 通信インタフェース13は、業務ネットワーク4と管理ネットワーク5にそれぞれ接続されて、ストリーム送受信計算機2からストリームデータを受信し、運用管理計算機3からスケールアウトなどのコマンドを受信する。
 補助記憶装置14は、ストリームデータ処理プログラム100等のプログラムやデータを格納する不揮発性記憶媒体で構成される。
 中央演算処理装置12は、各機能部のプログラムに従って処理することによって、所定の機能を提供する機能部として稼働する。例えば、中央演算処理装置12は、ストリームデータ処理プログラム100内のクエリ処理プログラムに従って処理することでクエリ処理部120として機能する。他のプログラムについても同様である。さらに、中央演算処理装置12は、各プログラムが実行する複数の処理のそれぞれの機能を提供する機能部としても稼働する。計算機及び計算機システムは、これらの機能部を含む装置及びシステムである。
 サーバ計算機1の各機能を実現するプログラム、テーブル等の情報は、補助記憶装置14や不揮発性半導体メモリ、ハードディスクドライブ、SSD等の記憶デバイス、または、ICカード、SDカード、DVD等の計算機読み取り可能な非一時的データ記憶媒体に格納することができる。
 ストリームデータ処理プログラム100は、データ通信部110と、クエリ処理部120と、命令受付部130とを含む。
 ストリームデータ処理プログラム100において、データ通信部110は、通信インタフェース13及び業務ネットワーク4を介してストリーム送受信計算機2から第1のサーバ計算機1-1へ送信されるストリームデータを受信し、受信したストリームデータを、クエリ処理部55に出力する機能を有する。
 クエリ処理部120は、入力部121と、演算処理実行部122と、ワークエリア123と、出力部124と、を含む。
 クエリ処理部120は、登録されたクエリに応じて、ストリームデータ処理を実行する。なお、本実施例では、第1のサーバ計算機1-1は、運用管理計算機3等によって予め設定されたクエリを実行する例を示す。
 クエリ処理部120において、入力部121は、データ通信部110から出力されるストリームデータを入力し、該入力したストリームデータを、演算処理実行部122に出力する。ワークエリア123は、演算処理実行部122から出力された処理対象のストリームデータを保存し、演算処理実行部122からのデータ読出し要求に応じて保存されているストリームデータを演算処理実行部122へ出力する。
 演算処理実行部122は、入力部121から与えられたストリームデータを読み込んで、予め設定されたクエリによってストリームデータ処理を実行する。演算処理実行部122におけるストリームデータ処理では、例えば、スライディングウィンドウにより過去に入力されたストリームデータを利用してクエリが実行される。このため、演算処理実行部122は、演算処理の対象にするストリームデータ(タプル)を、ワークエリア123へ格納する。
 ここで、スライディングウィンドウとは、クエリの中に設定されている演算処理の対象になるストリームデータを一時的に保存するためのデータ蓄積部のことを指す。スライディングウィンドウによって切り取られたストリームデータは、例えばサーバ計算機1-1の主記憶装置11等に格納され、演算処理実行部122がクエリを実行する際に使用される。なお、スライディングウィンドウの指定を含むクエリの記述言語に係わる好適な一例としては、上述した特許文献2等に記載されているCQL(Continuous Query Language)を挙げることができる。
 クエリには、時間で処理対象とするストリームデータの範囲を指定するクエリと、処理対象となるストリームデータの個数で処理対象とするストリームデータの範囲を指定するクエリとが存在する。以後、クエリ記述言語によって記述された文字列を、「クエリ文字列」と表記し、時間で処理対象とするストリームデータの範囲を指定するクエリを、「時間ベースのクエリ」と表記し、処理対象となるストリームデータの個数で処理対象とするストリームデータの範囲を指定するクエリを、「個数ベースのクエリ」と表記する。
 演算処理実行部122において実行されるクエリが、時間ベースのクエリである場合には、演算処理実行部122は、入力部121を介してデータ通信部110から入力されたストリームデータを、ワークエリア123へ保存する。そして、演算処理実行部122は、ワークエリア123に保存されているストリームデータのうちで保存時間を経過したストリームデータについては、ワークエリア123から削除する。
 上記クエリが、個数ベースのクエリである場合にも、演算処理実行部122は、入力されたストリームデータを、ワークエリア123へ保存する。しかし、ワークエリア123に保存されているストリームデータの個数が、所定の保存個数を超えた場合には、例えば、ワークエリア123における保存時間の長いストリームデータから順に、演算処理実行部122がワークエリア123から削除する。
 出力部124は、演算処理実行部122によるクエリの実行結果を、データ通信部110及び通信インタフェース13を介 して外部へ出力する。
 なお、以下の記述では、ワークエリア123を、「ウィンドウ」と表記し、ワークエリア123に保存(格納)されているデータ(ストリームデータ)を、「ウィンドウデータ」と表記し、ワークエリア123におけるストリームデータの保存時間、又は保存個数を、「ウィンドウサイズ」と表記してもよい。
 命令受付部130は、運用管理計算機3やスケールアウトの際のクラスタ内などから命令を受付ける。命令受付部130に与えられる命令としては、例えば、スケールアウトの指令や、クエリ登録命令あるいはクエリ削除命令が挙げられる。クエリ登録命令とは、ストリームデータ処理プログラム100に入力するデータ(ストリームデータ)を、第1のサーバ計算機1-1に順次処理させるためのクエリを、クエリ処理部120に登録させるための命令である。
 <スケールアウト処理>
 図5は、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。この処理は、運用管理計算機3がスケールアウトの要求を受け付けたときに実行される。運用管理計算機3は、上述したように、所定の条件が成立したときや管理者からの指示などのスケールアウトの要求に基づいて、サーバ計算機1へスケールアウトの指令を出力する。なお、図示の例では、待機系の第2のサーバ計算機1-2を、第1のサーバ計算機1-1のクエリを実行するクラスタへ追加する例を示す。
 運用管理計算機3の 運用管理プログラム300のコマンド送信部301は、所定の条件の成立や管理者からの指示によってスケールアウトの要求を受け付ける(S11)。運用管理計算機3は、スケールアウトの対象となるクエリIDを取得して、図5に示したクエリ変換テンプレート310から対象ノード3104と、クエリID3105と書換クエリ3106を取得する(S12)。
 図5の例では、第1のサーバ計算機1-1(192.168.0.2)のクエリID=Q1を、クエリ変換テンプレート310でクエリID=Q1-1とQ1-2の2つの書換クエリを生成し、クエリID=Q1-2を第2のサーバ計算機1-2(192.168.0.3)へスケールアウトする例を示す。
 また、第1のサーバ計算機1-1のクエリID=Q2を、クエリ変換テンプレート310でクエリID=Q2-1とQ2-2の2つの書換クエリを生成し、クエリID=Q2-2を第2のサーバ計算機1-2へスケールアウトする。なお、図5の例では、第1のサーバ計算機1-1のクエリID=Q1をQ1-1にリネームし、クエリID=Q2はQ2-1にリネームする。
 本実施例1では、第1のサーバ計算機1-1の書換クエリQ1-1は、第1のサーバ計算機1-1で現在実行中のクエリQ1と切り替えるクエリを示し、第2のサーバ計算機1-2の書換クエリQ1-2は、第2のサーバ計算機1-2で新たに起動させるクエリとなる。なお、第1のサーバ計算機1-1の書換クエリQ2-1も、第1のサーバ計算機1で現在実行中のクエリQ2と切り替えるクエリを示し、第2のサーバ計算機1-2の書換クエリQ2-2は、第2のサーバ計算機1-2で新たに起動させるクエリとなる。
 運用管理プログラム300のコマンド送信部301は、取得した書換クエリ3106を対象ノード3104及びストリーム送受信計算機2に対してスケールアウトの指令に含めて送信する(S13)。図5の例では、同一の処理を行うクエリの実行タイミングを対象ノード3104毎に書き換えて、2つのサーバ計算機1で並列的にストリームデータ処理を実行する。
 ストリーム送受信計算機2は、スケールアウトの指令を受信すると、第1のサーバ計算機1-1へ送信していたストリームデータのバッファリングを開始して、第1のサーバ計算機1-1へのストリームデータの送信を一時的に停止する(S14)。
 第1のサーバ計算機1-1は、運用管理計算機3からのスケールアウトの指令を命令受付部130で受信する。命令受付部130は、スケールアウトの指令に含まれる書換クエリQ1-1、Q2-1を抽出してクエリ処理部120へ送信する(S15)。
 第1のサーバ計算機1-1のクエリ処理部120は、受信した書換クエリQ1-1、Q2-1を展開して実行しているクエリQ1,Q2を書き換える準備を行う(S16)。そして、クエリ処理部120は、命令受付部130へ書換の準備が完了したことをストリーム送受信計算機2へ通知する(S17)。
 第2のサーバ計算機1-2は、運用管理計算機3からのスケールアウトの指令を命令受付部130で受信する。命令受付部130は、スケールアウトの指令に含まれる書換クエリQ1-2、Q2-2を抽出してクエリ処理部120へ送信する(S18)。
 第2のサーバ計算機1-2のクエリ処理部120は、受信した書換クエリQ1-2、Q2-2を展開する(S19)。そして、クエリ処理部120は、命令受付部130へクエリの書換の準備が完了したことをストリーム送受信計算機2へ通知する(S20)。第2のサーバ計算機1-2の命令受付部130は、第1のサーバ計算機1-1の命令受付部130にクエリ書換の準備が完了したことを通知する(S21)。なお、第2のサーバ計算機1-2では、現在、クエリを実行していないので、書換クエリ3106を展開するだけでよい。
 次に、第1のサーバ計算機1-1では、クエリ処理部120がクエリQ1、Q2のウィンドウ内のデータを読み出してから(S22)、命令受付部130へウィンドウの内容を第2のサーバ計算機1-2の書換クエリのウィンドウへ複製する指示を送信する(S23)。このとき、クエリ処理部120はクエリQ1、Q2のウィンドウのデータを書換クエリQ1-1、Q2-1のウィンドウに書き込んで同期させる。
 第1のサーバ計算機1-1は、クエリ処理部120が読み出したクエリQ1、Q2のウィンドウ内のデータを、第2のサーバ計算機1-2の命令受付部130に複製する指示を送信する(S24)。
 第2のサーバ計算機1-2の命令受付部130は、ウィンドウの複製指示から第1のサーバ計算機1-1のクエリQ1、Q2のウィンドウ内のデータ複製を抽出し、クエリ処理部120へウィンドウの複製指示を送信する(S25)。第2のサーバ計算機1-2のクエリ処理部120は、受信したウィンドウの複製の指示から第1のサーバ計算機1-1のクエリQ1、Q2のウィンドウの内容(複製)を第2のサーバ計算機1-2の書換クエリQ1-2、Q2-2で定義されたウィンドウに書き込む(S26)。これにより、第1のサーバ計算機1-1と第2のサーバ計算機1-2の書換クエリ内のウィンドウの内容が同期する。
 第2のサーバ計算機1-2のクエリ処理部120は、ウィンドウの複製が完了した通知を命令受付部130へ通知する(S27)。第2のサーバ計算機1-2の命令受付部130は、ウィンドウの複製が完了した通知を第1のサーバ計算機1-1の命令受付部130に通知する(S28)。
 上記処理により、第1のサーバ計算機1-1と第2のサーバ計算機1-2は、実行タイミングのみが異なる同じ処理内容のクエリ(書換クエリ)が設定され、また、書換クエリのウィンドウは同期した状態となる。第1のサーバ計算機1-1の命令受付部130は、クエリ処理部120に対して、実行中のクエリを、展開しておいた書換クエリに切り替える指示を出力する(S29)。クエリ処理部120は、実行中のクエリを停止して、展開しておいた書換クエリに切り替える(S30)。なお、第2のサーバ計算機1-2では、この時点までに書換クエリの実行を開始させておけばよい。
 次に、第1のサーバ計算機1-1の命令受付部130は、運用管理計算機3に対して書換クエリの実行準備が完了したことを通知する(S31)。運用管理計算機3は、スケールアウトの対象となる新たな計算機の宛先を追加する指令を、ストリーム送受信計算機2に送信する(S32)。
 ストリーム送受信計算機2は、受信した宛先をデータ送信先管理表202に加えることで、ストリームデータの送信先を追加する(S33)。なお、運用管理計算機3は、スケールアウトを実施するクエリが扱うストリームデータについて新たな宛先を通知すればよい。すなわち、ストリーム送受信計算機2は、ストリームID=S2について第2のサーバ計算機1-2(192.168.0.3)の追加指令を受け付けると、図7に示すように、データ送信先管理表202の宛先IP2022に新たなエントリを加える。
 また、ストリーム送受信計算機2は、ストリームデータのバッファリングを解除して、第1のサーバ計算機1-1に加えて第2のサーバ計算機1-2にもストリームデータ(S1)の送信を実施する。
 以上の処理により、運用管理計算機3がスケールアウトの指令を出力すると、ストリーム送受信計算機2は、ストリームデータのバッファリングによって送信を一時的に中止する。そして、第1のサーバ計算機1-1と第2のサーバ計算機1-2は、書換クエリの展開と、クエリのウィンドウの状態の同期を実施する。ウィンドウの同期が完了すると第1のサーバ計算機1-1は、現在実行中のクエリを展開しておいた書換クエリに切り替える。そして、第1のサーバ計算機1-1は、運用管理計算機3へ書換クエリの準備が完了したことを通知し、運用管理計算機3は新たな計算機(第2のサーバ計算機1-2)をストリームデータの送信先に加えるようストリーム送受信計算機2に指令する。そして、ストリーム送受信計算機2は、新たな計算機を送信先に追加してから、バッファリングを停止してストリームデータの送信を再開する。
 上記図5に示した処理は、ウォームスタンバイ式と呼ぶ。ウォームスタンバイ式では、以上のように運用管理計算機3が書換クエリを生成して、スケールアウト対象のサーバ計算機1へ送信する。また、運用管理計算機3からの指令に基づいてストリーム送受信計算機2は第1のサーバ計算機1-1へのストリームデータの送信を中断する。
 そして、第1のサーバ計算機1-1がウィンドウの内容を複製し、追加する第2のサーバ計算機1-2に送信し、ウィンドウ内のデータを同期させる。同期が完了した後には、第1のサーバ計算機1-1は実行するクエリを書換クエリに切り替える。その後、運用管理計算機3はストリーム送受信計算機2にストリームデータの送信を再開させることで、ウォームスタンバイによる動的なスケールアウトが完了する。これにより、同一のストリームデータを使用しながら動的にスケールアウトを実施することが可能となる。
 なお、ストリーム送受信計算機2で実施するストリームデータのバッファリング開始の時期は、書換準備完了が第1のサーバ計算機1-1と第2のサーバ計算機1-2で保証されたタイミング(S21)まで遅延させることが可能である。
 また、上記図5のウォームスタンバイ式では、ここでは静止化(ストリームデータの一時停止)をしてからウィンドウの複製を行ったが、これに限定されるものではない。スケールアウト対象の複数のサーバ計算機1間で最終的にウィンドウ内のデータが同期できれば、ストリームデータの送信を一時停止せずに複製処理を行い(更新されたウィンドウ処理はそのつどコピー)、所定量以上のコピーが終わってからストリーム送受信計算機2からのストリームデータを静止化してもよい。この場合、ストリーム送受信計算機2にバッファリングされる時間を短縮することで、サーバ計算機1で行われるクエリ処理の停止時間を短縮することができる。
 図10は、第1のサーバ計算機1-1と第2のサーバ計算機1-2で処理されるタプルと時間の関係を示す図である。図中丸印がタプルを示し、図中実線がストリームデータ処理の結果を出力したタプルを示し、図中破線がストリームデータ処理の結果を出力しないタプルを示す。
 図10の例は、図9のクエリID=Q1を書き換えたクエリID=Q1-1、Q1-2の例を示す。クエリID=Q1は、ウィンドウサイズが1分間のウィンドウで平均値を演算するクエリで、書き換え後のクエリID=Q1-1は、奇数秒毎に1分間のウィンドウで平均値を演算し、クエリID=Q1-2は、偶数秒毎に1分間のウィンドウで平均値を演算する。
 すなわち、第1のサーバ計算機1-1と第2のサーバ計算機1-2は、同一の入力タプルでストリームデータ処理を実施し、1秒毎に交互にストリームデータ処理の演算結果を出力する。ストリームデータ処理の結果を利用するユーザ端末6では、第1のサーバ計算機1-1と第2のサーバ計算機1-2のストリームデータの演算結果をタプルの時系列で利用することができるので、前記従来例のように集約演算等を行う必要は無い。
 また、入力タプルとしてストリームデータを送信するストリーム送受信計算機2は、前記従来例のようにタプルを取捨選択あるいは分割する必要が無いので、分散処理に関する負荷を抑制することができる。
 なお、第1及び第2のサーバ計算機1-1、1-2には同じタプルが入力されるが、実行タイミングが異なる同じ処理内容のクエリからの出力は交互に行われるため、ストリームデータ処理の結果は交互に出力される。なお、本実施例では、クエリの実行を交互に行う例を示すが、これに限定されるものではない。例えば、時刻=1秒の時点で、第1及び第2のサーバ計算機1-1、1-2が共にタプル1、2、3の演算を実行し、第1のサーバ計算機1-1のみがストリームデータの処理結果を出力するようにしてもよい。すなわち、複数のサーバ計算機1で同一のタプルの演算を実行し、ストリームデータの処理結果の出力を交互などの所定の順序で許可するようにすればよい。換言すれば、複数のサーバ計算機1で同一のタプルの演算を行うが、許可されたサーバ計算機1のみがストリームデータの処理結果を出力し、他のサーバ計算機1ではストリームデータの処理結果の出力が禁止(またはスキップ)される。なお、他のサーバ計算機1ではストリームデータの処理を禁止またはスキップしてもよい。
 図11は、第1のサーバ計算機1-1と第2のサーバ計算機1-2で処理されるタプルと時間の関係を示す図である。図中丸印がタプルを示し、図中実線がストリームデータ処理の結果を出力したタプルを示し、図中破線がストリームデータ処理の結果を出力しないタプルを示す。
 図11の例は、図9のクエリID=Q2を書き換えたクエリID=Q2-1、Q2-2の例を示す。クエリID=Q2は、ウィンドウサイズが3個のウィンドウの平均値を演算するクエリで、クエリID=Q2-1とQ2-2は、ウィンドウの演算を3回ずつ交互に実行する。
 第1のサーバ計算機1-1と第2のサーバ計算機1-2は、同一の入力タプルでストリームデータ処理を実施し、ウィンドウの演算結果を3回ずつ交互に出力する。
 ストリームデータ処理の結果を利用するユーザ端末6では、第1のサーバ計算機1-1と第2のサーバ計算機1-2のストリームデータの演算結果をタプルの時系列で利用することができるので、前記従来例のように集約演算等を行う必要は無い。したがって、計算機資源が不足するのを抑制することができる。
 また、ストリームデータを送信するストリーム送受信計算機2は、前記従来例のようにストリームデータを分割する必要がないので、計算機資源が不足するのを抑制することができる。
 図12は、クエリ変換テンプレート310の一例を示す図である。図12のクエリ変換テンプレート310は、前記図9のクエリID=Q2を書き換えたクエリID3105=Q2-1とQ2-2の変形例を示す。図12においては、第1のサーバ計算機1-1と第2のサーバ計算機1-2が、交互にウィンドウの演算を行う例を示す。
 図13は、第1のサーバ計算機1-1と第2のサーバ計算機1-2で処理されるタプルと時間の関係を示す図である。図中丸印がタプルを示し、図中実線がストリームデータ処理の結果を出力したタプルを示し、図中破線がストリームデータ処理の結果を出力しないタプルを示す。
 図13の例は、図12に示したクエリID=Q2を書き換えたクエリID=Q2-1、Q2-2の例を示す。書き換え後のクエリID=Q2-1は、奇数回毎に3個のウィンドウで平均値を演算し、クエリID=Q2-2は、偶数回毎に3個のウィンドウで平均値を演算する。
 図14は、上記実施例1の変形例を示し、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。
 ステップS11、S12、前記図5と同様であり、運用管理計算機3がスケールアウトの要求を生成し、クエリ変換テンプレート310から書換クエリQ1-1、Q1-2、Q2-1、Q2-2を生成する。そして、ステップS13Aでは、運用管理計算機3が書換クエリを含むスケールアウトの指令をスケールアウト対象のサーバ計算機1に送信する。
 本変形例では図5と異なり、ストリーム送受信計算機2はストリームデータの送信を中断せず、第1のサーバ計算機1-1へストリームデータの送信を継続する。
 次に、ステップS15~S21では、スケールアウト対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2が、スケールアウトの指令に含まれる書換クエリを、命令受付部130からクエリ処理部120へ送信し、各サーバ計算機1で書換クエリを展開しておく。
 本変形例では図5と異なり、ストリーム送受信計算機2はストリームデータの送信を中断せず、第1のサーバ計算機1-1へストリームデータの送信を継続する。また、本変形例のサーバ計算機1は、前記図5と異なり、第1のサーバ計算機1-1の命令受付部130は、ウィンドウの複製を行わない。本変形例では、ウィンドウ内の複製に代わって、ストリーム送受信計算機2からストリームデータの送信を継続することで、書換クエリQ1-1~Q2-2のウィンドウ内にデータを満たすことで第1のサーバ計算機1-1と第2のサーバ計算機1-2の書換クエリのウィンドウを同期させる。
 次に、ステップS41では、スケールアウトの対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2が、展開が完了して書換クエリの準備ができたことをそれぞれ運用管理計算機3へ通知する。
 運用管理計算機3は、スケールアウトの対象となる新たな計算機の宛先を追加する指令を、ストリーム送受信計算機2に送信する(S42)。ストリーム送受信計算機2は、前記図5と同様に、受信した宛先をデータ送信先管理表202に追加することでストリームデータの送信先を追加する(S43)。
 次に、本変形例では、第1のサーバ計算機1-1と第2のサーバ計算機1-2に書換クエリによる処理を開始するタイミングを指示するために、ストリーム送受信計算機2がストリームデータにクエリ切替タプルを挿入する(S44)。なお、クエリ切替タプルは、予め設定されたデータを含むタプルである。
 次に、ストリーム送受信計算機2は、スケールアウト対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2に、実行するクエリを切り替える切替指令を送信する(S45)。新たに追加された第2のサーバ計算機1-2のクエリ処理部120は、クエリ内のウィンドウがタプルで満たされているか否かを判定することで、第1及び第2のサーバ計算機1のウィンドウが同期したことを検出する(S46)と、第2のサーバ計算機1-2は、切り替えの準備が完了した通知をストリーム送受信計算機2へ送信する(S47)。
 ストリーム送受信計算機2は、切り替えの準備が完了した通知を受信すると、クエリの切り替えを各サーバ計算機1へ指令する(S48)。
 そして、第1のサーバ計算機1-1と第2のサーバ計算機1-2は、展開しておいた書換クエリに処理を切り替える(S49)。なお、第1のサーバ計算機1-1では、クエリ切替タプルを受信すると、以降のタプルを書換クエリにて処理を開始する。また、第2のサーバ計算機1-2では、書換クエリを起動した後、クエリ切替タプルを受信するまで待機し、クエリ切替タプル以降のタプルについて書換クエリでストリームデータ処理を実行する。
 以上のように、本変形例では、ストリーム送受信計算機2がストリームデータの送信を中断することなく、各サーバ計算機1で書き換えるクエリを先に準備しておく。そして、各サーバ計算機1では、書換クエリ内のウィンドウにタプルを充足することで、スケールアウト対象の複数のサーバ計算機1の書換クエリの実行環境を同期させておき、その後、実行するクエリを切り替えることで動的にスケールアウトを実施することがきる。
 上記図14に示した処理は、コールドスタンバイ式と呼ぶ。コールドスタンバイ式では、以上のように運用管理計算機3が書換クエリを生成して、スケールアウト対象のサーバ計算機1へ送信する。そして、サーバ計算機1では書換クエリを展開してからストリームデータを書換クエリ内のウィンドウへ入力し、ウィンドウを充足することで、スケールアウト対象のサーバ計算機1間でウィンドウを同期させる。その後、スケールアウト対象のサーバ計算機1で実行するクエリを切り替えることで、コールドスタンバイ式による動的なスケールアウトを行うことができる。
 なお、上記実施例1では、運用管理計算機3は実行タイミングが異なる同一処理内容のクエリを新たなサーバ計算機1に配布して、スケールアウトを行うことで、サーバ計算機1の負荷の平準化や、サーバ計算機1に接続されたネットワーク帯域の平準化を図ることが可能である。また、本実施例1では、複数のサーバ計算機1のクエリの実行タイミングが交互であるため、ストリームデータの処理能力が向上しない場合が生じる。
 また、上記実施例1では、2つのサーバ計算機1でスケールアウトを実施する例を示したが、3つ以上のサーバ計算機1でスケールアウトを実施してもよく、サーバ計算機1の数が増えるに連れて、ひとつのサーバ計算機1がクエリの処理(出力)をスキップする間隔または回数は増大することになる。
 また、上記実施例1では、クエリ変換テンプレート310に予め書換クエリを設定しておく例を示したが、運用管理計算機3は、スケールアウト先のサーバ計算機1の数に応じて、ひとつのサーバ計算機1が書換クエリを実行(または結果を出力)する間隔を変更してもよい。
 なお、上記実施例1では、運用管理計算機3は、図1において独立した計算機とした例を示したが、第1のサーバ計算機1-1または第2のサーバ計算機1-2の何れかに含めるようにしてもよい。また、上記実施例1では。ユーザ端末6がストリームデータ処理の結果を利用する例を示したが、これに限定されるものではない。例えば、第1のサーバ計算機1-1及び第2のサーバ計算機1-2の処理結果を、次のストリーム処理計算機群で処理するようにしてもよい。
 前記実施例1では、第1のサーバ計算機1-1で稼働中のクエリを第2のサーバ計算機1-2へスケールアウトする例を示したが、本実施例2では、クエリを選択してスケールアウトを実施する例を示す。なお、スケールアウトの契機は前記実施例1と同様であり、運用管理計算機3で所定の条件が成立したときや、運用管理計算機3の管理者などがスケールアウトを指令したときである。また、スケールアウト対象のサーバ計算機1は、前記実施例1と同様であり、現用系となる第1のサーバ計算機1-1のクエリを、待機系となる第2のサーバ計算機1-2へスケールアウトする。
 図15、図16は、本発明の第2の実施例のサーバ計算機1と運用管理計算機3の一例を示すブロック図である。図1の計算機システムのうち、第1のサーバ計算機1-1と第2のサーバ計算機1-2を、図15のサーバ計算機1-1に置き換え、また、図1の運用管理計算機3を図16の運用管理計算機3に置き換えるものとする。その他の構成は、前記実施例1と同様である。
 図15は、実施例2の第1のサーバ計算機1-1であり、実施例1と同様に第2のサーバ計算機1-2も同様の構成である。第1のサーバ計算機1-1は、図4に示した実施例1の構成に、クエリ管理部140と、サーバ状態表180と、クエリ管理表190と、クエリ状態表195を加えたものである。その他の構成は、前記実施例1と同様である。
 クエリ管理部140は、ストリームデータ処理プログラム100のクエリ処理部120において実行されるクエリの登録または削除を行う機能と、クエリ文字列(クエリの内容をユーザが理解可能なように、例えばソースコード等により表現されている)からクエリの実行形式(例えば、機械語、マシンが読んで分かる表現形式)を生成する機能と、を有する。
 クエリ管理部140において、上記クエリ文字列から該クエリの実行形式を生成する手法については、本願出願においては、特に限定するものではなく、公知または周知の手法を用いることができる。
 クエリ管理部140において、クエリ解析部150は、上述したクエリ文字列を解析する機能を有する。即ち、クエリ解析部150は、クエリの登録に際して命令受付部130から与えられるクエリ文字列を解析し、解析結果を、演算処理実行部160に与える。また、クエリ解析部150は、スケールアウトの対象となるクエリを選択するクエリ選定部151を含む。なお、クエリ選定部151によるクエリの選択は、CPUの利用率やネットワークの利用帯域と予め設定した閾値などに基づいて実施する。
 演算処理実行部160は、クエリ解析部150から与えられるクエリの解析結果を受けて、該解析結果からより効率の良いクエリの実行形式を選択する(即ち、最適化処理を行う)ように機能する。クエリ生成部170は、演算処理実行部160において選択されたクエリの実行形式を生成する。
 クエリ管理部140は、サーバ状態表180と、クエリ管理表190と、クエリ状態表195を管理する。
 クエリ管理表190は、前記実施例1の図8に示した運用管理計算機3のクエリ管理表190と同様である。本実施例2では、サーバ計算機1毎に実行するクエリを管理する例を示す。
 図17は、クエリ状態表195の一例を示す図である。クエリ状態表195は、当該サーバ計算機1で稼働中のクエリの識別子を格納するクエリID1951と、クエリ毎のリソース使用量としてCPUの使用率を格納するCPU利用率1952と、クエリ毎のリソース使用量としてウィンドウで使用しているデータの量を格納するウィンドウ内データ量1953と、当該クエリが使用しているネットワークの利用帯域を格納するネットワーク帯域1954と、クエリのウィンドウサイズを格納するウィンドウのデータ範囲1955と、クエリの処理量を示すデータの入力頻度(個/秒)を格納するデータ入力頻度1956と、当該クエリに予め設定された遅延時間の許容値を格納する遅延許容時間1957と、を含む。
 クエリ管理部140は、所定の周期で各クエリの稼働状態を監視し、当該監視結果でクエリ状態表195を更新する。ここで、データ入力頻度とは、クエリの処理対象とするストリームデータが、単位時間当たりにサーバ計算機1に入力された個数を表し、クエリの処理量を示す値となる。
 図18は、サーバ状態表180の一例を示す図である。サーバ状態表180は、図17のクエリ状態表195に、当該サーバ計算機1の識別子を格納するサーバID1801を付加したものである。サーバ状態表180は、所定のタイミングで運用管理計算機3へ送信される。
 図16は、実施例2の運用管理計算機3である。運用管理計算機3は、図3に示した実施例1のクエリ生成部302、クエリ管理表303に代わって、クエリ状態管理部320と、クラスタ状態管理部330と、クラスタ状態管理表340を有する。その他の構成は、前記実施例1と同様である。なお、クエリ状態管理部320と、クラスタ状態管理部330は、運用管理プログラム300を構成するプログラムとして中央演算処理装置32で実行される。
 運用管理プログラム300において、クラスタ状態管理部330は、全てのサーバ計算機1上のクエリの状態(即ち、各々のサーバ状態表180の内容)を収集する。クラスタ状態管理部330は、各サーバ計算機1(図1で示した例では、第1のサーバ計算機1-1と、第2のサーバ計算機1-2)のクエリ管理部140の管理下にあるサーバ状態表180の内容を収集して、クラスタ状態管理表340を生成する。
 図19は、クラスタ状態管理表340の一例を示す図である。クラスタ状態管理表340は、上記図18のサーバ状態表180をサーバ計算機1のサーバID毎に結合したものである。クラスタ状態管理表340は、サーバ状態表180の識別子をサーバ計算機1毎にサーバID3450に設定し、その他は、図17のクエリ状態表195と同様である。図示のクラスタ状態管理表340は、スケールアウト後の状態を示す。
 クエリ状態管理部320は、スケールアウトの際に、現在稼働中のサーバ計算機(図1で示した第1のサーバ計算機1-1)において処理が実行されるべき全てのクエリの中から、新たに追加されたサーバ計算機(図1で示した、第2のサーバ計算機1-2)に追加するクエリを選択する。
 すなわち、クエリ状態管理部320は、クエリを他のサーバ計算機1へ複製するコスト(複製コスト)を算出し、複製コストに基づいて、第1のサーバ計算機1-1から第2のサーバ計算機1-2へ複製するクエリを選択して実行させる。なお、複製コストは、現在稼働中の第1のサーバ計算機1-1から新たに追加された第2のサーバ計算機1-2へ、書換対象となるクエリが複製される時間(見込み)としてクエリ状態管理部320により算出される。複製コストの演算手法は、前記特許文献2に開示された移行コストと同様であるので、ここでは詳述しない。
 本実施例2の計算機システムで実施されるスケールアウト処理は、運用管理計算機3が全てのクエリに係わる情報を収集し、収集した情報の中から複製コストを算出し、該算出した複製コストを基に、現用系の第1のサーバ計算機1-1から待機系の第2のサーバ計算機1-2へのクエリの複製時間が短く、且つ、クラスタを組むサーバ計算機1の負荷が均等になるようなクエリを1つ以上選択する。
 そして、運用管理計算機3は、選択したクエリを、現用系の第1のサーバ計算機1-1から待機系の第2のサーバ計算機1-2へ複製して、実行タイミングを書き換える。なお、上記選択されたクエリを、現用系の第1のサーバ計算機1-1から待機系の第2のサーバ計算機1-2へ複製する際に、処理の遅延を発生させないようにするため、前記実施例1に示したウォームスタンバイ式ではなく、前記実施例1の変形例に示したコールドスタンバイ式によるクエリの複製処理が行われる。
 次に、上述したスケールアウト処理の具体的な手順について説明する。
 図20は、スケールアウト処理の一例を示すフローチャートである。この処理は、スケールアウトの契機となったときに運用管理計算機3で実行される。
 図20において、運用管理プログラム300を実行する運用管理計算機3が、各サーバ計算機1からサーバ状態表180を取得する(S101)。次に、運用管理計算機3は、取得したサーバ状態表180を結合してクラスタ状態管理表340を生成する(S102)。
 次に、運用管理計算機3は、現用系の第1のサーバ計算機1-1から待機系の第2のサーバ計算機1-2へ複製するスケールアウト処理の複製コストをクエリ毎に算出する(S103)。
 運用管理計算機3は、クエリ選択処理を実行する。クエリ選択処理の詳細については、前記特許文献2と同様であるので、ここでは詳述しない。クエリ選択処理により、例えば、クエリIDが「Q1」及び「Q2」のクエリがそれぞれスケールアウト対象のクエリとして選択される(ステップS104)。
 上記クエリ選択処理が完了すると、運用管理計算機3は、ステップS105~S107のループ処理によって、上記選択したクエリ毎にスケールアウト処理が実行される。
 以上の処理によって、スケールアウト作業が完了し、現用系の第1のサーバ計算機1-1と、待機系の第2のサーバ計算機1-2では、クエリQ1、Q2の処理が交互に実行され、ストリームデータ処理の結果がユーザ端末6へ出力される。
 上記クエリ選択処理では、待機系の第2のサーバ計算機1-2におけるCPU使用率と、リソース使用量目標値として予め設定された閾値との間に、
CPU使用率≧リソース使用量目標値
という関係が成立すると判定されるまで、複製時間の短いクエリの選択が繰り返される。
 本実施例においては、リソース使用量目標値を、例えば、50%として運用管理計算機3で上記複製クエリ選択処理を開始する。運用管理計算機3は、複製時間の最も短いクエリであるクエリQ2が、移行クエリとして選択する。これにより、現用系のサーバ計算機である第1のサーバ計算機1-1における合計CPU使用率は、80%になり、待機系の第2のサーバ計算機1-2における合計CPU使用率は、20%になる(図18、図19参照)。
 ここで、待機系の第2のサーバ計算機1-2における合計CPU使用率(20%)が、リソース使用量目標値である50%を超えていないため、運用管理計算機3は、再度、スケールアウト対象のクエリとして選択されていないクエリの中から、複製時間(見込み)が最も短いクエリをスケールアウト対象のクエリとして選択する。即ち、複製時間がクエリQ2の次に短いクエリQ1がスケールアウト対象のクエリとして選択される。上記処理の結果、第1のサーバ計算機1-1における合計CPU使用率と第2のサーバ計算機1-2における合計CPU使用率は、共に50%になる(図19参照)。
 運用管理計算機3は、第2のサーバ計算機1-2における合計CPU使用率がリソース使用量目標値である50%に達したので、スケールアウト対象のクエリ選択処理の処理を終了する。上記処理の結果として、第1のサーバ計算機1-1から第2のサーバ計算機1-2へスケールアウトされるクエリとして、クエリQ1及びクエリQ2が選択されたことになる。
 図21は、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。ステップS105~S107で行われるスケールアウト処理の詳細について以下に説明する。
 ステップS11は、前記実施例1に示した図5と同様であり、運用管理計算機3がスケールアウトの要求を生成する。そして、ステップS11Aでは、運用管理計算機3が上記図20のステップS104の処理によってスケールアウト対象のクエリを選択する。
 ステップS11は、前記実施例1に示した図5と同様であり、運用管理計算機3がクエリ変換テンプレート310を参照して書換クエリを生成する。そして、運用管理計算機3は、書換クエリを含むスケールアウトの指令をスケールアウト対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2に送信する。
 本実施例2では、以降の処理が前記変形例の図14と同様であり、ストリーム送受信計算機2はストリームデータの送信を中断せず、第1のサーバ計算機1-1へストリームデータの送信を継続する。
 本実施例2では、運用管理計算機3がスケールアウト対象のクエリを選択して書換クエリを生成し、スケールアウト対象のサーバ計算機1へ書換クエリを送信する。そして、ストリーム送受信計算機2がストリームデータの送信を継続し、各サーバ計算機1では、書換クエリ内のウィンドウにタプルを充足することで、スケールアウト対象の複数のサーバ計算機1間で書換クエリの実行環境を同期させておき、その後、実行するクエリを切り替えることで動的にスケールアウトを実施することがきる。
 前記実施例2では、運用管理計算機3でスケールアウト対象のクエリを選択する例を示したが、本実施例3では、スケールアウト対象のクエリをサーバ計算機1で選択する例を示す。なお、その他の構成については前記実施例2と同様である。
 図22は、本発明の第3の実施例を示し、サーバ計算機の一例を示すブロック図である。図示の例は第1のサーバ計算機1-1を示すが、第2のサーバ計算機1-2も同様の構成であるので、重複する説明は省略する。実施例3のサーバ計算機1は、主記憶装置11にクエリ変換テンプレート310Aと、クラスタ状態管理表340Aを加えた点が、前記実施例2との相違点である。その他の構成は、前記実施例2と同様である。クエリ変換テンプレート310Aは、運用管理計算機3が保持するクエリ変換テンプレート310の複製である。また、クラスタ状態管理表340Aは、運用管理計算機3が保持するクラスタ状態管理表340と同様の構成である。
 図23は、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。
 ステップS11は、前記実施例1に示した図5と同様であり、運用管理計算機3がスケールアウトの要求を生成する。次に、ステップS13Bでは、運用管理計算機3がスケールアウトの指令を、スケールアウト対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2に送信する。なお、第2のサーバ計算機1-2は、予め待機系として設定されたサーバ計算機1である。
 第1のサーバ計算機1-1の命令受付部130は、運用管理計算機3からのスケールアウト指令を受信すると、クエリ管理部140に対してクエリの書換の指示を送信する(S53)。
 書換の指示を受信したクエリ管理部140は、スケールアウト対象のクエリを選択する(S54)。スケールアウト対象のクエリの選択は、前記実施例2の図20に示したステップS101~S104と同様の処理をクエリ管理部140で実施する。すなわち、クエリ管理部140は、クラスタ状態管理表340Aを生成し、クラスタ状態管理表340Aから実行中のクエリについてスケールアウトのコストを算出する(S103)。そして、スケールアウトのコストの低い順にクエリを選択してリソース使用量目標値の条件を満たすか否かを判定し、リソース使用量目標値の条件を満たすクエリをスケールアウト対象のクエリとして選択する(S104)。
 次に、クエリ管理部140は、クエリ変換テンプレート310Aを参照して、選択されたクエリの実行タイミングを書き換えた書換クエリを生成する(S56)。クエリ管理部140は、生成した書換クエリをクエリ処理部120に送信する(S56)。クエリ処理部120は、受信した書換クエリを展開して新たなストリームデータ処理の準備を実施する(S57)。
 書換クエリの展開が完了すると、クエリ処理部120は命令受付部130へ書換クエリの準備が完了した通知を送信する(S58)。
 待機系の第2のサーバ計算機1-2においても、前記ステップS53~S58の処理が実行され、書換クエリが展開される。なお、図9で示したように、第2のサーバ計算機1-2は、クエリ変換テンプレート310Aの対象ノード3104が第1のサーバ計算機1-1に対して異なるので、実行タイミングの異なる書換クエリが生成される。
 第2のサーバ計算機1-2の命令受付部130は、書換クエリの準備が完了すると、第1のサーバ計算機1-1に書換クエリの準備が完了した通知を送信する(S60)。第1のサーバ計算機1-1の命令受付部130は、スケールアウト対象のサーバ計算機1で書換クエリの準備が完了したことを運用管理計算機3へ通知する(S61)。
 運用管理計算機3は、スケールアウトの対象となる新たな計算機の宛先を追加する指令を、ストリーム送受信計算機2に送信する(S62)。ストリーム送受信計算機2は、前記実施例1の図5と同様に、受信した宛先をデータ送信先管理表202に追加することで新たなストリームデータの送信先を追加する(S63)。
 次に、スケールアウト対象のサーバ計算機1に書換クエリを起動するタイミングを指示するため、ストリーム送受信計算機2はストリームデータにクエリ切替タプルを挿入する(S64)。
 次に、ストリーム送受信計算機2は、スケールアウト対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2に、実行するクエリを切り替える切替指令を送信する(S65)。
 第1のサーバ計算機1-1と第2のサーバ計算機1-2は、展開しておいた書換クエリに切り替えて、ストリームデータ処理を開始する(S66)。なお、第1のサーバ計算機1-1では、クエリ切替タプルを受信すると、以降のタプルを書換クエリにて処理を開始する。また、第2のサーバ計算機1-2では、書換クエリを起動した後、クエリ切替タプルを受信するまで待機し、クエリ切替タプル以降のタプルについて書換クエリでストリームデータ処理を実行する。
 以上のように、本実施例3においても、スケールアウト対象のクエリをサーバ計算機1-2で選択して、動的にスケールアウト処理を実行することができるのである。
 図24、図25は、第3の実施例の変形例を示し、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図である。なお、図24は、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図の前半部である。また、図25は、計算機システムで行われるスケールアウト処理の一例を示すシーケンス図の後半部である。
 図24、図25は、上記図23のコールドスタンバイ式の処理を、前記実施例1の図5に示したウォームスタンバイ式に変更したものである。
 ステップS11は、前記実施例1に示した図5と同様であり、運用管理計算機3がスケールアウトの要求を生成する。次に、ステップS13Cでは、運用管理計算機3がスケールアウトの指令を、スケールアウト対象の第1のサーバ計算機1-1と第2のサーバ計算機1-2及びストリーム送受信計算機2に送信する。なお、第2のサーバ計算機1-2は、予め待機系として設定されたサーバ計算機1である。
 ステップS14では、ストリーム送受信計算機2が、スケールアウトの指令を受信すると、第1のサーバ計算機1-1へ送信していたストリームデータのバッファリングを開始して、第1のサーバ計算機1-1へのストリームデータの送信を一時的に停止する。
 ステップS53~S61は上記図23と同様であり、第1のサーバ計算機1-1と第2のサーバ計算機1-2のクエリ管理部140がスケールアウト対象のクエリを選択して書換クエリを生成し、書換クエリの展開を完了させる。
 書換クエリの展開が完了した後、第1のサーバ計算機1-1のクエリ処理部120は、現在のクエリのウィンドウの状態を読み出す(S70)。クエリ処理部120は、読み出したウィンドウの情報を命令受付部130へ通知する。命令受付部130は、第2のサーバ計算機1-2の命令受付部130へウィンドウの複製指令を送信する(S71)。
 ステップS70~S76では、前記実施例1の図5に示したステップS22~S28と同様であり、第2のサーバ計算機1-2の命令受付部130は、第1のサーバ計算機1-1から受信したウィンドウ内のデータをクエリ処理部120に送信して、書換クエリ内のウィンドウの内容を、第1のサーバ計算機1-1のウィンドウの複製に置き換えて同期させる。
 上記処理により、第1のサーバ計算機1-1と第2のサーバ計算機1-2は、実行タイミングのみが異なる同じクエリ(書換クエリ)が設定され、また、クエリのウィンドウは同期した状態となる。第1のサーバ計算機1-1の命令受付部130は、クエリ処理部120に対して、実行中のクエリを、展開しておいた書換クエリに切り替える指示を出力する(S77)。クエリ処理部120は、実行中のクエリを停止して、展開しておいた書換クエリに切り替える(S78)。
 次に、第1のサーバ計算機1-1の命令受付部130は、運用管理計算機3に対して書換クエリの実行準備が完了したことを通知する(S79)。運用管理計算機3は、スケールアウトの対象となる新たな計算機の宛先を追加する指令を、ストリーム送受信計算機2に送信する(S80)。
 ストリーム送受信計算機2は、受信した宛先をデータ送信先管理表202に加えることで、ストリームデータの送信を追加する(S81)。そして、ストリーム送受信計算機2は、ストリームデータのバッファリングを解除して、第1のサーバ計算機1-1に加えて第2のサーバ計算機1-2にもストリームデータの送信を実施する。
 以上の処理により、サーバ計算機1でスケールアウト対象のクエリを選択してからウォームスタンバイ式によって動的なスケールアウトを実施することができる。
 <まとめ>
 なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に記載したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加、削除、又は置換のいずれもが、単独で、又は組み合わせても適用可能である。
 また、上記の各構成、機能、処理部、及び処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、及び機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD等の記録装置、または、ICカード、SDカード、DVD等の記録媒体に置くことができる。
 また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際には殆ど全ての構成が相互に接続されていると考えてもよい。
 <補足>
 データソースからストリームデータを受信してクエリを実行する第1の計算機に、前記クエリを実行する第2の計算機を追加する計算機のスケールアウト方法であって、
 前記第1の計算機と第2の計算機に接続された管理計算機が、スケールアウトの要求を受け付ける第1のステップと、
 前記管理計算機が、前記第1の計算機と第2の計算機にスケールアウトを指令する第2のステップと、
 前記第1の計算機と前記第2の計算機が、前記クエリの実行タイミングを書き換えた前記クエリの複製として書換クエリをそれぞれ生成する第3のステップと、
 前記第1の計算機及び第2の計算機が、前記書換クエリに切り替える第4のステップと、
 前記第1の計算機または第2の計算機が、前記管理計算機へ前記書換クエリの準備が完了したことを通知する第5のステップと、
 前記管理計算機が、前記データソースに前記ストリームデータの送信先として前記第2の計算機を追加させる指令を送信し、前記第1の計算機と第2の計算機へ同一のストリームデータを送信させる第6のステップと、
を含むことを特徴とする計算機のスケールアウト方法。

Claims (15)

  1.  データソースからストリームデータを受信してクエリを実行する第1の計算機に、前記クエリを実行する第2の計算機を追加する計算機のスケールアウト方法であって、
     前記第1の計算機と第2の計算機に接続された管理計算機が、スケールアウトの要求を受け付ける第1のステップと、
     前記管理計算機が、前記クエリの実行タイミングを書き換えた前記クエリの複製として書換クエリを生成する第2のステップと、
     前記管理計算機が、前記書換クエリを含むスケールアウトの指令を前記第1の計算機と第2の計算機に送信する第3のステップと、
     前記第1の計算機及び第2の計算機が、前記スケールアウトの指令を受け付けて前記書換クエリを抽出し、前記抽出した書換クエリに切り替える第4のステップと、
     前記第1の計算機または第2の計算機が、前記管理計算機へ前記書換クエリの準備が完了したことを通知する第5のステップと、
     前記管理計算機が、前記データソースに前記ストリームデータの送信先として前記第2の計算機を追加させる指令を送信し、前記第1の計算機と第2の計算機へ同一のストリームデータを送信させる第6のステップと、
    を含むことを特徴とする計算機のスケールアウト方法。
  2.  請求項1に記載の計算機のスケールアウト方法であって、
     前記第4のステップは、
     前記第1の計算機が、実行中の前記クエリを前記書換クエリに切り替えるステップと、
     前記第2の計算機が、前記書換クエリの実行を開始するステップと、
    をさらに含むことを特徴とする計算機のスケールアウト方法。
  3.  請求項2に記載の計算機のスケールアウト方法であって、
     前記第2のステップは
     前記書換クエリは、前記第1の計算機で実行するクエリを第1の実行タイミングに切り替える第1の書換クエリと、第2の実行タイミングによって前記第2の計算機で実行する第2の書換クエリと、を含むことを特徴とする計算機のスケールアウト方法。
  4.  請求項3に記載の計算機のスケールアウト方法であって、
     前記第1の実行タイミングと前記第2の実行タイミングは、前記第1の書換クエリと前記第2の書換クエリからの出力が交互であることを特徴とする計算機のスケールアウト方法。
  5.  請求項4に記載の計算機のスケールアウト方法であって、
     前記クエリのウィンドウサイズが時間の場合、前記第1の実行タイミングと前記第2の実行タイミングは、前記第1の書換クエリと前記第2の書換クエリから出力される時間間隔が交互であることを特徴とする計算機のスケールアウト方法。
  6.  請求項4に記載の計算機のスケールアウト方法であって、
     前記クエリのウィンドウサイズがストリームデータのタプルの個数の場合、前記第1の実行タイミングと前記第2の実行タイミングは、前記第1の書換クエリと前記第2の書換クエリから出力されるタプルの個数が交互であることを特徴とする計算機のスケールアウト方法。
  7.  請求項1に記載の計算機のスケールアウト方法であって、
     前記第1のステップは、
     前記管理計算機が、前記スケールアウトの対象となるクエリを選択するステップをさらに含み、
     前記第2のステップは、
     前記管理計算機が、前記選択されたクエリについて書換クエリを生成するステップをさらに含むことを特徴とする計算機のスケールアウト方法。
  8.  請求項1に記載の計算機のスケールアウト方法であって、
     前記第4のステップは、
     前記第1の計算機及び第2の計算機の前記書換クエリの実行環境を同期させるステップをさらに含むことを特徴とする計算機のスケールアウト方法。
  9.  請求項8に記載の計算機のスケールアウト方法であって、
     前記第3のステップは、
     前記データソースにストリームデータの送信を停止させるステップをさらに含み、
     前記第6のステップは、
     前記データソースにストリームデータの送信を再開させるステップをさらに含むことを特徴とする計算機のスケールアウト方法。
  10.  請求項8に記載の計算機のスケールアウト方法であって、
     前記第6のステップは、
     前記書換クエリに処理を切り替えるタプルを前記ストリームデータに挿入するステップをさらに含むことを特徴とする計算機のスケールアウト方法。
  11.  データソースからストリームデータを受信してクエリを実行する第1の計算機と、
     前記第1の計算機の前記クエリを実行する第2の計算機を追加する管理計算機と、を有する計算機システムであって、
     前記管理計算機は、
     スケールアウトの要求を受け付けると、前記クエリの実行タイミングを書き換えた前記クエリの複製として書換クエリを生成し、前記書換クエリを含むスケールアウトの指令を前記第1の計算機と第2の計算機に送信し、
     前記第1の計算機及び第2の計算機は、
     前記スケールアウトの指令を受け付けて前記書換クエリを抽出し、前記抽出した書換クエリに切り替えて、前記管理計算機へ前記書換クエリの準備が完了したことを通知し、
     前記管理計算機は、
     前記データソースに前記ストリームデータの送信先に前記第2の計算機を追加する指令を送信し、前記第1の計算機と第2の計算機へ同一のストリームデータを送信させることを特徴とする計算機システム。
  12.  請求項11に記載の計算機システムであって、
     前記第1の計算機は、実行中の前記クエリを前記書換クエリに切り替え、前記第2の計算機が、前記書換クエリの実行を開始することを特徴とする計算機システム。
  13.  請求項12に記載の計算機システムであって、
     前記書換クエリは、前記第1の計算機で実行するクエリを第1の実行タイミングに切り替える第1の書換クエリと、第2の実行タイミングによって前記第2の計算機で実行する第2の書換クエリと、を含むことを特徴とする計算機システム。
  14.  請求項13に記載の計算機システムであって、
     前記第1の実行タイミングと前記第2の実行タイミングは、前記第1の書換クエリと前記第2の書換クエリからの出力が交互であることを特徴とする計算機システム。
  15.  プロセッサとメモリを備えた計算機で、データソースからストリームデータを受信してクエリを実行する第1の計算機に、前記クエリを実行する第2の計算機を追加するプログラムを格納した記憶媒体であって、
     スケールアウトの要求を受け付ける第1の手順と、
     前記クエリの実行タイミングを書き換えた前記クエリの複製として書換クエリを生成する第2の手順と、
     前記書換クエリを含むスケールアウトの指令を前記第1の計算機と第2の計算機に送信し、前記第1の計算機及び第2の計算機に前記書換クエリに切り替えさせる第3の手順と、
     前記第1の計算機または第2の計算機から、前記書換クエリの準備が完了した通知を受信する第4の手順と、
     前記データソースに前記ストリームデータの送信先として前記第2の計算機を追加する指令を送信し、前記第1の計算機と第2の計算機へ同一のストリームデータを送信させる第5の手順と、
    を前記計算機に実行させるプログラムを格納した非一時的な計算機読み取り可能な記憶媒体。
PCT/JP2015/080680 2015-10-30 2015-10-30 計算機のスケールアウト方法、計算機システム及び記憶媒体 WO2017072938A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2015/080680 WO2017072938A1 (ja) 2015-10-30 2015-10-30 計算機のスケールアウト方法、計算機システム及び記憶媒体
US15/557,545 US20180046671A1 (en) 2015-10-30 2015-10-30 Computer scale-out method, computer system, and storage medium
JP2017547300A JP6535386B2 (ja) 2015-10-30 2015-10-30 計算機のスケールアウト方法、計算機システム及び記憶媒体

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2015/080680 WO2017072938A1 (ja) 2015-10-30 2015-10-30 計算機のスケールアウト方法、計算機システム及び記憶媒体

Publications (1)

Publication Number Publication Date
WO2017072938A1 true WO2017072938A1 (ja) 2017-05-04

Family

ID=58631374

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2015/080680 WO2017072938A1 (ja) 2015-10-30 2015-10-30 計算機のスケールアウト方法、計算機システム及び記憶媒体

Country Status (3)

Country Link
US (1) US20180046671A1 (ja)
JP (1) JP6535386B2 (ja)
WO (1) WO2017072938A1 (ja)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599478B1 (en) * 2016-03-29 2020-03-24 Amazon Technologies, Inc. Automated reconfiguration of real time data stream processing
US10552413B2 (en) * 2016-05-09 2020-02-04 Sap Se Database workload capture and replay
CN110062922B (zh) * 2017-09-21 2021-12-14 华为技术有限公司 流处理系统和方法
CN117891603A (zh) * 2018-12-19 2024-04-16 祖克斯有限公司 使用延迟确定和cpu使用率确定的安全系统操作
US11281214B2 (en) * 2018-12-19 2022-03-22 Zoox, Inc. Safe system operation using CPU usage information
JP2023036140A (ja) * 2021-09-02 2023-03-14 株式会社日立製作所 業務データ分析装置、業務データ分析システム及び業務データ分析方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006338432A (ja) * 2005-06-03 2006-12-14 Hitachi Ltd ストリームデータ処理システムのクエリ処理方法
JP2011034255A (ja) * 2009-07-31 2011-02-17 Hitachi Ltd 計算機システム及び複数計算機によるストリームデータ分散処理方法
JP2011192013A (ja) * 2010-03-15 2011-09-29 Hitachi Ltd ストリームデータ処理障害回復方法および装置
JP2012238122A (ja) * 2011-05-10 2012-12-06 Nippon Telegr & Teleph Corp <Ntt> 分散データ管理システムおよび方法
JP2013114627A (ja) * 2011-11-30 2013-06-10 Fujitsu Ltd サーバ装置、移動制御プログラム、および移動制御方法
WO2014188500A1 (ja) * 2013-05-20 2014-11-27 富士通株式会社 データストリーム処理の並列化プログラム、及びデータストリーム処理の並列化システム

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7953728B2 (en) * 2007-05-18 2011-05-31 Oracle International Corp. Queries with soft time constraints
US8024325B2 (en) * 2008-06-25 2011-09-20 Oracle International Corporation Estimating the cost of XML operators for binary XML storage
US8380738B2 (en) * 2009-03-17 2013-02-19 Nec Laboratories America, Inc. System and methods for database distribution and querying over key-based scalable storage
US8180801B2 (en) * 2009-07-16 2012-05-15 Sap Ag Unified window support for event stream data management
US8620903B2 (en) * 2009-11-04 2013-12-31 Nec Laboratories America, Inc. Database distribution system and methods for scale-out applications
US8661014B2 (en) * 2010-09-23 2014-02-25 Hewlett-Packard Development Company, L.P. Stream processing by a query engine
WO2014070162A1 (en) * 2012-10-31 2014-05-08 Hewlett-Packard Development Company, L.P. Executing a query having multiple set operators
US9697262B2 (en) * 2013-12-17 2017-07-04 Microsoft Technology Licensing, Llc Analytical data processing engine
US9514018B2 (en) * 2014-01-28 2016-12-06 Software Ag Scaling framework for querying
US9348865B2 (en) * 2014-04-02 2016-05-24 Futurewei Technologies, Inc. System and method for massively parallel processing database

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006338432A (ja) * 2005-06-03 2006-12-14 Hitachi Ltd ストリームデータ処理システムのクエリ処理方法
JP2011034255A (ja) * 2009-07-31 2011-02-17 Hitachi Ltd 計算機システム及び複数計算機によるストリームデータ分散処理方法
JP2011192013A (ja) * 2010-03-15 2011-09-29 Hitachi Ltd ストリームデータ処理障害回復方法および装置
JP2012238122A (ja) * 2011-05-10 2012-12-06 Nippon Telegr & Teleph Corp <Ntt> 分散データ管理システムおよび方法
JP2013114627A (ja) * 2011-11-30 2013-06-10 Fujitsu Ltd サーバ装置、移動制御プログラム、および移動制御方法
WO2014188500A1 (ja) * 2013-05-20 2014-11-27 富士通株式会社 データストリーム処理の並列化プログラム、及びデータストリーム処理の並列化システム

Also Published As

Publication number Publication date
US20180046671A1 (en) 2018-02-15
JP6535386B2 (ja) 2019-06-26
JPWO2017072938A1 (ja) 2018-08-02

Similar Documents

Publication Publication Date Title
JP6535386B2 (ja) 計算機のスケールアウト方法、計算機システム及び記憶媒体
EP2834755B1 (en) Platform for continuous graph update and computation
US9098312B2 (en) Methods for dynamically generating an application interface for a modeled entity and devices thereof
JP5952960B2 (ja) 計算機システム、計算機システム管理方法及びプログラム
Ananthanarayanan et al. Photon: Fault-tolerant and scalable joining of continuous data streams
US8631094B1 (en) Distributed parallel determination of single and multiple source shortest paths in large directed graphs
Xue et al. Seraph: an efficient, low-cost system for concurrent graph processing
WO2018113580A1 (zh) 一种数据管理方法及服务器
WO2015145536A1 (ja) データベース管理システム及びデータベース間の同期制御方法
WO2018014650A1 (zh) 分布式数据库数据同步方法、相关装置及系统
CN106610876A (zh) 数据快照的恢复方法及装置
CN105493474B (zh) 用于支持用于同步分布式数据网格中的数据的分区级别日志的系统及方法
US9910821B2 (en) Data processing method, distributed processing system, and program
JP2010026814A (ja) 資源転送システム、資源転送方法、情報処理装置及びコンピュータプログラム
Langer et al. MPCA SGD—a method for distributed training of deep learning models on spark
US8938599B2 (en) Distributed graph storage system
JP6405255B2 (ja) 通信システム、キュー管理サーバ、及び、通信方法
Zacheilas et al. Dynamic load balancing techniques for distributed complex event processing systems
CN113010496A (zh) 一种数据迁移方法、装置、设备和存储介质
JP2014041550A (ja) データ移行処理システムおよびデータ移行処理方法
Chung et al. A mechanism for supporting client migration in a shared window system
JP2022521412A (ja) 分散システムにおける非同期ストレージ管理
US10083121B2 (en) Storage system and storage method
CN112069152A (zh) 一种数据库集群升级方法、装置、设备以及存储介质
JP2010152591A (ja) データベースシステム、データ処理方法及びデータ処理プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15907302

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15557545

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2017547300

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15907302

Country of ref document: EP

Kind code of ref document: A1