Efficient out-of-process reassembly of streaming data
By introducing a dispersion limiter and a timestamp ledger in data stream processing, the problem of memory resources and delay when reorganizing multiple upstream partitioned data streams is solved, and more efficient and stable data stream processing is achieved.
Patent Information
- Application Number
- CN202080036571.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-05-30
- Filing Date
- 2020-04-23
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2040-04-23
AI Technical Summary
Existing data stream reorganization solutions require a large amount of in-memory resources and high latency when processing data from multiple upstream partitions. In addition, due to inconsistent partition speeds, it may lead to infinite buffer and sorting problems, affecting system stability and efficiency.
By introducing a dispersion limiter, establishing a maximum temporal dispersion, using multiple data flushers to obtain data items from upstream partitions and flushing them to the data repository without exceeding the dispersion, updating the timestamp ledger, allowing Downstream partitions are sorted at the appropriate time, reducing the size of the reorder buffer and the number of connections.
It effectively reduces memory resource requirements, reduces resource costs required for reorganization, improves system efficiency and stability, reduces failure points and recovery time, and reduces the risk of data loss.
Smart Images

Figure CN113826084B_ABST
Abstract
Description
Background Art
[0001] In some data analysis solutions, data streams can be processed and consumed by users in real time or near real time, as opposed to data sets stored in repositories. For example, a data stream may include data points from various data generating entities (e.g., sensors), each of which has a temporal importance that may diminish over time, such as temperature and / or pressure sensors in a manufacturing facility. In situations where there are a large number of data generating entities or a single machine is not suitable for processing the entire data stream, several partitions are typically used to ingest data points from the data generating entities. However, in many instances, the data partitions (e.g., upstream partitions) that ingest data points from the data generating entities may not include the optimal partitions for the data consumer. For example, a data consumer may wish to visualize data using different partition keys or dimensions.
[0002] To achieve such different partitions of data, techniques are often utilized to reshuffle the data stream from one dimension of the upstream partitions into a different set of partitions with another dimension, called downstream partitions. Due to the temporal importance of the data points, the downstream partitions need to ensure that the data stream is properly ordered (e.g., older events are ordered before newer events, regardless of which event arrives at the downstream partition first). However, since the upstream partitions may operate at different speeds (or the partitions may be down), large reorder buffers are typically required to temporarily hold data points to ensure that the consumer ingests the data stream in the correct temporal order. As a result, existing solutions typically require a large amount of in-memory resources, which not only creates stability and recovery challenges, but also introduces high latency between the occurrence of an event and the event being provided to the data consumer after reorganization. Summary of the invention
[0003] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0004] Methods, systems, apparatus, and computer program products for processing data streams are provided. A maximum time dispersion is established for data flushed from a plurality of upstream partitions to a data repository. Each of a plurality of data flushers corresponding to each upstream partition can obtain data items from a data producer. Each data flusher can determine whether flushing the data to the data repository would exceed the maximum time dispersion. Based at least on a determination that flushing the data to the data repository would not exceed the maximum time dispersion, the data can be flushed to the data repository for ingestion by a downstream partition, and a data structure (e.g., a ledger) can be updated to indicate a time associated with a most recent data item flushed to the data repository.
[0005] Other features and advantages of the present invention, as well as the structure and operation of various embodiments are described in detail below with reference to the accompanying drawings. It should be noted that the present invention is not limited to the specific embodiments described herein. Such embodiments are presented herein for illustrative purposes only. Based on the teachings contained herein, other embodiments will be apparent to those skilled in the relevant art(s). BRIEF DESCRIPTION OF THE DRAWINGS
[0006] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments of the present application and, together with the description, further serve to explain the principles of the embodiments and enable those skilled in the relevant art to make and use the embodiments.
[0007] Figure 1 A block diagram of a system for reassembling data streams according to an example embodiment is shown.
[0008] Figure 2 A flow chart of a method for processing a data stream according to an example embodiment is shown.
[0009] Figure 3 A block diagram of a system for reassembling data streams according to an example embodiment is shown.
[0010] Figure 4 A flow chart of a method for limiting a reorder buffer according to an example embodiment is shown.
[0011] Figure 5 A flow chart of a method for transmitting punctuation events to a data repository according to an example embodiment is shown.
[0012] Figure 6 A flow chart of a method for reordering entries in a reorder buffer up to a timestamp identified in a punctual event is shown according to an example embodiment.
[0013] Figure 7 A block diagram of an example computing device is shown that may be used to implement example embodiments.
[0014] Features and advantages of the present invention will become more apparent from the detailed description set forth below when taken in conjunction with the accompanying drawings, in which like reference numerals identify corresponding elements throughout. In the accompanying drawings, like reference numerals generally indicate identical, functionally similar, and / or structurally similar elements. The figure in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference numeral. DETAILED DESCRIPTION
[0015] I. Introduction
[0016] This specification and the accompanying drawings disclose one or more embodiments incorporating features of the present invention. The scope of the present invention is not limited to the disclosed embodiments. The disclosed embodiments are intended only to illustrate the present invention, and modified versions of the disclosed embodiments are also encompassed by the present invention. Embodiments of the present invention are defined by the appended claims.
[0017] References in the specification to "one embodiment," "an embodiment," "an example embodiment," etc. indicate that the described embodiment may include a particular feature, structure, or characteristic, but each embodiment may not necessarily include the particular feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in conjunction with an example embodiment, whether or not explicitly described, it is considered to be within the knowledge of those skilled in the art to implement such feature, structure, or characteristic in conjunction with other embodiments.
[0018] In the discussion, unless otherwise stated, adjectives such as "substantially" and "approximately" modifying conditions or relational characteristics of one or more features of the example embodiments of the present disclosure should be understood to mean that the condition or characteristic is defined within an acceptable tolerance for the operation of the embodiment for its intended application.
[0019] A number of exemplary embodiments are described below. It should be noted that any section / subsection title provided herein is not intended to be limiting. Embodiments are described throughout this document, and any type of embodiment may be included under any section / subsection. In addition, the embodiments disclosed in any section / subsection may be combined in any manner with any other embodiment described in the same section / subsection and / or different sections / subsections.
[0020] II. Example Implementation
[0021] In some data analysis solutions, data streams can be processed and consumed by users in real time or near real time, as opposed to data sets stored in a repository. For example, a data stream may include data points from various data generating entities (e.g., sensors), each of which has a temporal importance that may diminish over time, such as temperature and / or pressure sensors in a manufacturing facility. In situations where there are a large number of data generating entities or a single machine is not suitable for processing the entire data stream, several partitions are typically used to ingest data points from the data generating entities. However, in many instances, the data partitions (e.g., upstream partitions) that ingest data points from the data generating entities may not include the optimal partitions for the data consumer. For example, a data consumer may wish to visualize data using different partition keys or dimensions.
[0022] In order to achieve such different partitions of data, techniques are often utilized to reorganize the data stream from the dimension of the upstream partitions into a different set of partitions with another dimension, called downstream partitions. Due to the temporal importance of the data points, the downstream partitions need to ensure that the data stream is properly ordered (e.g., older events are ordered before newer events, regardless of which event arrives at the downstream partition first). However, since the upstream partitions may operate at different speeds (or the partitions may be down), large reorder buffers are often required to temporarily save data points to ensure that the consumer ingests the data stream in the correct temporal order. As a result, existing solutions typically require a large amount of in-memory resources, which not only poses challenges in terms of stability and recovery, but also introduces high latency between the occurrence of an event and the time when the event is provided to the data consumer after reorganization.
[0023] For example, some existing solutions utilize a monolithic approach when performing large-scale reorganization of data streams, which may require a large number of intermediate data stores. One example of such an approach is known as a "merge then split" approach, where a single merging entity may be responsible for merging data streams from all upstream partitions, and then splitting the data to the appropriate downstream partitions. Since in some solutions a single entity may be responsible for reorganizing the data, the monolithic entity becomes a single point of failure for the entire pipeline containing the data streams, and maintaining and managing the pipeline becomes more difficult.
[0024] In some other examples, such as the "split and then merge" technique, each upstream partition may include a split entity that splits the data stream into multiple downstream partitions, where each downstream partition may have a separate merge entity responsible for merging (and sorting) the data received from the upstream partition. However, in these types of solutions, a large number of network connections are usually required (e.g., the number of connections is the product of the upstream partition count and the downstream partition count), which may not be optimal in many cases.
[0025] Furthermore, in the above approach, even a simple reorganization of data from upstream partitions into a different set of downstream partitions could potentially result in an infinitely large out-of-order sequence (e.g., due to upstream partitions operating at different speeds or being shut down), which would require the introduction of an infinitely large buffer at some point in the pipeline to properly order data items that may have arrived out of order.
[0026] Embodiments described herein address these and other problems by providing a system for processing data streams. In an example system, a dispersion limiter can establish a maximum time dispersion at which data streams can be flushed from multiple upstream partitions to a data repository. For example, the maximum time dispersion can be the maximum time difference between data items flushed from the slowest upstream partition and the fastest upstream partition. Multiple data flushers (each of which can correspond to an upstream partition) can obtain data items from one or more data producers and determine whether flushing the data to the data repository will exceed the maximum time dispersion. If it is determined that flushing the data to the data repository will not exceed the maximum time dispersion, the data can be flushed to the data repository for ingestion by downstream partitions, and a data structure can be updated to indicate a time (e.g., a timestamp) associated with the flushed data item.
[0027] In this way, data flushing from the upstream partition to the data repository can be performed based on whether the time dispersion is exceeded, and therefore does not need to be sorted. Instead, the sorting can be performed in the downstream reorder buffer of each downstream partition in the downstream partition. Since the dispersion of the data flushed to the data repository in time does not exceed the established limit (e.g., 10 minutes), the downstream reorder buffer can be similarly limited in time, thereby reducing the operating memory of the entire system. Therefore, such advantages can enable improved utilization of machines that process and / or reorganize data streams. By flushing data items that are not necessarily sorted to a persistent storage device, reordering can be performed in a size-limited reorder buffer at a later point in the pipeline to retain the correct time order, thereby avoiding the need to keep all data in the current pipeline in volatile memory, and thus protecting overall in-memory resources (and the costs associated with such resources). In addition, the resources of the (multiple) computing systems that implement the disclosed system can be available to other applications or processes, thereby reducing the resource cost required to perform data reorganization and improving the efficiency of the computing system as a whole.
[0028] In addition, the implementation described herein provides for the transmission of a punctual event, which contains a timestamp until all upstream partitions have at least progressed to, thereby allowing the downstream reorder buffer to flush data from the buffer in a faster manner and reduce the overall latency of data traveling through the pipeline. Further, compared to existing solutions, since each partition is coupled to a data repository (or multiple data repositories), and each data repository is coupled to an appropriate downstream partition, the total number of connections between nodes can be reduced. Such a reduction in connections can not only improve the performance of the network on which the reorganization can be performed (e.g., by reducing the connections utilized and freeing up such resources for other network entities), the reduction in connections can also improve overall stability by reducing the number of possible connection failures. In addition, since each upstream partition, data repository, and downstream partition can process data independently of each other, the total number of failure points in the pipeline is also reduced, thereby further improving the stability of the system. Further, since no single entity can hold all data at a given time (e.g., because the processing of data streams can be performed in a distributed manner on multiple machines), the overall risk of recovery time and / or data loss due to failures can also be reduced.
[0029] Example embodiments are described below with respect to systems and methods for processing data streams. For example, Figure 1 1 shows a block diagram of a system 100 according to an example embodiment. Figure 1 As shown in FIG. 1 , system 100 includes a data processing flow 102, an upstream data acquirer 104, data repositories 110A-110M, a timestamp ledger 112, a downstream data receiver 114, and a data consumer 120. System 100 may include any number of data generation flows, upstream data acquirers, data repositories, timestamp ledgers, downstream data receivers, and / or data consumers, including Figure 1 and optionally include one or more other entities not explicitly described. Figure 1As shown in , the data production flow 102 includes data producers 122A-122P. The upstream data acquirer 104 includes upstream partitions 106A-106N, each of which may include a data reassembly manager 108. The downstream data receiver 114 includes downstream partitions 116A-116M, each of which may include a reorder buffer manager 118. As described in more detail below, the data reassembly manager 108 of the upstream partitions 106A-106N can be configured to acquire data items from one or more data producers 122A-122P and flush the data items to one or more data repositories 110A-110M. The reorder buffer manager 118 of the downstream partitions 116A-116M can ingest data items from corresponding data repositories, reorder the ingested data items, and flush the reordered data items to the data consumer 120. The system 100 is further described as follows.
[0030] One or more of the data generation stream 102, the upstream data acquisition party 104, the data repository 110A-110M, the timestamp ledger 112, the downstream data receiver 114 and / or the data consumer 120 (including any subcomponents thereof) can be communicatively coupled to each other via one or more networks, including any one or more of the following: a local area network (LAN), a wide area network (WAN), a personal area network (PAN), a combination of communication networks such as the Internet and / or a virtual network. In one implementation, any one or more of the data generation stream 102, the upstream data acquisition party 104, the data repository 110A-110M, the timestamp ledger 112, the downstream data receiver 114 and / or the data consumer 120 (including any subcomponents thereof) can communicate via one or more application programming interfaces (APIs) and / or according to other interfaces and / or technologies. The data generation stream 102, the upstream data acquisition party 104, the data storage repositories 110A-110M, the timestamp ledger 112, the downstream data receiver 114 and / or the data consumer 120 may each include at least one network interface that enables communication with each other. Examples of such wired or wireless network interfaces include IEEE 802.11 wireless LAN (WLAN) wireless interface, Worldwide Interoperability for Microwave Access (Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth TM Interface, Near Field Communication (NFC) interface, etc. Further examples of network interfaces are described elsewhere herein.
[0031] The data generation stream 102 may include a collection of any one or more data producers 122A-122P that can provide data points to the upstream data partitions 106A-106N of the upstream data acquirer 104. For example, the data producers 122A-122P may include entities that can monitor one or more environments, including but not limited to sensors (e.g., temperature sensors, pressure sensors, velocity sensors, accelerometers, Doppler sensors, radar sensors, altitude sensors, light sensors, location sensors, etc.), network monitoring components (e.g., network traffic monitors, anti-virus and / or anti-malware detectors, etc.), or any other data generating entity that can generate a data stream (e.g., a continuous stream). In an example, such data generating entities may be implemented in environments including but not limited to factories, offices, mobile phones, vehicles (e.g., autonomous vehicles), airplanes, network environments. Therefore, the data producers 122A-122P may include any physical or virtual machines, computing devices, network nodes or agents, hardware and / or software, etc. Refer to the following Figure 7 An example computing device is described that can implement features of one or more of the data producers 122A-122P. In implementations, the data production flow 102 can include any number of data producers 122A-122P, including tens, hundreds, thousands, millions, or more.
[0032] In implementations, the data points generated by the data producers 122A-122P may also include an associated timestamp, such as a timestamp identifying the time when the data point was generated, enqueued, processed, and / or transmitted by the corresponding data producer, or a timestamp of any other time based on the system time of the data producer. Each data point may include a temporal importance, such that a currently generated data point may be more important than a data point generated in the past (e.g., the importance of a data point may diminish over time). As a result, in implementations, it is often desirable to process the data points generated by the data producers 122A-122P in real time (or near real time) with relatively little latency.
[0033] In an example, the data points generated by the data producers 122A-122P may be provided to one or more of the upstream partitions 106A-106N. For example, the data producers 122A-122P may be configured and / or assigned a partition identifier (ID) that may identify each of the upstream partitions in one or more of the upstream partitions 106A-106N to which the data points of each respective data producer are transmitted (e.g., the partition ID may include a number between 0 and N-1, where N is Figure 1106N). The examples are not limited to assigning partition IDs, and may include any other way of routing data points between the data producers 122A-122P and the upstream partitions 106A-106N. Thus, in implementations, the data points for each of the data producers 122A-122P may be partitioned by any suitable dimension of the upstream partitions 106A-106N (e.g., by sensor type, type of activity being monitored, location, etc.).
[0034] The upstream partitions 106A-106N may include any one or more computing platforms, including but not limited to computing devices, servers, clusters, processing nodes, machines (e.g., virtual machines, physical machines, etc.), services (e.g., web services), or other computing platforms for acquiring and / or processing data items acquired from data generating entities (such as data producers 122A-122P). In an example, the upstream partitions 106A-106N may include one or more distributed computing platforms, wherein each partition may be configured to acquire and / or process a subset of data of the data generating stream 102 (e.g., acquire and / or process data of the data generating stream 102 with a corresponding partition ID). For example, the upstream partitions 106A-106N may include a collection or network of computing platforms that may process data of the data generating stream 102 individually and / or independently of each other. In some examples, one or more of the upstream partitions 106A-106N may be co-located with each other, or may be located remotely (e.g., at different physical locations, on different networks, etc.). Therefore, in some implementations, the upstream partitions 106A-106N may be implemented on different computing platforms. The upstream data fetcher 104 may include the entire set of upstream partitions 106A-106N.
[0035] In implementation, the data reassembly manager 108 may be configured to flush data items acquired from the data production stream 102 by each upstream partition (e.g., based on a partition ID) to one or more data repositories 110A-110M. In an example, the data reassembly manager 108 may flush data items based on a maximum time dispersion. For example, the timestamp ledger 112 may include a list (e.g., in a data structure such as a table) indicating the last time each partition of the upstream partitions 106A-106N flushed data items to the data repositories 110A-110M. In the event that the data reassembly manager 108 determines that flushing the data to the data repositories 110A-110M will not exceed the maximum time dispersion, the data may be flushed to the data repositories.
[0036] As will be described in more detail below, the data items flushed to the data stores 110A-110M need not be in order (e.g., in chronological order), but may be flushed out of order. For example, if one partition operates faster than another partition, the faster partition may still flush a data item to the data stores 110A-110M—even if the data item has an associated timestamp later than a data item currently being processed by the slower partition. In implementation, appropriate reordering may be performed by the reorder buffer manager 118, as described below.
[0037] The data repositories 110A-110M may include any type of storage device, including but not limited to persistent storage devices (e.g., hard drives, flash drives, magnetic drives, optical storage, centralized storage devices, distributed storage devices, cloud or network-based storage devices, etc.). In some implementations, the data repositories 110A-110M may include a persistent data cube (e.g., a multidimensional array of data) that can ingest and / or store data items from multiple data streams (e.g., from each upstream partition) for access by multiple downstream partitions. In some implementations, the persistent storage device (e.g., the data cube) may be partitioned according to the number of downstream partitions (e.g., M partitions). In another example, the data repositories 110A-110M may include a data log (such as an append-only log) that may include multiple partitions (e.g., M partitions), each of which is associated with a plurality of downstream partitions. Figure 1 1. The data storage repositories 110A-110M correspond to a specific one of the downstream partitions shown in . It should be noted and understood that the implementation is not limited to the illustrative examples and may include any other type of persistent storage device for storing data items accessible by multiple downstream partitions. In addition, although in some examples, multiple data storage repositories 110A-110M are shown to exist, it should be understood that the techniques described herein may also be implemented using a single data storage repository including multiple partitions (e.g., M partitions).
[0038] The downstream partitions 116A-116M may include one or more, including any one or more computing platforms, including but not limited to computing devices, servers, clusters, processing nodes, machines (e.g., virtual machines, physical machines, etc.), services (e.g., web services), or other computing platforms for obtaining and / or processing data items obtained from the data repositories 110A-110M, as described in more detail below. In an example, the downstream partitions 116A-116M may be configured to partition the data items generated by the data producers 122A-122P in one or more dimensions that are different from the dimensions of the upstream partitions 106A-106N. The downstream data receiver 114 may include the entire set of downstream partitions 116A-116M.
[0039] As an illustration, the upstream partitions 106A-106N may partition the data of the data generation stream 102 according to storage location (e.g., five partitions, each corresponding to a different repository), while the downstream partitions 116A-116M may partition the data according to product type (e.g., four partitions, each corresponding to a product type sold across the repository). Thus, while the underlying data obtained from the data generation stream 102 may be the same or similar, the dimensions by which the data is partitioned may be different, or the data may be reorganized in any other manner, where the data is partitioned by a key or dimension in N number of upstream partitions to another key or dimension in M number of downstream partitions, where N and M may be the same or different numbers. In some examples, each downstream partition may also include a reorder buffer that includes a temporary storage (e.g., random access memory (RAM), etc.) for temporarily holding data points while the data items obtained from the data repository 110A-110M can be correctly reordered (e.g., according to a timestamp associated with each data item). In other words, the data stores 110A- 110M may include data items associated with each downstream partition that are not necessarily in order, and thus reordering of such data may be managed by the reorder buffer manager 118 .
[0040] After reordering the data items, each of the downstream partitions 116A-116M can flush the data to another storage device or resource (e.g., a local storage device or memory, a cloud-based storage device, any other persistent storage, a web service, etc.). For example, the reordered data can be flushed (e.g., maintained) to a storage device that can be accessed by the data consumer 120. In an example, the data consumer 120 may include a computing device of one or more users (e.g., a personal user, a home user, a business user, a government user, etc.), which may include one or more applications, operating systems, virtual machines, memory devices, etc. that can be executed, hosted, and / or stored therein or via one or more other computing devices over a network. In some examples, the data consumer 120 can access the data reordered by the downstream data recipient 114, as described herein. The data consumer 120 can be any type of fixed or mobile computing device, including a mobile computer or a mobile computing device (e.g., devices, personal digital assistants (PDAs), laptops, notebooks, tablet computers (such as the Apple iPad TM), netbooks, etc.), mobile phones, wearable computing devices, or other types of mobile devices, or fixed computing devices (such as desktop computers or PCs (personal computers)), or servers. Data consumers 120 are not limited to physical machines, but can include other types of machines or nodes, such as virtual machines. Data consumers 120 can interface with downstream data receivers 114 through APIs and / or through other mechanisms (e.g., via one or more network connections). Note that there can be any number of program interfaces.
[0041] In implementations, data consumers 120 may include any computing device for collecting, aggregating, analyzing, and / or visualizing data items from data production stream 102 in real-time or near real-time, including, but not limited to, computing devices and / or services operated by users, autonomous and / or semi-autonomous devices (e.g., vehicles, network alert services, robotic devices, manufacturing components, etc.), data analytics packages, anti-virus or anti-malware solutions, etc. Examples are not limited and may include any other data consuming device configured to process data from data production stream 102 (e.g., including multiple individual data producers 122A-122P) in real-time or near real-time.
[0042] It should be noted and understood that implementation is not limited to Figure 1 Rather, system 100 may include any number of computing devices and / or servers that may implement the features described herein in any manner. Figure 1 Any one or more of the components or subcomponents illustrated in the figure may be co-located, remote from each other, but may also be implemented on a single computing device or virtual machine, or may be implemented on a Figure 1 The system may be distributed on or across one or more additional computing devices or virtual machines not explicitly shown in the drawings.
[0043] Note that the variables "M," "N," and "P" are appended to the various reference numerals of the illustrated components to indicate that the number of such components is variable, having any value of 2 and greater. Depending on the particular implementation, the values of "M," "N," and "P" for any particular component / reference numeral may be less than 10, tens, hundreds, thousands, or even greater.
[0044] As described, the data reassembly manager 108, the data repositories 110A-110M, the timestamp ledger 112, and / or the reorder buffer manager 118 can implement real-time (or near real-time) reassembly of data in various ways. For example, the data reassembly manager 108, the data repositories 110A-110M, the timestamp ledger 112, and / or the reorder buffer manager 118 of the system 100 can implement real-time (or near real-time) reassembly of data in various ways. Figure 2 operate. Figure 2 200 is a flowchart of a method for processing a data stream according to an example embodiment. For illustrative purposes, flowchart 200 and system 100 are described with respect to Figure 3 Description is as follows.
[0045] Figure 3 1 shows a block diagram of a system 300 for reassembling a data stream according to an example embodiment. Figure 3 As shown in , system 300 includes an example implementation of upstream data acquisition party 104, data storage repositories 110A-110M, timestamp ledger 112, and downstream data receiver 114. Upstream data acquisition party includes upstream data partitions 106A-106N. Each of upstream partitions 106A-106N includes data reorganization manager 108. Data reorganization manager 108 includes dispersion limiter 304, data flusher 308, ledger updater 310, and punctuality generator 312. Dispersion limiter 304 includes maximum time dispersion 306. As shown in FIG. Figure 3 As shown in , data flusher 308 includes data flushers 308A-308M. Data reassembly manager 108 may receive data item 302 (eg, a data item from one of data producers 122A-122P). Figure 3 In the example shown in , the data repository 110A can be configured to obtain data items 302 and on-time events 320. The downstream data receiver 114 includes downstream partitions 116A-116M. Each of the downstream data partitions 116A-116M includes a reorder buffer manager 118, which can include a reorder buffer 318 and a buffer flusher 316, and the reorder buffer 318 includes a watermark updater 314. The flowchart 200 and the system 300 are further described in detail as follows.
[0046] Figure 2 The flowchart 200 begins at step 202. In step 202, a maximum time dispersion of data streams to be flushed to a data repository is established. Figure 3 , the dispersion limiter 304 may be configured to establish a maximum temporal dispersion 306 of a data stream (e.g., a stream of data items obtained from the data generation stream 102) that is flushed to the data repositories 110A-110M. In an example, the data flushers 308A-308M may be configured to flush 322 the data stream to an appropriate one of the data repositories 110A-110M based on the maximum temporal dispersion 306.
[0047] The maximum time dispersion 306 may include any time limits related to the maximum allowed time dispersion of data that may be stored in any of the data repositories 110A-110M, or how far ahead (in time) the fastest upstream partition may be relative to the slowest upstream partition. For example, the maximum time dispersion 306 may represent an upper limit on the time that any two upstream partitions may be separated when flushing data items to the data repositories 110A-110M. For example, the maximum time dispersion 306 may include a limit of ten minutes (although this limit is merely illustrative and may include any other time in units of seconds, minutes, hours, days, etc.). In such an example, any of the data flushers 308A-308M may flush data items from the data generation stream 102 where the timestamp associated with the data item is no more than ten minutes ahead of the most recent data item flushed by any other of the data flushers 308. As a result, the maximum time dispersion 306 may limit the amount of data that may be flushed to the data stores 110A- 110M so that the difference between the slowest of the data flushers 308 and the fastest of the data flushers 308 does not exceed the maximum time dispersion.
[0048] In implementations, dispersion limiter 304 may be configurable to establish maximum temporal dispersion 306 in a variety of ways, including via a suitable user interface, pre-programming of dispersion limiter 304 (e.g., via a configuration file, etc.), or automatically (e.g., based on the volume and / or frequency of data generation stream 102).
[0049] In step 204, data items are obtained from the data generator. Figure 3 , the data flusher in the data flusher 308 can obtain the data item from the data generation stream 102. Figure 3 As shown in the illustrative example of , the data flusher 308A of the upstream partition 106A can obtain the data item 302. The data item 302 may include any data item (e.g., a data point) generated by one of the data producers 122A-122P. The data item 302 may include, for example, sensor information, network information, location information, etc. (examples of which are described herein), and an associated timestamp that may indicate when the data item 302 was generated. In an example, the timestamp may identify the year, day, month, hour, minute, second, and / or millisecond, etc. associated with the generation of the data item 302. As previously described, the data item 302 may be routed or otherwise provided to a particular one of the upstream partitions (e.g., the upstream partition 106A) based on an identifier (such as an assigned partition ID). Figure 3 106A in the example shown in FIG.
[0050] The data flusher 308A may retrieve the data items 302 for flushing to an appropriate data repository (data repository 110A in this illustration). In implementation, the data flushers 308A-308M may each correspond to a different one of the downstream partitions 116A-116M. For example, the data flusher 308A may flush the data items for the downstream partition 116A to the data repository 110A, from which the downstream partition 116A may retrieve the data items; the data flusher 308A may flush the data items for the downstream partition 116B to the data repository 110B, from which the downstream partition 116B may retrieve the data items, and so on. In other words, an initial reorganization of the data items retrieved from the data generation stream 102 may be performed for each of the upstream partitions, such as by repartitioning the data from a first dimension according to the upstream partitions to a second dimension according to the downstream partitions.
[0051] Figure 3 The data flushers 308A-308M are illustrated as separate entities for illustration purposes only. In implementation, each upstream partition may include a single data flusher that may flush data to the data repository 110A-110M or a single data repository (e.g., where the single data repository may include multiple partitions, each of which corresponds to a downstream partition), or may include multiple data flushers 308A-308M, each of which flushes data to the data repository for ingestion by the appropriate downstream partition.
[0052] It should also be noted and understood that, for purposes of illustration, data item 302 may represent a single instance of a data item (e.g., a particular data point) obtained from data production stream 102. In implementation, data production stream 102 may provide a continuous or ongoing stream of data items to upstream partitions 106A-106N via a network or any other communication coupling. Although flow chart 200 is described with reference to a single example data item, it should be understood that the described techniques may be similarly applied to any other data item obtained from a data production stream, regardless of the upstream partition that initially receives the data and the downstream partition that may receive the data after a reassembly operation.
[0053] In step 206, it is determined whether flushing the data to the data repository would exceed the maximum time dispersion. Figure 3 , each of the data flushers 308A-308M may be configured to determine whether flushing the data item 302 to an appropriate one of the data repository 110A-110M (e.g., depending on which downstream partition should receive the data item 302 according to the reorganization process) would exceed the maximum temporal dispersion 306.
[0054] In an example, the data flushers 308A-308M may determine whether flushing data to the appropriate data repository would violate the maximum temporal dispersion 306 by accessing and / or obtaining 330 the timestamp ledger 112. The timestamp ledger 112 may include a data structure, such as a table, spreadsheet, database, log file, etc., that may indicate the most recent time (e.g., based on a timestamp) that the data flusher of each upstream partition 106A-106N flushed the data item to any of the data repositories 110A-110M. In an implementation, the timestamp ledger 112 may be stored in a centralized manner so that the data flusher 308 of each upstream partition 106A-106N may access the timestamp ledger 112. In an example, the timestamp ledger 112 may be stored in a memory and / or a persistent storage device in a centralized manner (e.g., on a server, etc.) that may be shared to each upstream partition. Each data flusher 308 of each upstream partition 106A-106N may obtain the timestamped ledger 112 in a periodic (e.g., every second, every minute, etc.) or continuous manner and store an in-memory version of the ledger, store the ledger in a cache, and / or store the table in a persistent storage device that may be local to the partition. In this manner, each data flusher of each upstream partition may be enabled to access the current version of the timestamped ledger 112 in order to determine whether flushing data to the data repository would violate the maximum temporal dispersion 306. Although in Figure 3 A single instance of the timestamp ledger 112 is depicted in FIG, but note that the timestamp ledger 112 may also be distributed across multiple machines, partitions, servers, etc. for redundancy.
[0055] As described, for each of the upstream partitions 106A-106N, the timestamp ledger 112 may include an indication identifying the most recent time that the partition flushed data to any of the data repositories 110A-110M. In an example provided for purposes of illustration only, the timestamp ledger 112 may indicate the following mapping between partitions and timestamps for each of the five upstream partitions:
[0056] Partition 00:01:00
[0057] Partition 01:01:01
[0058] Partition 02:01:01
[0059] Partition 03:01:01
[0060] Partition 04:01:01
[0061] In such an example, each timestamp in the timestamps (expressed in HH:MM format, but may include any other time format, including year, day, month, second, millisecond, etc.) may indicate the most recent time that the data flusher of the partition flushed data to any of the data repositories (e.g., the last output time for each upstream partition). For example, as shown above, the most recent timestamp of data items flushed by partition 00 is 01:00, the most recent timestamp of data items flushed by partition 01 is 01:01, and so on. Whenever an upstream partition flushes a new data item to any of the data repositories 110A-110M, the timestamp ledger 112 may be updated with the new timestamp for that partition.
[0062] Using the above example, the data flusher 308A (of partition 00 in this illustration) may use the timestamp ledger 112 to determine whether flushing the data item 302 to the data store 110A would violate the maximum time dispersion 306. For example, if the maximum time dispersion 306 is configured to be ten minutes, the data flusher 308A may compare the timestamps associated with the data item 302 to determine whether the timestamp of the data item is more than ten minutes ahead of any of the timestamps indicated in the timestamp ledger 112. For example, if the data item 302 includes a timestamp of 01:09, the data flusher 308A may determine that flushing the data item 302 to the data store 110A would not violate the maximum time dispersion 306 because the timestamp of the data item to be flushed is within the configured ten minute limit. On the other hand, if data item 302 includes a timestamp of 01:12, data flusher 308A may determine that flushing the data item to the data repository would exceed (e.g., violate) maximum time dispersion 306, and thus the data item in this instance may not yet be flushed. In this manner, data flushers 308A-308M may ensure that no partition among upstream partitions 106A-106N is significantly ahead of another partition (e.g., a partition that is shut down or recovering from a failure), thereby limiting the amount of data that may be ingested by each downstream reorder buffer.
[0063] In step 208, the data items are flushed to the data repository based at least on a determination that flushing the data to the data repository will not exceed a maximum temporal dispersion. Figure 3 , the data flushers 308A-308N may be configured to flush a data item (e.g., data item 302) from an appropriate one of the data repositories 110A-110M based at least on a determination that flushing the data item would not exceed the maximum temporal dispersion 306. For example, in Figure 3 In the illustrative arrangement shown in , the data flusher 308A may flush the data items 302 to the data repository 110A for ingestion by the downstream partition 116A.
[0064] As previously described, the data repository 110A (or any other data repository) may include a persistent storage device, such as a persistent data cube, for storing each data item received by the upstream partitions 106A-106N and flushed to the data repository. In an example, the data flusher 308 may flush the data items to the appropriate data repository by transmitting the data items over a suitable communication link, such as a network connection.
[0065] In implementation, each of the upstream partitions 106A-106N may operate independently, such as in a distributed or parallel manner, when flushing data items to an appropriate one of the data repositories 110A-110M. Although each upstream partition may process data items from the data production stream 102 in a time order (i.e., data points received by the stream may be flushed sequentially), the data items flushed to the data repositories 110A-110M need not be flushed in a time order across all of the upstream partitions. For example, the upstream partition 106A may flush data items including a timestamp of 01:09 after the upstream partition 106B flushes data items including an earlier timestamp of 01:05. As a result, data items stored on the data repositories 110A-110M (received from any of the upstream partitions 106A-106N) may be flushed in a non-sequential manner that is not necessarily in order. In this way, since no sorting needs to be performed by any of the upstream partitions 106A-106N or data repositories 110A-110M, data items can be flushed to the appropriate data repository more quickly and resources (e.g., memory buffers or caches used to temporarily hold data events) can be preserved at the upstream partitions.
[0066] In instances where the data flusher determines that flushing a data item to an appropriate one of the data repositories 110A-110M would exceed the maximum time dispersion 306, the data flusher may not flush the data to the data repository. For example, such an instance may occur when one or more upstream partitions are down (e.g., due to software and / or hardware failures) or significantly lag behind other partitions. In such instances, the data flusher may identify the item as being in a "pending" state and / or keep the data item in a queue (e.g., a buffer, etc.) so that the data item may not be processed through the pipeline when the partition is down or significantly behind. The data flusher may later retry flushing the data item by polling the timestamp ledger 112 in a continuous or periodic manner until flushing the data item does not exceed the maximum time dispersion 306, at which time the data item may be flushed (and the timestamp ledger 112 may be updated). By flushing data to the data repositories 110A-110M based on the maximum time dispersion 306, the size of the data repositories can be limited so that the data points flushed across the data repositories do not exceed the time limit. As will be described later, such a limit can also enable the reorder buffer in each of the downstream partitions to include a reduced size, thereby saving in-memory resources at various stages of the pipeline.
[0067] In step 210, the data structure is updated to indicate the time associated with the data item. For example, based at least on the data flusher determining that flushing the data to the appropriate data repository does not violate the maximum time dispersion 306, the ledger updater 310 can be configured to update the timestamp ledger 112 with the timestamp of the data item that was last flushed to one of the data repositories 110A-110M. For example, Figure 3 , the ledger updater 310 may update 330 the timestamp ledger 112 to indicate, with a timestamp, that the partition 106A most recently flushed the data item 302 to the data store 110A (e.g., by updating the timestamp value from 01:00 to 01:09).
[0068] The ledger updater 310 can be implemented in various ways. For example, although the ledger updater 310 is implemented in Figure 3106N, but other arrangements are also contemplated, such as implementing the ledger updater 310 in a single upstream partition. In other example embodiments, the ledger updater 310 may be implemented outside of the partitions 106A-106N, such as in one or more servers that may store the timestamp ledger 112 and / or in one or more data repositories 110A-110M. For example, the timestamp ledger 112 may be configured to detect when any of the data repositories 110A-110M receives a new data item from any of the upstream partitions 106A-106N, and automatically update the timestamp ledger 112 to reflect the updated timestamp for the transmitting partition. These examples are not intended to be limiting, and implementations may include any other suitable manner for updating the timestamp ledger 112 as known to those skilled in the relevant art. Once the updated timestamp for a particular partition is stored in the timestamp ledger 112, each of the upstream partitions may be notified of the updated value (e.g., by providing the timestamp ledger 112 as collation, or providing the updated value).
[0069] As described above, the dispersion limiter 304 can limit the size of the downstream reorder buffer. For example, Figure 4 4 is a flowchart 400 showing a method for limiting a downstream reorder buffer according to an example embodiment. In one implementation, the method of flowchart 400 may be implemented by dispersion limiter 304 and / or reorder buffer 318. Figure 3 To describe Figure 4 Based on the following description of flowchart 400 and Figure 3 Based on the discussion of system 300, other structural and operational implementations will be apparent to those skilled in the relevant art(s).
[0070] Flowchart 400 begins at step 402. In step 402, a time dispersion limit is established for a plurality of reorder buffers. Figure 3, the reorder buffer 318 may include a time dispersion limit that limits the size of a buffer (e.g., a temporary storage such as a cache, etc.) used to temporarily hold multiple data items while the data items are reordered. In an example, the reorder buffer 318 of a particular partition may be configured to ingest 324 data items for (e.g., assigned to) the partition from the corresponding data repository after the data items are flushed to the data repository. For example, the reorder buffer 318 of the downstream partition 116A may ingest data items from the data repository 110A, the reorder buffer of the downstream partition 116B may ingest data items from the data repository 110B, and so on. The reorder buffer 318 may acquire data items in real time or near real time via a suitable communication coupling (such as a network link, etc.). In some implementations, after the reorder buffer 318 acquires the data item from the corresponding data repository, the data item may be removed (e.g., deleted, marked for deletion, etc.) from the data repository.
[0071] As previously described, since the data repositories 110A-110M may not contain data items that are dispersed in time by more than the maximum temporal dispersion 306 (e.g., ten minutes), the dispersion limiter 304 may be configured to effectively establish a temporal dispersion limit on the size of the reorder buffer 318. For example, the dispersion limiter 304 may be configured to establish the maximum temporal dispersion 306 to limit the temporal dispersion of data that the data flusher 308 may flush to any one of the data repositories 110A-110M. Since the data flusher 308 may flush data items whose timestamps do not exceed the maximum temporal dispersion 306, the data flushed on the data repositories 110A-110M may include data items within the maximum temporal dispersion 306 (e.g., the data repositories may only include data items within a ten-minute time period). In this manner, a temporal dispersion limit may be established for the reorder buffer 318, which reduces the size of the buffer, which in turn may reduce the memory requirements for each of the downstream partitions 114 and enhance stability. In other words, by coordinating the flushing of data items from the upstream partitions 106A-106N to the data storage repositories 110A-110M based on the maximum temporal dispersion, the size of the reorder buffer may be reduced thereby.
[0072] As previously described, since data items may be flushed to the data repositories 110A-110M in any order (e.g., not necessarily in chronological order), the reorder buffer 318 may ingest similarly out-of-order data items for a particular partition. In other words, while data items from a particular upstream partition (e.g., upstream partition 106A) are processed and flushed to the data repositories in chronological order, different upstream partitions may execute at different speeds, which may cause another partition (e.g., upstream partition 106B) to process and flush data items with earlier timestamps to the data repositories 110A-110M after the upstream partition 106A flushes data items with subsequent timestamps. As a result, the reorder buffer 318 may need to perform a reordering process on such data items to present the data items in the correct chronological order before flushing them to the data consumer.
[0073] In an example embodiment, the reorder buffer 318 may implement a watermarking technique for reordering data items until the watermarked data item can be reordered and flushed to the data consumer. The watermark for a particular reorder buffer may represent the oldest value among the most recent timestamps associated with the data item received at each of the upstream partitions 106A-106N (in one example, it may be the timestamp associated with the slowest upstream partition). For example, if the reorder buffer 318 is configured to receive data items from five upstream partitions, the reorder buffer 318 may store the timestamps of the most recent data item ingested from each of the upstream partitions in a table or other data structure. Based on the collection of timestamps (a total of five timestamps in this particular example), the oldest timestamp may represent a "watermark," which is the point at which the data item can be considered reordered to and flushed to the data consumer. In other words, since each upstream partition processes data items in order, the reorder buffer 318 may infer that once a data item is received from a particular partition, no data item older than the received data item will be subsequently received from the particular partition. Thus, data items in the reorder buffer 318 may be considered reordered up to and including the watermark, and subsequently flushed to the data consumers 120 , across all of the upstream partitions.
[0074] Note that although it is described herein that the downstream reorder buffer can flush data to the data consumer based on the time limit of the reorder buffer, it is contemplated that a less stringent approach can be implemented in some other instances, such as by enabling one or more of the downstream reorder buffers to flush data to the data consumer based on any other factor even if the watermark has not been caught up (e.g., conditions that can be defined for certain partitions and / or data producers, allowing the partition to proceed even if the upstream partition is shut down or recovering, etc.). In some additional implementations, one or more configurable controls can also be implemented to control the flow of data items through the pipeline, such as controls that block and / or unblock certain data producers or upstream partitions.
[0075] In some instances, such as where each of the upstream partitions 106A-106N is healthy (e.g., processing data in a timely manner, no partitions are shut down), an implementation may further reduce the latency of flushing data to data consumers. For example, since the watermark associated with a particular downstream partition described previously generally moves when the downstream partition receives data intended for it, there may be instances where an upstream partition is still healthy and transmits data items for ingestion by a different downstream partition. In such a scenario, the watermark for a particular downstream partition that did not receive any data items may not move in a timely manner, thereby resulting in end-to-end latency for data items flowing through the downstream partition.
[0076] The implementations described herein may enable such delays to be reduced. For example, Figure 5 500 is a flowchart of a method for transmitting a punctual event to a data repository according to an example embodiment. In one implementation, the method of flowchart 500 may be implemented by the punctual generator 312 and / or the data flusher 308. Figure 3 To describe Figure 5 Based on the following Figure 3
[0046] Given the discussion of system 300 and flowchart 500, other structural and operational implementations will be apparent to those skilled in the relevant art(s).
[0077] Flowchart 500 begins at step 502. In step 502, the oldest timestamp indicating the oldest time a partition flushed data to a data repository is identified. Figure 3, the punctuality generator 312 may be configured to reference the timestamp ledger 112 (stored in memory or cache, and / or stored remotely) to identify the oldest time that any of the upstream partitions 106A-106N flushed data to any of the data repositories 110A-110M. In other words, the punctuality generator 312 may identify the timestamp representing the slowest performing partition based on the partition's most recent data flush. As an illustrative example, the timestamp ledger 112 may indicate the following timestamps for each of the five upstream partitions:
[0078] Partition 00:01:08
[0079] Partition 01:01:10
[0080] Partition 02:01:07
[0081] Partition 03:01:01
[0082] Partition 04:01:09
[0083] In such an example, the punctuality generator 312 may identify the timestamp 01:01 corresponding to partition 03 as the oldest timestamp in the timestamp ledger 112. In some example embodiments, the punctuality generator 312 may identify the oldest timestamp at a predetermined time interval (e.g., periodically every second, every ten seconds, every minute, etc.).
[0084] It should also be noted and understood that the timing generator 312 need not be Figure 3 . Instead, in some example embodiments, the on-time generator 312 may be implemented in a subset of the upstream partitions or in a single partition (e.g., the upstream partition 106A or the master partition). For example, any of the upstream partitions may include a on-time generator 312 that is configured to query the timestamp ledger 112 to retrieve the oldest timestamp as described herein. In some other implementations, such an upstream partition may be configured to retrieve the oldest timestamp of all upstream partitions except the current partition (because the partition knows its own watermark). In yet other implementations, such as in the case where there is a 1:1 relationship between the upstream partition and the downstream partition (e.g., in the case of fully parallel jobs), each upstream partition may be configured to generate and transmit a on-time event corresponding to its own timestamp, rather than querying the timestamp ledger 112. Therefore, the implementation is not limited to any particular method or manner of generating and transmitting on-time events, and may include any suitable technology that will be understood by a person skilled in the relevant art.
[0085] In step 504, the on-time event including the oldest timestamp is transmitted to the data repository. Figure 3 , the on-time generator 312 may generate an on-time event 320, which includes the oldest timestamp identified in the timestamp ledger 112. In implementation, the data flushers 308A-308M may transmit 326 (e.g., broadcast) the on-time event to each of the data repositories 110A-110M at the same predetermined time intervals described with respect to step 502 for ingestion by an appropriate one of the downstream partitions 116A-116M. As will be explained in more detail below, the watermark updater 314 may be configured to move the watermark of the reorder buffer 318 based on the on-time event 320, thereby further reducing the latency of flushing the reordered data items to the data consumer.
[0086] In an example, the data flushers 308A-308M may transmit the on-time events 320 in the same or similar manner as the data items 302 (or any other data items received from the data generation stream 102). In other words, the data flushers 308A-308M may be configured to transmit the on-time events 320 over the same one or more communication links as any other data items flushed to the data repositories 110A-110M. Although the same or similar communication links may be utilized, note that the on-time events 320 need not include data items from the data generation stream 102. Rather, the on-time events 320 may include appropriate values identified from the timestamp ledger 112 (e.g., without any other data from the data generation stream 102). The same or similar communication link(s) may be utilized to ensure that the downstream partitions 116A-116M ingest the on-time events in the proper time order. For example, if the on-time event 320 is transmitted directly to the downstream partition instead of through the appropriate data repository, the downstream partition may receive the on-time event indicating the oldest timestamp value, which may be later in time than the data item currently being worked through the pipeline (e.g., in one of the data repositories 110A-110M). Therefore, in such a scenario, the downstream partition may not be able to accurately reorder the data items ingested from the appropriate data repository. Because the on-time event 320 is transmitted through the same link as the links of other data items, it can be ensured that the on-time event (including the timestamp associated with the particular flushed data item) is ingested in event order after the particular flushed data item is ingested by the appropriate downstream partition.
[0087] As previously described, the on-time event 320 can enable the downstream reorder buffer to reduce the latency of flushing data to the data consumer. Figure 6600 may be implemented by the reorder buffer 318, the watermark updater 314, and / or the buffer flusher 316. Figure 3 To describe Figure 6 Based on the following Figure 3
[0066] Given the discussion of system 300 and flowchart 600, other structural and operational implementations will be apparent to those skilled in the relevant art(s).
[0088] Flowchart 600 begins at step 602. In step 602, a punctual event is obtained from a data repository. Figure 3 , the reorder buffer 318 may be configured to obtain 328 a spot event 320 from a data repository (e.g., the data repository 110A). As described earlier, the spot event 320 may include an oldest timestamp identifying the oldest time that any of the upstream partitions 106A-106N flushed data to any of the data repositories 110A-110M. The reorder buffer 318 may obtain the spot event 320 in a similar manner as described above with respect to the reorder buffer 318 obtaining the data item 302 from the data repository. For example, the reorder buffer 318 may obtain the spot event 320 from the data repository 110A immediately after one of the data flushers 308 flushes the spot event 320 to the data repository (e.g., in real time or near real time).
[0089] In step 604, the data items in the reorder buffer up to the oldest timestamp identified in the on-time event are reordered. Figure 3 , the watermark updater 314 may be configured to update the watermark in the reorder buffer 318 based on the oldest timestamp identified in the on-time event 320. Updating the watermark using the timestamp identified in the on-time event 320 may enable the reorder buffer 318 to move the watermark to a point in time at which it is known that no data items will be received prior to the indicated timestamp. In other words, because each of the partitions 106A-106N processes data items from the data production stream 102 in chronological order (e.g., in a monotonically increasing manner), and the on-time event 320 may represent the timestamp of the most recent output of the slowest executing upstream partition (regardless of which data repository 110A-110M the slowest moving partition may have most recently flushed the data item), it may be inferred that all data producers 122A-122P have progressed to at least this point, and no upstream partition (including the slowest partition and any other upstream partition) may subsequently flush data items with timestamps earlier than the timestamp indicated in the on-time event 320.
[0090] As a result, the on-time event 320 may indicate to each of the downstream partitions 116A-116M a point in time up to which the set of items in each reorder buffer may be considered complete. Thus, the reorder buffer 318 may reorder the data items in the buffer up to and including the updated watermark (e.g., the timestamp in the on-time event).
[0091] As an illustrative example, the watermark in the reorder buffer of the downstream partition 116A may indicate a timestamp based on the last instance of data received from a particular upstream partition (e.g., the slowest upstream partition at a given point in time). If the particular upstream partition is still healthy and is processing flushing data items for ingestion by one or more of the downstream partitions 116B-116M, the watermark in the reorder buffer of the downstream partition 116A may not move because the downstream partition 116A has not ingested more recent data items processed by the upstream partitions. However, since the downstream partition 116A may receive a punctual event 320 indicating the last time that the upstream partition flushed data to any data repository 110A-110M, the watermark updater 314 in the downstream partition 116A may infer that the upstream partition has at least progressed to the timestamp and therefore moves the watermark accordingly.
[0092] In step 606, the reordered data items in the reorder buffer are flushed to the data consumer. Figure 3 , the buffer flusher 316 may be configured to flush the data items in the reorder buffer up to the updated watermark to the data consumer 120. The buffer flusher 316 may flush the data in various ways as will be appreciated by those skilled in the relevant art, such as by transferring and / or storing the reordered data items up to the updated watermark in a persistent storage accessible by the data consumer 120, including but not limited to a remote or cloud-based storage device, a storage device local to the data consumer 120 (e.g., on the same computing device as the consumer), an optical disk or other physical medium, or any other persistent or non-volatile storage device. It is also contemplated that the buffer flusher 316 may transfer the reordered data items to other forms of storage, including non-persistent or volatile storage devices (e.g., random access memory devices, data caches, etc.).
[0093] In this manner, when the upstream partitions 106A-106N are healthy (e.g., continuously processing data items correctly and / or not shut down due to a failure, etc.), the watermark updater 314 can be configured to move the watermarks of the reorder buffer 318 closer to real-time or near real-time, rather than waiting until the time dispersion limit (e.g., ten minutes) of the reorder buffer 318. In other words, the data items in the reorder buffer can be flushed to the indicated timestamp in such a manner that the time dispersion of the data items remaining in the buffer (e.g., the time difference between the oldest item remaining in the buffer and the newest item) is less than the time dispersion limit. In many instances, the time dispersion of the data items remaining in the buffer may be significantly smaller by several orders (e.g., seconds) compared to the time dispersion limit, which may be much larger. As a result, not only can the buffer size and memory requirements be reduced to save system resources, but the latency of reordering and flushing data items can be further reduced.
[0094] As described above, the data reassembly manager 108, the data storage repositories 108A-108M, the timestamp ledger 112, and the reassembly buffer manager 118 can be configured to reassemble the data stream from the data generation stream 102 in a manner that ensures that the data items are correctly ordered, while not introducing significant additional delays when flushing the data to the consuming entities. However, it should be noted that while some implementations may include all of the above components, some other implementations may include a subset thereof or only certain subcomponents described herein. For example, the on-time generation and transmission entities may be provided as separate entities independent of the other features described herein in some implementations. Because no runtime dependencies are required between the components of the upstream partition and the downstream partition (except for the time constraints of the downstream reorder buffer, which may be static in many instances), each of the upstream partition and the downstream partition can be maintained (e.g., started, stopped, upgraded, etc.) independently without affecting the other partitions.
[0095] III. Example Mobile and Fixed Device Embodiments
[0096] Data generation stream 102, data producers 122A-122P, upstream data acquisition party 104, upstream partitions 106A-106N, data reorganization manager 108, timestamp ledger 112, data storage repository 110A-110M, downstream data receiver 114, downstream partitions 116A-116M, reorder buffer manager 118, data consumer 120, dispersion limiter 304, data flusher 308A-308M, ledger updater 310, punctuality generator 312, reorder buffer 318, watermark updater 314, buffer The flusher 316, flowchart 200, flowchart 400, flowchart 500 and / or flowchart 600 can be implemented in hardware, or hardware in combination with software and / or firmware, such as being implemented as computer program code / instructions stored in a physical / hardware-based computer-readable storage medium and configured to be executed in one or more processors, or being implemented as hardware logic / circuitry (e.g., a circuit composed of transistors, logic gates, operational amplifiers, one or more application-specific integrated circuits (ASICs), one or more field-programmable gate arrays (FPGAs)). For example, one or more of the data generation stream 102, data producers 122A-122P, upstream data acquirers 104, upstream partitions 106A-106N, data reassembly manager 108, timestamp ledger 112, data repositories 110A-110M, downstream data receivers 114, downstream partitions 116A-116M, reorder buffer manager 118, data consumers 120, dispersion limiter 304, data flushers 308A-308M, ledger updater 310, punctuality generator 312, reorder buffer 318, watermark updater 314, buffer flusher 316, flowchart 200, flowchart 400, flowchart 500 and / or flowchart 600 may be implemented individually or together in a SoC. The SoC may include an integrated circuit chip that includes one or more of a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or other circuits, and may optionally execute received program code and / or include embedded firmware for performing functions.
[0097] Figure 7An exemplary implementation of a computing device 700 in which an example embodiment may be implemented is depicted. For example, any of the data production stream 102, data producers 122A-122P, upstream data acquirers 104, upstream partitions 106A-106N, data reassembly manager 108, timestamp ledger 112, data repositories 110A-110M, downstream data receivers 114, downstream partitions 116A-116M, reorder buffer manager 118, data consumers 120, dispersion limiter 304, data flushers 308A-308M, ledger updater 310, punctuality generator 312, reorder buffer 318, watermark updater 314, and / or buffer flusher 316 may be implemented in one or more computing devices similar to the computing device 700 in a fixed or mobile computer embodiment, including one or more features and / or alternative features of the computing device 700. The description of the computing device 700 provided herein is provided for purposes of illustration and is not intended to be limiting. Example embodiments may be implemented in other types of computer systems known to those skilled in the relevant art(s).
[0098] like Figure 7 As shown in , computing device 700 includes one or more processors referred to as processor circuit 702, system memory 704, and bus 706 coupling various system components including system memory 704 to processor circuit 702. Processor circuit 702 is an electronic and / or optical circuit that is implemented as a central processing unit (CPU), microcontroller, microprocessor, and / or other physical hardware processor circuit in one or more physical hardware circuit device elements and / or integrated circuit devices (semiconductor material chips or dies). Processor circuit 702 can execute program codes stored in computer-readable media, such as program codes of operating system 730, application programs 732, other programs 734, etc. Bus 706 represents any one or more bus structures of several types of bus structures, including memory bus or memory controller, peripheral bus, accelerated graphics port, and processor or local bus using any of various bus architectures. System memory 704 includes read-only memory (ROM) 708 and random access memory (RAM) 710. Basic input / output system 712 (BIOS) is stored in ROM 708.
[0099] The computing device 700 also has one or more of the following drives: a hard disk drive 714 for reading from and writing to a hard disk, a disk drive 716 for reading from or writing to a removable disk 718, and an optical drive 720 for reading from or writing to a removable optical disk 722 such as a CD ROM, DVD ROM or other optical media. The hard disk drive 714, the disk drive 716, and the optical drive 720 are connected to the bus 706 by a hard disk drive interface 724, a disk drive interface 726, and an optical drive interface 728, respectively. The drives and their associated computer-readable media provide non-volatile storage of computer-readable instructions, data structures, program modules, and other data for the computer. Although a hard disk, a removable disk, and a removable optical disk are described, other types of hardware-based computer-readable storage media may also be used to store data, such as flash memory cards, digital video disks, RAM, ROM, and other hardware storage media.
[0100] A plurality of program modules may be stored on a hard disk, a magnetic disk, an optical disk, a ROM or a RAM. These programs include an operating system 730, one or more application programs 732, other programs 734 and program data 736. The application program 732 or other program 734 may include, for example, computer program logic (e.g., computer program code and instructions) to implement the data generation flow 102, the data generator 122A-122P, the upstream data acquisition party 104, the upstream partition 106A-106N, the data reorganization manager 108, the timestamp ledger 112, the data storage library 110A-110M, the downstream data receiver 114, the downstream partition 116A-116M, the reordering buffer The processor manager 118, the data consumer 120, the dispersion limiter 304, the data flushers 308A-308M, the ledger updater 310, the punctuality generator 312, the reorder buffer 318, the watermark updater 314, the buffer flusher 316, the flowchart 200, the flowchart 400, the flowchart 500 and / or the flowchart 600 (including any suitable steps of the flowcharts 200, 400, 500 or 600), and / or other example embodiments described herein.
[0101] A user may enter commands and information into the computing device 700 through input devices such as a keyboard 738 and a pointing device 740. Other input devices (not shown) may include a microphone, a joystick, a game controller, a satellite dish, a scanner, a touch screen and / or touch pad, a voice recognition system for receiving voice input, a gesture recognition system for receiving gesture input, etc. These and other input devices are often connected to the processor circuit 702 through a serial port interface 742 coupled to the bus 706, but may be connected by other interfaces, such as a parallel port, a game port, or a universal serial bus (USB).
[0102] Display screen 744 is also connected to bus 706 via an interface, such as video adapter 746. Display screen 744 may be external to computing device 700, or incorporated into computing device 700. Display screen 744 may display information, as well as be a user interface for receiving user commands and / or other information (e.g., by touch, finger gestures, a virtual keyboard, etc.). In addition to display screen 744, computing device 700 may include other peripheral output devices (not shown), such as speakers and printers.
[0103] The computing device 700 is connected to a network 748 (e.g., the Internet) through an adapter or network interface 750, a modem 752, or other means for establishing communications over the network. The modem 752 may be internal or external and may be connected to the bus 706 via the serial port interface 742, such as a serial bus. Figure 7 , or may be connected to bus 706 using another interface type including a parallel interface.
[0104] As used herein, the terms "computer program medium", "computer readable medium" and "computer readable storage medium" are used to refer to physical hardware media, such as a hard disk associated with hard disk drive 714, removable disk 718, removable optical disk 722, other physical hardware media such as RAM, ROM, flash memory cards, digital video disks, zip disks, MEMs, nanotechnology-based memory devices, and other types of physical / tangible hardware storage media. Such computer readable storage media are different from and do not overlap with communication media (excluding communication media). Communication media contain computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave. The term "modulated data signal" refers to a signal having one or more characteristics that are set or changed in a manner that encodes information in the signal. By way of example and not limitation, communication media include wireless media such as acoustic, RF, infrared and other wireless media, as well as wired media. Example embodiments also relate to such communication media that are separate and non-overlapping from embodiments involving computer readable storage media.
[0105] As noted above, computer programs and modules (including application programs 732 and other programs 734) may be stored on a hard disk, disk, optical disk, ROM, RAM, or other hardware storage medium. Such computer programs may also be received via network interface 750, serial port interface 742, or any other interface type. Such computer programs, when executed or loaded by an application, enable computing device 700 to implement the features of the example embodiments described herein. Thus, such computer programs represent controllers of computing device 700.
[0106] Example embodiments also relate to computer program products including computer codes or instructions stored on any computer readable medium. Such computer program products include hard drives, optical drives, memory device packages, portable memory sticks, memory cards and other types of physical storage hardware.
[0107] IV. Example Embodiments
[0108] A system for processing a data stream is disclosed herein. The system includes: one or more processors; and one or more memory devices storing program codes configured to be executed by the one or more processors, the program codes including: a dispersion limiter configured to establish a maximum time dispersion of a data stream being flushed from a plurality of upstream partitions to a data repository; a plurality of data flushers, each corresponding to one of the plurality of upstream partitions, each configured to: obtain data items from one or more data producers; determine whether flushing the data to the data repository will exceed the maximum time dispersion; and flush the data to the data repository for ingestion by a downstream partition based at least on the determination that flushing the data to the data repository will not exceed the maximum time dispersion, and update a data structure to indicate the time associated with the data item.
[0109] In one implementation of the foregoing system, the data repository includes a persistent data cube.
[0110] In another implementation of the foregoing system, the data items flushed to the data repository are not necessarily in order.
[0111] In another implementation of the foregoing system, the data structure includes a table accessible by each of the plurality of upstream partitions.
[0112] In another implementation of the aforementioned system, the dispersion limiter is further configured to: establish a time dispersion limit for a plurality of reorder buffers, each reorder buffer corresponding to a downstream partition.
[0113] In another implementation of the aforementioned system, the system also includes: a timing generator, which is configured to: identify the oldest timestamp in the data structure at predetermined time intervals, the oldest timestamp indicating the oldest time when a partition among multiple upstream partitions flushed data to the data repository; and transmit the timing event including the oldest timestamp to the data repository for ingestion by multiple downstream partitions.
[0114] In another implementation of the aforementioned system, each downstream partition includes a reorder buffer configured to: obtain on-time events from a data repository and reorder data items in the reorder buffer up to the oldest timestamp in the on-time events; the system also includes a buffer flusher configured to flush the reordered data items in the reorder buffer to a data consumer, wherein the time dispersion of the remaining data items in the reorder buffer is less than the time dispersion limit of the reorder buffer.
[0115] A method for processing a data stream is disclosed herein. The method includes: establishing a maximum time dispersion of a data stream to be flushed from a plurality of upstream partitions to a data repository; obtaining data items from one or more data producers in each of a plurality of data flushers, each data flusher corresponding to one of the plurality of upstream partitions; determining whether flushing the data to the data repository would exceed the maximum time dispersion; based at least on determining that flushing the data to the data repository would not exceed the maximum time dispersion: flushing the data to the data repository for ingestion by a downstream partition, and updating a data structure to indicate a time associated with the data item.
[0116] In one implementation of the foregoing method, the data repository includes a persistent data cube.
[0117] In another implementation of the aforementioned method, the data items flushed to the data repository are not necessarily in order.
[0118] In another implementation of the foregoing method, the data structure includes a table accessible by each of the plurality of upstream partitions.
[0119] In another implementation of the aforementioned method, the method further includes: establishing a time dispersion limit for a plurality of reorder buffers, each reorder buffer corresponding to a downstream partition.
[0120] In another implementation of the aforementioned method, the method also includes: identifying the oldest timestamp in the data structure at a predetermined time interval, the oldest timestamp indicating the oldest time when a partition among multiple upstream partitions flushed data to the data repository; and transmitting the on-time events including the oldest timestamp to the data repository at a predetermined time interval for ingestion by multiple downstream partitions.
[0121] In another implementation of the aforementioned method, the method further includes: obtaining a sharp event from a data repository; reordering data items in a reorder buffer corresponding to a downstream partition up to the oldest timestamp in the sharp event; flushing the reordered data items in the reorder buffer to a data consumer, wherein the time dispersion of the remaining data items in the reorder buffer is less than a time dispersion limit of the reorder buffer.
[0122] A computer-readable memory is disclosed herein. The computer-readable memory has computer program code recorded thereon, which, when executed by at least one processor, causes the at least one processor to perform a method, the method comprising: establishing a maximum time dispersion of data streams to be flushed from a plurality of upstream partitions to a data repository; acquiring data items from one or more data producers in each of a plurality of data flushers, each data flusher corresponding to one of the plurality of upstream partitions; determining whether flushing the data to the data repository exceeds the maximum time dispersion; based at least on determining that flushing the data to the data repository does not exceed the maximum time dispersion: flushing the data to the data repository for ingestion by a downstream partition, and updating a data structure to indicate a time associated with the data item.
[0123] In one implementation of the aforementioned computer-readable memory, data items flushed to the data repository are not necessarily in order.
[0124] In another implementation of the foregoing computer-readable memory, the data structure includes a table accessible by each upstream partition of the plurality of upstream partitions.
[0125] In another implementation of the aforementioned computer readable memory, the method further includes: establishing a time dispersion limit for a plurality of reorder buffers, each reorder buffer corresponding to a downstream partition.
[0126] In another implementation of the aforementioned computer-readable memory, the method also includes: identifying the oldest timestamp in the data structure at a predetermined time interval, the oldest timestamp indicating the oldest time when a partition among multiple upstream partitions flushed data to the data repository; and transmitting the on-time events including the oldest timestamp to the data repository at a predetermined time interval for ingestion by multiple downstream partitions.
[0127] In another implementation of the aforementioned computer-readable memory, the method also includes: obtaining a timely event from a data repository; identifying the oldest timestamp in the timely event; reordering the data items in the reorder buffer corresponding to the downstream partition until the oldest timestamp in the timely event; flushing the reordered data items in the reorder buffer to the data consumer, wherein the time dispersion of the remaining data items in the reorder buffer is less than the time dispersion limit of the reorder buffer.
[0128] V. Conclusion
[0129] Although various embodiments of the present invention have been described above, it should be understood that they are presented by way of example only and not limitation. (Multiple) persons skilled in the relevant art will understand that various changes can be made in form and detail without departing from the spirit and scope of the present invention as defined in the appended claims. Therefore, the breadth and scope of the present invention should not be limited by any of the exemplary embodiments described above, but should only be limited according to the appended claims and their equivalents.
Claims
1. A system for processing a data stream, the system comprising: one or more processors; and One or more memory devices storing program codes configured to be executed by the one or more processors, the program codes comprising: a dispersion limiter configured to establish a maximum temporal dispersion of data streams flushed to a data repository from a plurality of upstream partitions, each upstream partition comprising a data partition, the maximum temporal dispersion being a maximum allowed time difference between data items flushed to the data repository from any two of the plurality of upstream partitions; A plurality of data flushers are configured to flush data to one or more data storage repositories, each data flusher corresponds to an upstream partition of the plurality of upstream partitions, and each data flusher is configured to: Obtaining data items from one or more data producers; determining whether flushing the data to the respective data repositories would exceed the maximum temporal dispersion; and Based at least on a determination that flushing the data to the respective data repositories will not exceed the maximum temporal dispersion, flushing the data to the corresponding data repository for ingestion by downstream partitions, and A data structure is updated to indicate a timestamp associated with the flushing of the data item to the corresponding data repository. 2 . The system of claim 1 , wherein the data repository comprises a persistent data cube.
3. The system of claim 1, wherein the data items flushed to the data repository are not necessarily in order. 4 . The system of claim 1 , wherein the data structure comprises a table accessible by each of the plurality of upstream partitions.
5. The system of claim 1, wherein the dispersion limiter is further configured to: A time dispersion limit is established for a plurality of reorder buffers, each reorder buffer corresponding to a downstream partition.
6. The system according to claim 1, further comprising: A punctuality generator, wherein the punctuality generator is configured to: identifying an oldest timestamp in the data structure, the oldest timestamp indicating an oldest time when a partition among the plurality of upstream partitions flushed data to the corresponding data repository; as well as The on-time event including the oldest timestamp is transmitted to the corresponding data repository for ingestion by multiple downstream partitions.
7. The system of claim 6, wherein each downstream partition comprises a reorder buffer configured to: obtaining the on-time event from the corresponding data repository, and reordering the data items in the reorder buffer up to the oldest timestamp in the on-time event; and The system further comprises a buffer flusher configured to flush the reordered data items in the reorder buffer to a data consumer, wherein a time dispersion of remaining data items in the reorder buffer is less than a time dispersion limit of the reorder buffer.
8. A method for processing a data stream, the method comprising: establishing a maximum time dispersion of data streams flushed to a data repository from a plurality of upstream partitions, each upstream partition comprising a data partition, the maximum time dispersion being a maximum allowed time difference between data items flushed to the data repository from any two of the plurality of upstream partitions; In each of a plurality of data flushers, data items are obtained from one or more data producers, each data flusher corresponds to one of the plurality of upstream partitions, and the plurality of data flushers are configured to flush data to one or more data repositories; determining whether flushing the data to the corresponding data repository would exceed the maximum time dispersion; Based at least on determining that flushing data to the respective data repositories will not exceed the maximum temporal dispersion: flushing the data to the corresponding data repository for ingestion by downstream partitions, and A data structure is updated to indicate a timestamp associated with the flushing of the data item to the corresponding data repository.
9. The method of claim 8, wherein the data repository comprises a persistent data cube.
10. The method of claim 8, wherein the data items flushed to the data repository are not necessarily in order.
11. The method of claim 8, wherein the data structure comprises a table accessible by each of the plurality of upstream partitions.
12. The method according to claim 8, further comprising: A time dispersion limit is established for a plurality of reorder buffers, each reorder buffer corresponding to a downstream partition.
13. The method according to claim 8, further comprising: identifying, at predetermined time intervals, an oldest timestamp in the data structure, the oldest timestamp indicating an oldest time at which a partition among the plurality of upstream partitions flushed data to the corresponding data repository; and The on-time events including the oldest timestamp are transmitted to the corresponding data repository at the predetermined time intervals for ingestion by multiple downstream partitions.
14. The method according to claim 13, further comprising: Retrieve the on-time event from the corresponding data repository; reordering the data items in the reorder buffer corresponding to the downstream partition up to the oldest timestamp in the on-time event; as well as The reordered data items in the reorder buffer are flushed to a data consumer, wherein a time dispersion of remaining data items in the reorder buffer is less than a time dispersion limit of the reorder buffer.
15. A computer readable memory having computer program code stored thereon, the computer program code, when executed by at least one processor, causing the at least one processor to perform a method, the method comprising: establishing a maximum time dispersion of data streams flushed to a data repository from a plurality of upstream partitions, each upstream partition comprising a data partition, the maximum time dispersion being a maximum allowed time difference between data items flushed to the data repository from any two of the plurality of upstream partitions; In each of a plurality of data flushers, data items are obtained from one or more data producers, each data flusher corresponds to one of the plurality of upstream partitions, and the plurality of data flushers are configured to flush data to one or more data repositories; determining whether flushing the data to the corresponding data repository would exceed the maximum time dispersion; Based at least on determining that flushing data to the respective data repositories will not exceed the maximum temporal dispersion: flushing the data to the corresponding data repository for ingestion by downstream partitions, and A data structure is updated to indicate a timestamp associated with the flushing of the data item to the corresponding data repository.
16. The computer readable memory of claim 15, wherein the data items flushed to the data repository are not necessarily in order.
17. The computer readable memory of claim 15, wherein the data structure comprises a table accessible by each upstream partition of the plurality of upstream partitions.
18. The computer readable memory of claim 15, further comprising: A time dispersion limit is established for a plurality of reorder buffers, each reorder buffer corresponding to a downstream partition.
19. The computer readable memory of claim 15, further comprising: identifying, at predetermined time intervals, an oldest timestamp in the data structure, the oldest timestamp indicating an oldest time at which a partition among the plurality of upstream partitions flushed data to the corresponding data repository; and The on-time events including the oldest timestamp are transmitted to the corresponding data repository at the predetermined time intervals for ingestion by multiple downstream partitions.
20. The computer readable memory of claim 19, further comprising: Retrieve the on-time event from the corresponding data repository; reordering the data items in the reorder buffer corresponding to the downstream partition up to the oldest timestamp in the on-time event; as well as The reordered data items in the reorder buffer are flushed to a data consumer, wherein a time dispersion of remaining data items in the reorder buffer is less than a time dispersion limit of the reorder buffer.
