Reduce probability filter query latency
By checking cached data in probabilistic filter queries and conditionally loading the remaining data, query latency issues are resolved and more efficient query processing is achieved, especially when operating on non-contiguous pages.
Patent Information
- Application Number
- CN202111355976.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-08-31
- Filing Date
- 2018-08-07
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2038-08-07
AI Technical Summary
When using probabilistic filters for queries, the existing technology needs to load the entire data structure from the disk, resulting in a long query delay. In addition, the existing method suffers from severe performance loss when operating on non-contiguous pages.
By checking cache data and conditionally loading the remaining data into memory, a short-circuiting mechanism is used to provide answers in partial query results, avoiding loading the entire filter, and utilizing processing circuitry to retrieve and load the remaining data without caller intervention.
The probability filter query delay is shortened, the system overhead is reduced, and the query efficiency is improved, especially the performance loss is reduced when operating on non-contiguous pages.
Smart Images

Figure CN114064756B_ABST
Abstract
Description
[0001] Information about divisional applications
[0002] This application is a divisional application. The parent application is an invention patent application filed on August 7, 2018, with application number 201880063595.1 and titled “Reducing Probabilistic Filter Query Delay.”
[0003] Priority application
[0004] This application claims the benefit of priority to U.S. application serial number 15 / 691,998, filed August 31, 2017, which is incorporated herein by reference in its entirety. Technical Field
[0005]
[0014] Embodiments described herein generally relate to block device (eg, disk) operations and more specifically to reducing probabilistic filter query latency. Background Art
[0006] Computer storage devices include a variety of storage technologies, which can be divided into block-addressable "disks" - such as solid-state drives (SSDs), hard disk drives (HDDs), compact disks (CDs), and the like based on NAND or other non-volatile memory (NVM) technologies - and byte-addressable "memory" - such as random access memory (DRAM), static random access memory (SRAM), phase change memory (PCM), resistive random access memory (RRAM), or 3D crosspoint, and the like. Typically, data is moved from disk to memory before being used by the computing system's processor. For data stored in a file system, the file system or operating system typically manages this movement, resulting in the file system cache in memory reflecting a portion of the data stored on disk.
[0007] Probabilistic filters are commonly used in data storage systems to efficiently determine whether a data item is stored in a data structure without having to load the entire data structure from disk, for example. For example, in a key-value data storage system, a probabilistic filter can be used to determine the possible presence of a key value in a key-value store without having to load and search the key-value store. Probabilistic filters are typically high-speed and space-efficient data structures that support set membership testing with single-sided errors. These filters can establish that a given set item is definitely not represented in a set of items. If the filter does not establish that the item is definitely not in the set, then the item may or may not be in the set. In other words, a negative response (e.g., not in the set) is conclusive, while a positive response (e.g., may be in the set) incurs a false positive probability (FPP). Typically, the trade-off for this single-sided error is space savings. For example, some probabilistic filters (such as Cuckoo filters and Bloom filters) use approximately 7 bits per item to provide a 3% FPP, regardless of the size of the item.
[0008] There are various probabilistic filters, including cuckoo filters and Bloom filters, the operation of which is provided here for illustrative purposes. A cuckoo filter operates by inserting an f-bit fingerprint of a key value into one of two buckets. The first bucket is a hash of the key value, and the second bucket is derived by hashing the fingerprint. If both buckets are full, the existing fingerprint is removed to make room, and then that fingerprint is moved to its own replacement bucket. Locating the key value involves checking the bucket against the key value to determine whether the fingerprint exists. A basic Bloom filter consists of M bits (initialized to a null value, such as zero) and an array of k different hash functions (e.g., a Bloom filter array), each of which maps a set element to one of the M bits, resulting in a k-bit representation of the set element in the Bloom filter. When an element is added to the filter, each of the bits corresponding to the hash function in the array is set to 1. To determine the presence of an element (e.g., to perform a Bloom filter query or Bloom query), the same hash function is applied to determine the corresponding position in the array for the queried element. The key value may be in the set if every position has a value of 1 instead of 0. If a position has a value of 0, then the key value is not in the set. Summary of the Invention
[0009] One aspect of the present application relates to a system comprising a processing circuit system for performing operations comprising: receiving a query for a probabilistic filter stored on a first medium from a calling software application; in response to receiving the query, obtaining a cache fragment of the probabilistic filter stored on a second medium, the cache fragment comprising a subset of the probabilistic filter stored on the first medium, the probabilistic filter being used to determine if an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result; transmitting the partial query result back to the calling software application; and while performing a retrieval of a non-cached fragment of the probabilistic filter from the first medium to the second medium without intervention by the calling software application: searching within the partial query result for a stop condition; and in response to identifying the stop condition, stopping the search and abandoning the retrieval of any remaining non-cached fragments.
[0010] Another aspect of the present application relates to a method comprising: receiving a query for a probabilistic filter stored on a first medium from a calling software application; in response to receiving the query, obtaining a cache fragment of the probabilistic filter stored on a second medium, the cache fragment comprising a subset of the probabilistic filter stored on the first medium, the probabilistic filter being used to determine whether an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result; transmitting the partial query result back to the calling software application; and while performing a retrieval of a non-cached fragment of the probabilistic filter from the first medium to the second medium without intervention by the calling software application: searching for a stop condition within the partial query result; and in response to identifying the stop condition, stopping the search and abandoning the retrieval of any remaining non-cached fragments.
[0011] Yet another aspect of the present application relates to a non-transitory machine-readable storage medium comprising instructions that, when executed by a processing circuit system, cause the processing circuit system to perform operations comprising: receiving a query for a probabilistic filter stored on a first medium from a calling software application; in response to receiving the query, obtaining a cache fragment of the probabilistic filter stored on a second medium, the cache fragment comprising a subset of the probabilistic filter stored on the first medium, the probabilistic filter being used to determine if an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result; transmitting the partial query result back to the calling software application; and, while performing a retrieval of a non-cached fragment of the probabilistic filter from the first medium to the second medium without intervention by the calling software application: searching within the partial query result for a stop condition; and in response to identifying the stop condition, stopping the search and abandoning the retrieval of any remaining non-cached fragments. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In the drawings, which are not necessarily drawn to scale, similar reference numerals may describe similar components in different views. Similar reference numerals with different letter subscripts may represent different instances of similar components. The drawings generally illustrate various embodiments discussed in this document by way of example and not limitation.
[0013] Figure 1 is a block diagram of an example of a system for reducing probabilistic filter query latency, according to an embodiment.
[0014] Figure 2 is a swim lane diagram of an example of a control flow for reducing probabilistic filter query latency according to an embodiment.
[0015] Figure 3 is a flow chart of an example of a method for reducing probabilistic filter query latency according to an embodiment.
[0016] Figure 4 is a flow chart of an example of a method for reducing probabilistic filter query latency according to an embodiment.
[0017] Figure 5 is a flow chart of an example of a method for reducing probabilistic filter query latency according to an embodiment.
[0018] Figure 6 is a block diagram illustrating an example of a machine upon which one or more embodiments may be implemented. DETAILED DESCRIPTION
[0019] As mentioned above, probabilistic filters are often used to test for set membership before performing expensive operations (e.g., loading data from disk into memory). Probabilistic filters are data structures that can be stored on media and, in some data sets, can themselves be spread across several loadable units (e.g., pages, blocks, etc.). For example, a probabilistic filter can be partially cached in memory, while the remainder resides on disk. Therefore, to use the filter, the remainder is retrieved from disk and stored in memory to be queried. This operation introduces additional latency when querying the probabilistic filter.
[0020] Embodiments of the present invention describe a technique for reducing the latency of probabilistic filter queries. This can be achieved via a check-and-fetch technique whereby, in response to a filter query, the currently cached data (e.g., the portion of the filter in memory) is checked against the query constraints, and the remaining data can be conditionally retrieved from disk and loaded into memory. The condition for loading the remaining data includes whether the cached data provides an unambiguous answer to the query. For example, a Bloom query can be "short-circuited" or paused before checking every bit in the array, as any checked empty (e.g., zero) bit provides an unambiguous answer that the element being tested is not in the set. Therefore, if any cached portion of the filter indicates negative set membership, the remaining portion of the filter does not need to be loaded from disk. If the cached filter portion does not provide an unambiguous answer (e.g., all corresponding bits have non-empty values), the remaining portion of the filter is loaded from disk, and the results of the partial check (e.g., the cached data portion) are returned to the caller. Thus, by the time the calling application processes the partial filter query results, the disk-to-memory load of the filter has already begun and is ready for use by the calling application when processing the partial query results. This sequence reduces latency in filter queries by, in some cases, providing answers to queries without loading the entire filter from disk, and in other cases allowing processing applications to investigate a subset of the filter. To simplify the discussion, the described techniques are illustrated using a standard Bloom filter, although the techniques can be applied to other probabilistic filters or data structures that satisfy the "short-circuiting" principle discussed above.
[0021] Figure 1FIG1 is a block diagram of an example of a system 100 for reducing probabilistic filter query latency, according to an embodiment. As illustrated, system 100 includes a first medium 115 (e.g., a disk having a KVS tree and a corresponding key-value set file 120), a second medium 110 (e.g., a memory having a cache segment 125 of the key-value set file 120), and processing circuitry 105 (e.g., a processor). Processing circuitry 105, second medium 110, and first medium 115 are all implemented in electronic hardware. As illustrated, the cross-hatched blocks of cache segment 125 correspond to segments being queried in probabilistic filter 130. Here, the segments correspond to partitioned files 120 or filters 130, such as may occur when a file is partitioned into blocks, memory pages (e.g., pages), or some other partition.
[0022] Processing circuitry 105 is arranged (e.g., hardwired or configured by software) to receive a query from a caller for probabilistic filter 130 stored on first medium 115. Here, the caller is an application, component, or other entity capable of making a request. For example, processing circuitry 105 may implement an operating system (OS) that manages disk access, and the caller is an application making a request to the OS. Thus, a user space (e.g., rather than kernel space) process may initiate a query via an OS call.
[0023] In an example, the query includes a fragment identifier for probabilistic filter 130. Here, the fragment identifier specifies which fragments of all fragments of probabilistic filter 130 are relevant to the query. A fragment is relevant to the query if it can provide results for the query. For example, probabilistic filter 130 may be a Bloom filter for a key value set spanning four virtual memory (VM) pages, where if the corresponding storage in the Bloom filter array for k hashes of the key value in the query to the Bloom filter is in the first and third VM pages, then the first and third VM pages are the relevant fragments of the Bloom filter for the query of the key value. Because the querying entity (e.g., a file system, an OS, a program, etc.) can perform Bloom hashing, that entity can also provide the fragment of interest for the query when making the call. In an example, the fragment identifier is a byte offset in file 120. In an example, the query includes the file identifier of file 120.
[0024] In the example, file 120 is a key value set file. A key value set (e.g., kvset) is a data structure used to store key value items in a KVS tree. A KVS tree is a tree data structure that contains nodes with connections between parent nodes and child nodes based on a predetermined derivation of key values rather than the content of the tree. A node contains a time-ordered sequence of key value sets, also known as KVS. A key value set contains key value pairs in a key value sorting structure. Once written, a key value set in a KVS tree is immutable. The KVS tree implements the write throughput of a WB tree while improving WB tree searches by maintaining key value sets in nodes, the key value sets containing sorted keys and key value metrics, such as Bloom filters. Therefore, in this example, file 120 contains at least one key value set that may contain a filter 130.
[0025] In an example, a key-value set file contains more than one KVS tree (e.g., components from more than one KVS tree (not necessarily all KVS trees), such as metadata, key-value sets, etc.). In an example, the probabilistic filter 130 is applied to a single KVS tree in the key-value set file. Combining multiple key-value sets into a single key-value set file or combining other data structures into a single file can take advantage of the characteristics of the environment. For example, if the operating system imposes significant additional overhead for file management, file loading, etc., it may be more efficient to combine several entities into a file to reduce these additional overheads.
[0026] In an example, a query includes a set of test parameters. Here, the test parameters indicate what the query will test against filter 130. For example, the test parameter can be an index into the Bloom filter where the bit of the key value can be found. In an example, the test parameter includes a position (e.g., in filter 130). In an example, the position is a bit offset within a segment.
[0027] Processing circuitry 105 is arranged to obtain cache fragments 125 of probabilistic filter 130 stored on second medium 110 in response to receiving a query. Here, cache fragments 125 are smaller than the entire probabilistic filter 130 stored on first medium 115 (e.g., file 120). Therefore, to obtain cache fragments 125 in response to the query, processing circuitry 105 may read cache fragments 125 from second medium 110. In an example, the fragments of probabilistic filter 130 are based on the representation of probabilistic filter 130 in second medium 110. Thus, while file 120 may be segmented into blocks defined by first medium 115 (e.g., disk), in second medium 110 (e.g., memory), the fragments are defined as memory page sizes. In an example, the fragments have a uniform size. In an example, the uniform size is a memory page size. In an example, the fragment identifiers are page identifiers. In an example, the fragment identifiers are memory addresses. In instances where the query includes a segment identifier, obtaining the cached segments 125 includes obtaining segments in the second media 110 for which the probabilistic filter corresponds to the segment identifier.
[0028] The processing circuitry 105 is arranged to perform a query on the cache fragment 125, resulting in a partial query result. In instances where the query includes test parameters, the partial query result includes results of a subset of the test parameters performed on the cache fragment 125. In instances where the test parameters include one or more positions (e.g., indices in a Bloom filter array), the subset of the test parameters includes a bit value (e.g., to be tested) for each position. In an example, the partial query result includes a list of fragment identifiers that are relevant to the query and are not in the cache fragment 125.
[0029] Processing circuitry 105 is arranged to initiate a retrieval of the remaining data for probabilistic filter 130 from first medium 115 to second medium 110 while simultaneously performing a query on cache fragment 125 without caller intervention. Here, the remaining data corresponds to the query and data not in cache fragment 125 (e.g., the portion of filter 130 not in cache fragment 125). Therefore, the caller does not need to make a separate request to load the remaining fragment from file 120. Reducing the number of calls made by the caller generally results in reduced overhead and latency for system 100. In an example, processing circuitry 105 is arranged to identify a stopping condition for probabilistic filter 130 in a partial query result and avoid retrieving the remaining data. This example illustrates a "short-circuiting" operation, in which a query can be answered using a partial query result. For example, in a Bloom filter having a cache fragment 125 indexed with a zero (e.g., null) key value, there is no need to load the remaining data because the key value is not in the set represented by the Bloom filter. In an example, the probabilistic filter is at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
[0030] Processing circuitry 105 is arranged to return partial query results to the caller. The partial query results represent a partial execution of the query against filter 130 and may identify which segments of filter 130 were omitted from the query execution because they were not present in second medium 110. Thus, the caller's request is partially satisfied relative to the probabilistic query, and the remaining segments of the query are also loaded from disk. In instances where the caller provides test parameters, the partial query results include results for a subset of the test parameters executed against cached segments 125. In this example, the partial query results include a list of segment identifiers that are relevant to the query and not present in cached segments 125.
[0031] In an example, processing circuitry 105 is arranged to, upon receiving a partial query result, such as from a caller, search a subset of test parameters for a stopping condition defined by probabilistic filter 130 (e.g., a condition defined to pause the search if true), and, if the stopping condition is not found within the subset of test parameters, search the segment of the segment identifier for the stopping condition (e.g., to stop the search). Here, the segment is resident in second media 110 as a result of the initial retrieval of the remaining data for the probabilistic filter. That is, the initial retrieval of the remaining data—e.g., while the caller is searching the partial query result to determine whether filter 130 indicates the possible presence of the queried key value—places the remaining data in the second media. Thus, a single result for the query provides the caller with both the result of the filter query on cached segment 125 and identification of the remaining segments that should have been loaded from first media 115 to second media 110 by this time, allowing the caller to perform the remaining filter query.
[0032] The check and extract technique described herein offers several advantages over conventional techniques that test whether a file page is cached (e.g., Linux fincore) or loads a non-cached file page (e.g., Linux fadvise). For example, the check and extract technique described herein can obtain page residency information—e.g., the value of a bit of interest in a cached page—and initiate a background load of a non-cached page in a single system call. Typically, techniques such as fincore or fadvise use at least three system calls to accomplish the same task, significantly reducing performance. For example, to complete the check and extract, conventional fincore and fadvise use one or more file reads from a cached page and ultimately a fadvise call for a non-cached page. Furthermore, the check and extract technique described herein can operate on non-consecutive pages within a file. Typically, techniques such as fincore and fadvise operate only on consecutive pages within a file. Furthermore, existing methods use multiple system calls, each operating on non-consecutive pages, significantly reducing performance. Furthermore, the check and extract technique described herein can specify the order in which file pages will be referenced. This provides an opportunity to optimize page loading. This information is not conveyed by existing methods (such as fadvise) that are limited to "random" and "sequential".
[0033] While the advantages described above are associated with file-based access techniques, the check and extract technique described herein also offers advantages over memory-based file access (e.g., when the file is memory-mapped). In this context, existing techniques (e.g., Linux mincore and Linux madvise) are at a disadvantage. For example, the check and extract technique described herein can obtain page residency information and initiate background loading of non-cached pages in a single system call. Furthermore, existing techniques use at least two system calls to accomplish the same task (e.g., calling mincore and then calling madvise). Furthermore, compared to other techniques (e.g., mincore and madvise) that typically operate on consecutive pages in a file, check and extract can operate on non-consecutive pages in a file. Furthermore, existing techniques use multiple system calls, each operating on non-consecutive pages, which again significantly degrades performance. Furthermore, check and extract can specify the order in which file pages will be referenced, providing an opportunity to optimize page loading. This information is typically not conveyed by existing techniques (e.g., madvise), which are limited to "random" and "sequential."
[0034] To illustrate the present technology in a real-world example, a Linux operating system with a Linux virtual file system (VFS) that supports a KVS tree is used in the following example, although other operating systems or file systems can be similarly modified. Each key-value set in the KVS tree can include a Bloom filter to track the key value associated with the item stored in that key-value set (e.g., a key-value pair or a mark-delete, where the mark-delete indicates that the value corresponding to the key value has been deleted). A Linux VFS can be implemented that exposes a key-value set stored on disk as a read-only file to user space processes and the Linux kernel. The Bloom filter in this key-value set file includes a contiguous sequence of bytes starting at a known offset (in bytes) and having a known size (in bytes). According to standard file operations, data read from the key-value set file is placed in a standard Linux page cache (e.g., in memory) in units that are each the size of a virtual memory (VM) page. Each such unit starts at a zero-based offset in the key-value set file (which is a multiple of the VM page size). For example, given a VM page size of 4096 bytes, pages in the key set file begin at offsets 0, 4096, 8192, etc. In this example, as with other files, the user space process can optionally use the standard Linux mmap system call to memory map the key set file into the process's virtual address space. Here, the user space process can access the key set data (including the Bloom filter) via memory read commands, and the operating system (or VM manager) manages the disk-to-memory loading of the underlying bits.
[0035] Figures 2 to 4 The examples described using the following context are presented. The following definitions assume a bloom filter B in a key set file F and a hash function H that maps a key K to bits in B:
[0036] BF_FILE_OFFSET_BYTE(F,B) is the byte offset in the key-value set file F of the first byte of Bloom filter B.
[0037] BF_SIZE_BYTE(F,B) is the size of the Bloom filter B in the key-value set file F (in bytes).
[0038] • BF_OFFSET_BIT(B,H,K) is the bit offset in the Bloom filter B selected by performing the hash function H on the key value K.
[0039] VMPAGE_SIZE_BYTE(F) is the size of the pages in the key set file F (in bytes).
[0040] As described herein, all byte offsets in the key-value set file F are zero-based. That is, the first byte in the key-value set file F is defined to be at offset zero (0). Furthermore, as described, all bit offsets in the Bloom filter B are also zero-based; the first bit in the Bloom filter B is defined to be at offset zero (0). Although these zero-based indices are used herein, they are not required (e.g., the first bit could be at offset one (1)). Furthermore, as used herein, floor(x) is defined to be the largest integer less than or equal to the real number x.
[0041] Given these definitions, the following can be calculated:
[0042] BFPAGE_FILE_OFFSET_FIRST_BYTE(F,B)=floor(BF_FILE_OFFSET_BYTE(F,B) / VMPAGE_SIZE_BYTE(F))*VMPAGE_SIZE_BYTE(F), which is the byte offset of the page in the key set file F containing the first byte of Bloom filter B.
[0043] BFPAGE_FILE_OFFSET_LAST_BYTE(F,B)=floor((BF_FILE_OFFSET_BYTE(F,B)+BF_SIZE_BYTE(F,B)-1) / VMPAGE_SIZE_BYTE(F))*VMPAGE_SIZE_BYTE(F), which is the byte offset of the page in the key set file F containing the last byte of Bloom filter B.
[0044] BFPAGE_COUNT(F,B)=((BFPAGE_FILE_OFFSET_LAST_BYTE(F,B)−BFPAGE_FILE_OFFSET_FIRST_BYTE(F,B)) / VMPAGE_SIZE_BYTE(F))+1, which is the count of pages in the key set file F that contain at least one byte of Bloom filter B.
[0045] HBYTE_FILE_OFFSET_BYTE(F,B,H,K)=BF_FILE_OFFSET_BYTE(F,B)+floor(BF_OFFSET_BIT(B,H,K) / 8), which is the byte offset of the byte in the key set file F containing the bit in the bloom filter B selected by performing the hash function H on the key K.
[0046] HBYTE_OFFSET_BIT(F,B,H,K)=BF_OFFSET_BIT(B,H,K) modulo 8, which is the bit offset in bytes of the key set file F at offset HBYTE_FILE_OFFSET_BYTE(F,B,H,K) (which is the bit in the Bloom filter B selected by performing the hash function H on the key K).
[0047] HPAGE_FILE_OFFSET_BYTE(F,B,H,K)=floor(HBYTE_FILE_OFFSET_BYTE(F,B,H,K) / VMPAGE_SIZE_BYTE(F))*VMPAGE_SIZE_BYTE(F), which is the byte offset of the page in the key set file F containing the bits in the Bloom filter B selected by performing the hash function H on the key value K.
[0048] HPAGE_OFFSET_BIT(F,B,H,K)=((8*BF_FILE_OFFSET_BYTE(F,B))+BF_OFFSET_BIT(B,H,K)) modulo(8*VMPAGE_SIZE_BYTE(F)), which is the bit offset in the page of the key value set file F at byte offset HPAGE_FILE_OFFSET_BYTE(F,B,H,K) (which is the bit in the Bloom filter B selected by performing the hash function H on the key value K).
[0049] Once these values are calculated, they can be used in various ways. For example, to read a bit in a Bloom filter B selected by performing a hash function H on a key value K, the following operation can be used:
[0050] Read the page in the key value set file F starting at byte offset HPAGE_FILE_OFFSET_BYTE(F,B,H,K) into the memory buffer; and then
[0051] - Read the bit of interest from the memory buffer at bit offset HPAGE_OFFSET_BIT(F,B,H,K).
[0052] In another example, to read a bit in a Bloom filter B selected by performing a hash function H on a key value K, the following operation may be used:
[0053] Read the byte in the key set file F (at byte offset HBYTE_FILE_OFFSET_BYTE(F,B,H,K)) into the memory buffer; and then
[0054] - Read the bit of interest from the memory buffer (at bit offset HBYTE_OFFSET_BIT(F, B, H, K)).
[0055] As noted above, the context in which several examples are presented below includes these definitions and calculations.
[0056] Figure 2 is a swim lane diagram of an example of a control flow 200 for reducing probabilistic filter query latency according to an embodiment. The following example relates to a file-based inspection and extraction technique in the context of a Linux OS. This technique determines which fragments, if any, of a specified set of key-value set file pages containing Bloom filter data are in the Linux page cache, and asynchronously loads the remainder of those pages only when needed. In addition, the technique provides information about the values of specified bits in pages in the page cache (e.g., cache pages). In an example, the inspection and extraction technique is part of a VFS. In an example, the technique is performed by a user space process via a system call. In an example, the technique is performed by the Linux kernel via a direct method call (e.g., a standard C language function call).
[0057] Control flow 200 illustrates the operation of a check and extract function between a requester (e.g., a caller), an operating system or file system, a cache medium (e.g., a memory or memory subsystem), and a storage medium (e.g., a disk or disk subsystem). After the caller performs the check and extract function as part of a Bloom query (operation 205), a cached portion of the Bloom filter array is determined (operation 210). The portion of the Bloom filter array in the cache is read (operation 215) and a Bloom query is performed on it (operation 220). If the result of operation 220 indicates that the query term is not in the Bloom filter, the handler (e.g., the operating system or file system) returns an indication that the query term (e.g., an item) is not in the key value set (operation 225). In this example, the indication is returned as part of a partial query result.
[0058] If the handler is unable to fully resolve the query (e.g., the cached portion of the Bloom filter indicates that the query term may be in the key value set), then an asynchronous load of the non-cached portion of the Bloom filter array is initiated (operation 230). Here, asynchronous means that the caller does not block (e.g., wait) for the operation to complete before moving to another operation. Therefore, the handler can immediately provide the query results (e.g., partial query results) of the cached portion (operation 235) without having to wait for the non-cached portion of the Bloom filter array to be moved from the storage medium to the cache medium (operation 240).
[0059] The following describes an example of file-based inspection and extraction using pseudocode. First, the following structure and prototype are used in this technology:
[0060]
[0061]
[0062] in:
[0063] fd is the handle to the open key-value set file, which is input to the inspect and extract functions (e.g., the file descriptor returned by the Linux VFS in response to the open system call).
[0064] pagev is an array of page_info structures, which is the input to the function. Here, each element of pagev specifies the byte offset of a page in the key set file fd (e.g., "page_offset") and the bit offset in that page (e.g., "bit_offset"), as described below.
[0065] • page_cached is an array of boolean values set as output of the function, as described below.
[0066] • bit_set is an array of Boolean values set as output of the function, as described below.
[0067] • count is the integer number of elements in the pagev, page_cached, and bit_set arrays, which is the input to the function.
[0068] In the following, given an array A, notation A[i] refers to the i-th element of A, where the first element is A[0], i.e., the array elements are zero-based. In view of the above, the following operations are performed by file-based inspection and extraction techniques:
[0069]
[0070]
[0071] In the example, the file_check_fetch function assumes that the non-cached key set file pages will be read in the order they appear in the array pagev, and this can be taken into account to optimize loading of these pages (e.g., selecting the next page in the sequence to load). To perform a Bloom query using the calls described above, a user-space process (or other caller) can perform the following operations. Given a Bloom filter B in a key set file F and an array H of J hash functions H[0], ..., H[J-1] (each hash function mapping a key to a bit in B), a Bloom query for a key K can be performed via the following operations:
[0072]
[0073]
[0074]
[0075] Figure 3 is a flow chart of an example of a method 300 for reducing probabilistic filter query latency according to an embodiment. The operations of method 300 are performed using computer hardware such as described above or below. As previously described, the user space process may optionally use the standard Linux mmap system call or the like to memory map the key value set file into its virtual memory address space. In this case, the user space process may access the key value set data, including the Bloom filter, via memory read operations. Query latency may be improved using a memory-based check and extraction function that operates similarly to the file-based check and extraction functions described above. In an example, the file-based check and extraction pseudocode example may also be used with a memory-mapped file.
[0076] A Bloom query is received (operation 305). The query handler can calculate the fragments from the key-value set file that are relevant to the query (operation 310). In this example, the query provides a file identifier and a query term (e.g., a key in a key-value set query), and the OS calculates which portion of the key-value set file contains a specific portion of the Bloom filter array for a key hash (e.g., an index into an array corresponding to the results of k hashes). In a memory-mapped file, this determination involves calculating the bit offsets of multiple array indices from the byte offset of the page of the Bloom filter in the memory-mapped key-value set file.
[0077] Once the relevant segments for the filter are determined, they are processed. This process includes selecting the next segment (operation 315) and determining whether that segment is in the cache (operation 320). If the segment is not in the cache, the segment is marked for retrieval (operation 345). In this example, marking a segment for retrieval does not actually initiate retrieval of the segment, but rather indicates that the segment will be retrieved if additional data is available to complete the query. In either case (e.g., retrieving the segment or marking without retrieval), operation 345 is asynchronous.
[0078] If the fragment is in the cache, the fragment is tested to determine whether the filter passes (operation 325). Using a standard Bloom filter, if any array index corresponding to the key value is set to zero, the query fails. If the filter fails, method 300 can be terminated and an indication that the query term is not part of the set is returned (operation 330). However, if the filter passes, and more fragments exist (operation 335), processing continues until no fragments exist or the filter fails.
[0079] After the segment has been processed and the method 300 cannot exit due to the filter not being passed, the marked segment is loaded from disk to memory (operation 340). At this point, the method 300 exits and returns the partial result to the caller.
[0080] The following describes a memory-based check and extraction function that determines which, if any, of a specified set of memory-mapped key-value set file pages containing Bloom filter data are in the Linux page cache and asynchronously loads the remainder of those pages only when they are needed to complete a query. The example function also provides information about the value of a specified bit in the cache page. In this example, the memory-based check and extraction function is implemented in the VFS and executed by a user-space process via a system call. The function uses the following data structures and prototypes:
[0081]
[0082] in:
[0083] addrv is an array of page_addr_info structures that is input to the method; each element of addrv specifies the process virtual memory address (page_addr) corresponding to the first byte of a memory-mapped key set file page and the bit offset in that page (bit_offset), as described below.
[0084] • page_cached is an array of Boolean values set as output of the method, as described below.
[0085] • bit_set is an array of Boolean values set as output of the method, as described below.
[0086] • count is the integer number of elements in the addrv, page_cached, and bit_set arrays, which is the input to the method.
[0087] In the following, given an array A, notation A[i] refers to the i-th element of A, where the first element is A[0]. Given the above, the following operations are performed using memory-based inspection and extraction techniques:
[0088]
[0089]
[0090]
[0091] In the example, the mem_check_fetch function assumes that the non-cached key set file pages will be read in the order they appear in the array addrv, and this can be taken into account to optimize loading of these pages. In the example, mem_check_fetch allows the addrv array to specify addresses associated with (mapped to) pages in more than one key set file. The following pseudo code illustrates how to perform a Bloom query using the mem_check_fetch function. Given a Bloom filter B in a memory-mapped key set file F and an array H of J hash functions H[0], ..., H[J-1] (each hash function maps a key value to a bit in B), a Bloom query for a key value K can be performed via the following operations:
[0092]
[0093]
[0094]
[0095]
[0096] The embodiments of mem_check_fetch described above assume that the key set file is fully memory mapped (e.g., the entire file is mapped) to a contiguous sequence of virtual memory addresses. If the key set file is partially memory mapped, e.g., only the portion containing the Bloom filter data is mapped, then the memory offsets used in the above techniques are adjusted accordingly.
[0097] Figure 4 is a flow chart of an example of a method 400 for reducing probability filter query latency according to an embodiment. The operations of the method 400 are performed using computer hardware such as described above or below. Figure 2 and 3The described technique calls for an explicit and conditional asynchronous load of the probabilistic filter data from disk to memory because the calling process expects an asynchronous load to occur unless the cached portion of the probabilistic filter can be used to answer the query. Therefore, for memory mapped key value set files, the mem_check_fetch function allows a user-space process to explicitly initiate asynchronous loading of pages containing Bloom filter data into the Linux page cache. An alternative or supplemental technique uses implicit asynchronous loading of non-cached fragments from the probabilistic filter. For example, a memory-based "fetch group" function allows a user-space process to implicitly initiate asynchronous loading of pages containing Bloom filter data into the Linux page cache by defining a group of pages as a group (e.g., a fetch group) and loading the entire group when there is a page fault in a member of the group.
[0098] Method 400 begins by generating extraction groups (operation 405). The extraction groups include pages in the file that are related to each other. The extraction groups can be generated by specifying the pages to be grouped and storing the page identifications in a data structure (e.g., a table, an array, etc.). In an example, the pages are related through their use in storing a probabilistic filter.
[0099] Once the fetch group is generated, it is consulted when a page fault occurs (operation 410). Here, a page fault is a reference to a page that is not resident in memory (e.g., it needs to be loaded from disk to be used). If a page fault occurs, the fetch group is checked to determine if the faulting page is in the fetch group (operation 420). If so, the other pages in the fetch group are asynchronously loaded (operation 440). After initiating the asynchronous load, or if the faulting page is not in the fetch group, the method 400 ends. This technique is implicit because the process only requests pages to perform a Bloom (or other probabilistic) query, and when the first page checked is not in cache, the entire non-cached page is asynchronously loaded.
[0100] As explained below, the mem_fetch_group function operates on a memory-mapped key set file. Like the file_check_fetch and mem_check_fetch functions, the mem_fetch_group function can be implemented in the VFS and executed by a user space process via a system call. The following is the prototype of the mem_fetch_group function:
[0101] mem_fetch_group(address_type*addrv,integer count;)
[0102] in:
[0103] addrv is an array of address_type values, which is the input to the method; each element in addrv specifies the process virtual memory address corresponding to the first byte of a memory-mapped key set file page.
[0104] count is the integer number of elements in the addrv array, which is the input to the method.
[0105] In the following, given an array A, notation A[i] refers to the i-th element of A, where the first element is A[0]. Given the above, the following operations are performed to implement the extraction group technique:
[0106] create an entry in a FetchGroup table identifying the key-value setfile pages associated with addresses addrv[0],…,addrv[count-1] as allbelonging to the same fetch group.
[0107] DONE;
[0108] After populating the FetchGroup table (e.g., defining a fetch group) in response to a VM page fault instigating a page load from a memory-mapped key set file, the VFS performs the following operations:
[0109]
[0110]
[0111] In an example, the non-cached key set file pages in a fetch group are read in the order specified by the addrv input to the mem_fetch_group execution that generates the corresponding FetchGroup table entry. A handler (e.g., a VFS) can use this order to optimize loading these pages. In an example, the mem_fetch_group function allows the addrv array to specify addresses that correspond to (e.g., map to) pages in more than one key set file. The following pseudocode illustrates how to perform a Bloom query using the mem_fetch_group function. Given a Bloom filter B in a memory-mapped key set file F and an array H of J hash functions H[0], ..., H[J-1] (each hash function maps a key value to a bit in B), a Bloom query for a key value K can be performed as follows:
[0112]
[0113] First, perform the following steps to create an extraction group for Bloom filter B:
[0114]
[0115]
[0116] Then, at some time in the future, a Bloom query for key K is performed as follows:
[0117]
[0118]
[0119] The above pseudo code assumes that the key set file is fully memory mapped to a contiguous sequence of virtual memory addresses. If the key set file is partially memory mapped - for example, only the portion of the file containing the Bloom filter data is mapped - then the memory offsets used in the above algorithm are adjusted to that situation.
[0120] The conditional nature of the fetch group technique is a characteristic that distinguishes it from other prefetch techniques that attempt to load file data from disk into cache in advance when needed. Therefore, if accessing one of the file pages results in a page fault, these other techniques are not suitable for loading a well-defined set of file pages.
[0121] Although the above examples use a key-value set file read under Linux, these techniques are not Linux-specific; all techniques can be applied to any operating system that caches file pages and provides memory-mapped files. Variations of file_check_fetch and mem_check_fetch can also be applied to other probabilistic filters to test set membership. For example, these functions can be extended to a counting Bloom filter—an array comprising M f-bit counters and J different hash functions, each mapping a set element to one of the M counters—or to a cuckoo hash table or cuckoo filter—an array comprising M f-bit values (where the value is a key value in the case of a cuckoo hash table and a key-value fingerprint in the case of a cuckoo filter) and two different hash functions, each mapping a set element to one of the M f-bit values. mem_fetch_group can be applied to any data structure in a memory-mapped file stored in one or more known pages, and where it is beneficial to initiate an asynchronous load of a non-cached page comprising the data structure when a page fault to any of these pages is processed. Thus, mem_fetch_group can benefit a wide range of applications, not just probabilistic filters for testing set membership.
[0122] Figure 5is a flow chart of an example of a method 500 for reducing probabilistic filter query latency, according to an embodiment. The operations of method 500 are performed using computer hardware such as described above or below.
[0123] At operation 505, a query for a probabilistic filter stored on a first medium is received from a caller. In an example, receiving the query includes receiving a segment identifier. In an example, the segment identifier specifies which segments of the probabilistic filter are relevant to the query. In an example, the segment identifier is a byte offset within a file. In an example, the query includes a file identifier for the file.
[0124] In an example, the file is a key-value set file. In an example, the key-value set file includes key-value sets from more than one KVS tree. In an example, the probabilistic filter is applied to a single KVS tree in the key-value set file. In an example, a fetch group data structure is maintained for pages of the key-value set file. In this example, pages in the fetch group data structure of the key-value set file are retrieved in response to a page fault on a page in the fetch group data structure.
[0125] In an example, the query includes a set of test parameters. In an example, the test parameters include a position (e.g., an index into a Bloom filter array, a bank in a Cuckoo filter, an address, etc.). In an example, the position is a bit offset within a segment. In an example, a subset of the test parameters includes a bit value in each position.
[0126] At operation 510, in response to receiving the query, a cached fragment of a probabilistic filter stored on a second medium is obtained. In an example, the cached fragment is less than the entire probabilistic filter stored on the first medium. In an example, the probabilistic filter provides a set membership determination that is conclusive when determining that an element is not in the set. In an example, the probabilistic filter is at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
[0127] In an example, receiving the query includes receiving a segment identifier. In an example, the segment identifier specifies which segments of the total segments of the probabilistic filter are relevant to the query. In an example, obtaining the cached segment includes obtaining a segment of the probabilistic filter in the second media that corresponds to the segment identifier.
[0128] In an example, the segments of the probabilistic filter are based on representations of the probabilistic filter in the second medium. In an example, the segments have a uniform size. In an example, the uniform size is a memory page size. In an example, the segment identifier is a memory page identifier. In an example, the segment identifier is a memory address.
[0129] At operation 515, the query is executed on the cache fragment, resulting in a partial query result.
[0130] At operation 520, retrieval of the remaining data for the probabilistic filter from the first medium to the second medium is initiated (e.g., started) without caller intervention. In an example, the remaining data corresponds to the query and data not in the cache fragment. In an example, retrieval of the remaining data for the probabilistic filter includes identifying a stop condition for the probabilistic filter in the partial query result and refraining from (e.g., suspending or not taking further action related thereto) retrieving the remaining data.
[0131] At operation 525, the partial query results are returned to the caller. In instances where the query includes test parameters, the partial query results include results of a subset of the test parameters performed on the cached fragments. In one embodiment, the partial query results include a list of fragment identifiers that are relevant to the query and not in the cached fragments. In one embodiment, the caller receives the partial query results, searches the subset of test parameters for a stopping condition defined by the probabilistic filter, and searches for the stopping condition within the fragments of the fragment identifiers when the stopping condition is not found in the subset of test parameters. Here, the fragments are resident in the second media due to the retrieval of the remaining data that initiated the probabilistic filter.
[0132] Figure 6A block diagram illustrates an example machine 600 on which any one or more of the techniques (e.g., methodologies) discussed herein may be performed. As described herein, an example may include or be operable by logic or several components or mechanisms within the machine 600. A circuit system (e.g., processing circuitry) is a collection of circuits implemented in the tangible physical form of the machine 600, including hardware (e.g., simple circuits, gates, logic, etc.). The membership of a circuit system may change over time. A circuit system includes components that, when operated, can perform a specified operation individually or in combination. In an example, the hardware of the circuit system may be immutably designed to implement a specific operation (e.g., hard-wired). In an example, the hardware of the circuit system may include variably connected physical components (e.g., execution units, transistors, simple circuits, etc.), including machine-readable media that is physically modified (e.g., magnetic, electrical, or removable placement of particles of constant mass, etc.) to encode instructions for a specific operation. When the physical components are connected, the fundamental electrical properties of the hardware component change, for example, from an insulator to a conductor, or vice versa. Instructions enable embedded hardware (e.g., an execution unit or a loading mechanism) to generate a member of a circuit system in hardware via a variable connection to perform a portion of a specific operation when in operation. Thus, in an example, the machine-readable media element is part of the circuit system or is communicatively coupled to other components of the circuit system when the device is in operation. In an example, any of the physical components can be used in more than one member of more than one circuit system. For example, in operation, an execution unit can be used in a first circuit in a first circuit system at one point in time and reused by a second circuit in the first circuit system at a different time, or reused by a third circuit in the second circuit system. The following are additional examples of these components of machine 600.
[0133] In some embodiments, the machine 600 may be connected (e.g., using a network) to other machines. In a networked deployment, the machine 600 may operate as a server machine, a client machine, or both in a server-client network environment. In one example, the machine 600 may function as a peer machine in a peer-to-peer (P2P) (or other distributed) network environment. The machine 600 may be a personal computer (PC), a tablet PC, a set-top box (STB), a personal digital assistant (PDA), a mobile phone, a network appliance, a network router, a switch, or a bridge, or any other machine capable of executing instructions (sequentially or otherwise) that specify actions to be taken by that machine. Although a single machine is illustrated, the term "machine" shall also be taken to include any collection of machines that individually or collectively execute a set (or multiple sets) of instructions to perform any one or more of the methodologies discussed herein, such as cloud computing, software as a service (SaaS), or other computer cluster configurations.
[0134] The machine (e.g., a computer system) 600 may include a hardware processor 602 (e.g., a central processing unit (CPU), a graphics processing unit (GPU), a hardware processor core, or any combination thereof), a main memory 604, a static memory (e.g., memory or storage for firmware, microcode, a basic input / output system (BIOS), a unified extensible firmware interface (UEFI), etc.) 606, and a mass storage device 608 (e.g., a hard drive, a tape drive, a flash memory device, or other block device), some or all of which may communicate with each other via an interconnect (e.g., a bus) 630. The machine 600 may further include a display unit 610, an alphanumeric input device 612 (e.g., a keyboard), and a user interface (UI) navigation device 614 (e.g., a mouse). In an example, the display unit 610, the input device 612, and the UI navigation device 614 may be a touch screen display. The machine 600 may further include a storage device (e.g., a drive unit) 608, a signal generating device 618 (e.g., a speaker), a network interface device 620, and one or more sensors 616, such as a global positioning system (GPS) sensor, a compass, an accelerometer, or other sensors. The machine 600 may include an output controller 628 (e.g., a serial (e.g., universal serial bus (USB), parallel, or other wired or wireless (e.g., infrared (IR), near field communication (NFC)), etc.) connection) to communicate with or control one or more peripheral devices (e.g., a printer, a card reader, etc.).
[0135] The processor 602, main memory 604, static memory 606, or a register of the mass storage device 608 may be or include a machine-readable medium 622 on which one or more sets of data structures or instructions 624 (e.g., software) embodying or utilized by any one or more techniques or functions described herein are stored. The instructions 624 may also reside, completely or at least partially, within any of the registers of the processor 602, main memory 604, static memory 606, or mass storage device 608 during execution thereof by the machine 600. In an example, one or any combination of the hardware processor 602, main memory 604, static memory 606, or mass storage device 608 may constitute the machine-readable medium 622. Although the machine-readable medium 622 is illustrated as a single medium, the term "machine-readable medium" may include a single medium or multiple media (e.g., a centralized or distributed database, or associated caches and servers) configured to store one or more instructions 624.
[0136] The term "machine-readable medium" may include any medium capable of storing, encoding, or carrying instructions that are executed by machine 600 and cause machine 600 to perform any one or more of the techniques of the present invention, or capable of storing, encoding, or carrying data structures used by or associated with such instructions. Non-limiting examples of machine-readable media may include solid-state memory, optical media, magnetic media, and signals (e.g., radio frequency signals, other photon-based signals, acoustic signals, etc.). In an example, non-transitory machine-readable media includes machine-readable media having a plurality of particles that have an invariant (e.g., stationary) mass and are therefore composite. Thus, non-transitory machine-readable media is machine-readable media that does not include a transitory propagating signal. Specific examples of non-transitory machine-readable media may include: non-volatile memory, such as semiconductor memory devices (e.g., electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM)), flash devices; magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.
[0137] The instructions 624 may further be transmitted or received over a communication network 626 using a transmission medium via a network interface device 620 utilizing any of a number of transmission protocols, such as frame relay, Internet Protocol (IP), Transmission Control Protocol (TCP), User Datagram Protocol (UDP), Hypertext Transfer Protocol (HTTP), etc. Example communication networks may include a local area network (LAN), a wide area network (WAN), a packet data network (e.g., the Internet), a mobile telephone network (e.g., a cellular network), a plain old telephone (POTS) network, and a wireless data network (e.g., the Institute of Electrical and Electronics Engineers (IEEE) 802.11 series of standards (known as ), IEEE 802.16 series standards (called ), IEEE 802.15.4 family of standards, peer-to-peer (P2P) networks, etc.). In an example, network interface device 620 may include one or more physical jacks (e.g., Ethernet, coaxial, or telephone jacks) or one or more antennas to connect to communication network 626. In an example, network interface device 620 may include multiple antennas to enable wireless communication using at least one of single-input, multiple-output (SIMO), multiple-input, multiple-output (MIMO), or multiple-input, single-output (MISO) technology. The term "transmission media" shall be taken to include any intangible medium capable of storing, encoding, or carrying instructions for execution by machine 600, including digital or analog communication signals or other intangible media that facilitate communication of such software. Transmission media is machine-readable media.
[0138] Additional Notes & Examples
[0139] Example 1 is a system for reducing latency in probabilistic filter queries, the system comprising a processing circuit system for: receiving a query for a probabilistic filter stored on a first medium from a caller; obtaining a cache fragment of the probabilistic filter stored on a second medium in response to receiving the query, wherein the cache fragment is smaller than the entire probabilistic filter stored on the first medium, wherein the probabilistic filter provides a conclusive determination of set membership when it is determined that an element is not in the set; executing the query on the cache fragment, thereby resulting in a partial query result; initiating retrieval of remaining data for the probabilistic filter from the first medium to the second medium without intervention by the caller, wherein the remaining data corresponds to the query and data not in the cache fragment; and transmitting the partial query result back to the caller.
[0140] In Example 2, the subject matter of Example 1 includes, wherein to receive the query, the processing circuitry receives a segment identifier that specifies which segments of all segments of the probabilistic filter are relevant to the query.
[0141] In example 3, the subject matter of example 2 includes, wherein the segment identifier is a byte offset in the file.
[0142] In Example 4, the subject matter of Example 3 includes, wherein the query includes a file identifier of the file.
[0143] In example 5, the subject matter of examples 3-4 includes, wherein the file is a key-value set file.
[0144] In Example 6, the subject matter of Example 5 includes, wherein the processing circuitry is further to: maintain a fetch group data structure for pages of the key value set file; and retrieve pages in the fetch group data structure of the key value set file in response to a page fault on a page in the fetch group data structure.
[0145] In example 7, the subject matter of examples 5-6 includes, wherein the key-value set file includes more than one KVS tree.
[0146] In Example 8, the subject matter of Example 7 includes, wherein the probabilistic filter is applied to a single KVS tree in the key-value set file.
[0147] In Example 9, the subject matter of Examples 2-8 includes, wherein to obtain the cache segment, the processing circuitry obtains a segment in the second media for which the probabilistic filter corresponds to the segment identifier.
[0148] In Example 10, the subject matter of Examples 1-9 includes, wherein the segment of the probabilistic filter is based on a representation of the probabilistic filter in the second media.
[0149] In embodiment 11, the subject matter of example 10 includes, wherein the fragments are of uniform size.
[0150] In Example 12, the subject matter of Example 11 includes, wherein the uniform size is a memory page size.
[0151] In Example 13, the subject matter of Example 12 includes, wherein the segment identifier is a page identifier.
[0152] In example 14, the subject matter of examples 11-13 includes, wherein the segment identifier is a memory address.
[0153] In example 15, the subject matter of examples 1-14 includes, wherein the query includes a set of test parameters, and wherein the partial query results include results of a subset of the test parameters performed on the cache segment.
[0154] In Example 16, the subject matter of Example 15 includes, wherein the test parameter includes a position.
[0155] In Example 17, the subject matter of Example 16 includes, wherein the position is a bit offset in the segment.
[0156] In Example 18, the subject matter of Example 17 includes, wherein the subset of the test parameters includes a bit value in each position.
[0157] In Example 19, the subject matter of Examples 15-18 includes, wherein the partial query results include a list of segment identifiers that are relevant to the query and are not in the cached segments.
[0158] In Example 20, the subject matter of Example 19 includes, wherein the processing circuit system is further used to: receive the partial query results by the caller; search the test parameter subset in the partial query results for a stopping condition defined by the probabilistic filter; and when the stopping condition is not found in the test parameter subset, search for the stopping condition within a segment of the segment identifier that is resident in the second media as a result of the retrieval of the remaining data that initiated the probabilistic filter.
[0159] In Example 21, the subject matter of Examples 1-20 includes, wherein to initiate retrieval of remaining data for the probabilistic filter, the processing circuitry identifies a stopping condition for the probabilistic filter in the partial query results and abandons the retrieval of the remaining data.
[0160] In Example 22, the subject matter of Examples 1-21 includes, wherein the probabilistic filter is at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
[0161] Example 23 is a method for reducing latency in probabilistic filter queries, the method comprising: receiving a query for a probabilistic filter stored on a first medium from a caller; in response to receiving the query, obtaining a cache fragment of the probabilistic filter stored on a second medium, wherein the cache fragment is smaller than the entire probabilistic filter stored on the first medium, wherein the probabilistic filter provides a set membership determination that is conclusive when it is determined that an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result; initiating retrieval of remaining data for the probabilistic filter from the first medium to the second medium without intervention by the caller, wherein the remaining data corresponds to the query and data not in the cache fragment; and transmitting the partial query result back to the caller.
[0162] In Example 24, the subject matter of Example 23 includes, wherein receiving the query comprises receiving a segment identifier that specifies which segments of all segments of the probabilistic filter are relevant to the query.
[0163] In example 25, the subject matter of example 24 includes, wherein the segment identifier is a byte offset in the file.
[0164] In Example 26, the subject matter of Example 25 includes, wherein the query includes a file identifier of the file.
[0165] In example 27, the subject matter of examples 25-26 includes, wherein the file is a key-value set file.
[0166] In Example 28, the subject matter of Example 27 includes maintaining a fetch group data structure for pages of the key value set file; and retrieving pages in the fetch group data structure of the key value set file in response to a page fault on a page in the fetch group data structure.
[0167] In Example 29, the subject matter of Examples 27-28 includes, wherein the key-value set file includes more than one KVS tree.
[0168] In Example 30, the subject matter of Example 29 includes, wherein the probabilistic filter is applied to a single KVS tree in the key-value set file.
[0169] In Example 31, the subject matter of Examples 24-30 includes, wherein obtaining the cached segment comprises obtaining a segment in the second media for which the probabilistic filter corresponds to the segment identifier.
[0170] In Example 32, the subject matter of Examples 23-31 includes, wherein the segment of the probabilistic filter is based on a representation of the probabilistic filter in the second media.
[0171] In embodiment 33, the subject matter of embodiment 32 includes, wherein the fragments are of uniform size.
[0172] In Example 34, the subject matter of Example 33 includes, wherein the uniform size is a memory page size.
[0173] In Example 35, the subject matter of Example 34 includes, wherein the segment identifier is a page identifier.
[0174] In example 36, the subject matter of examples 33-35 includes, wherein the segment identifier is a memory address.
[0175] In example 37, the subject matter of examples 23-36 includes, wherein the query includes a set of test parameters, and wherein the partial query results include results of a subset of the test parameters performed on the cache segment.
[0176] In Example 38, the subject matter of Example 37 includes, wherein the test parameter includes a position.
[0177] In Example 39, the subject matter of Example 38 includes, wherein the position is a bit offset in the segment.
[0178] In Example 40, the subject matter of Example 39 includes, wherein the subset of the test parameters includes a bit value in each position.
[0179] In example 41, the subject matter of examples 37-40 includes, wherein the partial query results include a list of segment identifiers that are relevant to the query and are not in the cache segment.
[0180] In Example 42, the subject matter of Example 41 includes: receiving the partial query results by the caller; searching the subset of test parameters in the partial query results for a stopping condition defined by the probabilistic filter; and when the stopping condition is not found in the subset of test parameters, searching for the stopping condition within a segment of the segment identifier that is resident in the second media as a result of the retrieval of the remaining data that initiated the probabilistic filter.
[0181] In example 43, the subject matter of examples 23-42 includes, wherein initiating retrieval of remaining data for the probabilistic filter includes identifying a stopping condition for the probabilistic filter in the partial query results and abandoning the retrieval of the remaining data.
[0182] In Example 44, the subject matter of Examples 23-43 includes, wherein the probabilistic filter is at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
[0183] Example 45 is a machine-readable medium comprising instructions that, when executed by a machine, cause the machine to perform any of the methods of Examples 23-44.
[0184] Example 46 is a system including components for performing any of the methods of Examples 23 to 44.
[0185] Example 47 is a machine-readable medium comprising instructions for reducing probability filter query latency, the instructions, when executed by the processing circuit system, causing the processing circuit system to perform operations including: receiving a query for a probability filter stored on a first medium from a caller; in response to receiving the query, obtaining a cache fragment of the probability filter stored on a second medium, wherein the cache fragment is smaller than the entirety of the probability filter stored on the first medium, wherein the probability filter provides a set membership determination that is conclusive when it is determined that an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result; initiating retrieval of remaining data for the probability filter from the first medium to the second medium without intervention by the caller, wherein the remaining data corresponds to the query and data not in the cache fragment; and transmitting the partial query result back to the caller.
[0186] In example 48, the subject matter of example 47 includes, wherein receiving the query comprises receiving a segment identifier that specifies which segments of all segments of the probabilistic filter are relevant to the query.
[0187] In example 49, the subject matter of example 48 includes, wherein the segment identifier is a byte offset in the file.
[0188] In example 50, the subject matter of example 49 includes, wherein the query includes a file identifier of the file.
[0189] In example 51, the subject matter of examples 49-50 includes, wherein the file is a key-value set file.
[0190] In Example 52, the subject matter of Example 51 includes, wherein the operations comprise: maintaining a fetch group data structure for pages of the key value set file; and retrieving pages in the fetch group data structure of the key value set file in response to a page fault on a page in the fetch group data structure.
[0191] In example 53, the subject matter of examples 51-52 includes, wherein the key-value set file includes more than one KVS tree.
[0192] In Example 54, the subject matter of Example 53 includes, wherein the probabilistic filter is applied to a single KVS tree in the key-value set file.
[0193] In example 55, the subject matter of examples 48-54 includes, wherein obtaining the cached segment comprises obtaining a segment in the second media for which the probabilistic filter corresponds to the segment identifier.
[0194] In Example 56, the subject matter of Examples 47-55 includes, wherein the segment of the probabilistic filter is based on a representation of the probabilistic filter in the second media.
[0195] In Example 57, the subject matter of Example 56 includes, wherein the fragments are of uniform size.
[0196] In Example 58, the subject matter of Example 57 includes, wherein the uniform size is a memory page size.
[0197] In Example 59, the subject matter of Example 58 includes, wherein the segment identifier is a page identifier.
[0198] In example 60, the subject matter of examples 57-59 includes, wherein the segment identifier is a memory address.
[0199] In example 61, the subject matter of examples 47-60 includes, wherein the query includes a set of test parameters, and wherein the partial query results include results of a subset of the test parameters performed on the cache segment.
[0200] In Example 62, the subject matter of Example 61 includes, wherein the test parameter includes a position.
[0201] In Example 63, the subject matter of Example 62 includes, wherein the position is a bit offset in the segment.
[0202] In Example 64, the subject matter of Example 63 includes, wherein the subset of the test parameters includes a bit value in each position.
[0203] In example 65, the subject matter of examples 61-64 includes, wherein the partial query results include a list of segment identifiers that are relevant to the query and are not in the cache segment.
[0204] In Example 66, the subject matter of Example 65 includes, wherein the operations comprise: receiving the partial query results by the caller; searching the subset of test parameters in the partial query results for a stopping condition defined by the probabilistic filter; and when the stopping condition is not found in the subset of test parameters, searching for the stopping condition within a segment of the segment identifier that is resident in the second media as a result of the retrieval of the remaining data that initiated the probabilistic filter.
[0205] In example 67, the subject matter of examples 47-66 includes, wherein initiating retrieval of remaining data for the probabilistic filter includes identifying a stopping condition for the probabilistic filter in the partial query results and abandoning the retrieval of the remaining data.
[0206] In Example 68, the subject matter of Examples 47-67 includes, wherein the probabilistic filter is at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
[0207] Example 69 is a system for reducing probabilistic filter query latency, the system comprising: a component for receiving a query for a probabilistic filter stored on a first medium from a caller; a component for obtaining a cache fragment of the probabilistic filter stored on a second medium in response to receiving the query, wherein the cache fragment is smaller than the entire probabilistic filter stored on the first medium, wherein the probabilistic filter provides a set membership determination that is conclusive when it is determined that an element is not in the set; a component for executing the query on the cache fragment, thereby resulting in a partial query result; a component for initiating retrieval of remaining data for the probabilistic filter from the first medium to the second medium without intervention by the caller, wherein the remaining data corresponds to the query and data not in the cache fragment; and a component for transmitting the partial query result back to the caller.
[0208] In example 70, the subject matter of example 69 includes, wherein the means for receiving the query includes means for receiving a segment identifier that specifies which segments of all segments of the probabilistic filter are relevant to the query.
[0209] In example 71, the subject matter of example 70 includes, wherein the segment identifier is a byte offset in the file.
[0210] In example 72, the subject matter of example 71 includes, wherein the query includes a file identifier of the file.
[0211] In example 73, the subject matter of examples 71-72 includes, wherein the file is a key-value set file.
[0212] In example 74, the subject matter of example 73 includes: means for maintaining a fetch group data structure for pages of the key value set file; and means for retrieving pages in the fetch group data structure of the key value set file in response to a page fault on one of the pages in the fetch group data structure.
[0213] In example 75, the subject matter of examples 73-74 includes, wherein the key-value set file includes more than one KVS tree.
[0214] In Example 76, the subject matter of Example 75 includes, wherein the probabilistic filter is applied to a single KVS tree in the key-value set file.
[0215] In example 77, the subject matter of examples 70-76 includes, wherein the means for obtaining the cached segment includes means for obtaining a segment in the second media for which the probabilistic filter corresponds to the segment identifier.
[0216] In example 78, the subject matter of examples 69-77 includes, wherein the segment of the probabilistic filter is based on a representation of the probabilistic filter in the second media.
[0217] In Example 79, the subject matter of Example 78 includes, wherein the fragments are of uniform size.
[0218] In Example 80, the subject matter of Example 79 includes, wherein the uniform size is a memory page size.
[0219] In Example 81, the subject matter of Example 80 includes, wherein the segment identifier is a page identifier.
[0220] In example 82, the subject matter of examples 79-81 includes, wherein the segment identifier is a memory address.
[0221] In example 83, the subject matter of examples 69-82 includes, wherein the query includes a set of test parameters, and wherein the partial query results include results of a subset of the test parameters performed on the cache segment.
[0222] In Example 84, the subject matter of Example 83 includes, wherein the test parameter includes a position.
[0223] In Example 85, the subject matter of Example 84 includes, wherein the position is a bit offset in the segment.
[0224] In Example 86, the subject matter of Example 85 includes, wherein the subset of the test parameters includes a bit value in each position.
[0225] In example 87, the subject matter of examples 83-86 includes, wherein the partial query results include a list of segment identifiers that are relevant to the query and are not in the cache segment.
[0226] In Example 88, the subject matter of Example 87 includes: means for receiving the partial query results by the caller; means for searching the subset of test parameters in the partial query results for a stopping condition defined by the probabilistic filter; and means for searching for the stopping condition within a segment of the segment identifier, the segment resident in the second medium as a result of the retrieval of the remaining data that initiated the probabilistic filter, when the stopping condition is not found in the subset of test parameters.
[0227] In Example 89, the subject matter of Examples 69-88 includes, wherein the means for initiating retrieval of remaining data for the probabilistic filter includes means for identifying a stopping condition for the probabilistic filter in the partial query results and abandoning the retrieval of the remaining data.
[0228] In Example 90, the subject matter of Examples 69-89 includes, wherein the probabilistic filter is at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
[0229] Example 91 is a system for reducing probabilistic filter query latency, the system comprising a processing circuit system for: receiving notification of a page fault, wherein the page fault is a request for a memory page corresponding to a memory mapped file, the memory page not being in memory; determining that the memory page is part of a fetch group; and initiating loading of a memory page in the fetch group that is not in memory.
[0230] In Example 92, the subject matter of Example 91 includes, wherein to initiate the load, the processing circuitry performs an asynchronous load of the memory pages in the fetch group that are not in memory.
[0231] In example 93, the subject matter of examples 91-92 includes, wherein to determine that the memory page is part of a fetch group, the processing circuitry locates the memory page in a data structure.
[0232] In Example 94, the subject matter of Example 93 includes, wherein the data structure is a table.
[0233] In example 95, the subject matter of example 94 includes, wherein the table holds more than one extraction group.
[0234] In Example 96, the subject matter of Examples 93-95 includes, wherein the processing circuitry is further to: receive an identifier of a page in a fetch group; and store the identifier in the data structure.
[0235] Example 97 is a method for reducing probabilistic filter query latency, the method comprising: receiving notification of a page fault, wherein the page fault is a request for a memory page corresponding to a memory mapped file, and the memory page is not in memory; determining that the memory page is part of a fetch group; and initiating loading of a memory page in the fetch group that is not in memory.
[0236] In Example 98, the subject matter of Example 97 includes, wherein initiating the load includes performing an asynchronous load of the memory pages in the fetch group that are not in memory.
[0237] In example 99, the subject matter of examples 97-98 includes, wherein determining that the memory page is part of a fetch group includes finding the memory page in a data structure.
[0238] In example 100, the subject matter of example 99 includes, wherein the data structure is a table.
[0239] In example 101 , the subject matter of example 100 includes, wherein the table stores more than one extraction group.
[0240] In example 102, the subject matter of examples 99-101 includes receiving an identifier of a page in a fetch group; and storing the identifier in the data structure.
[0241] Example 103 is a machine-readable medium comprising instructions for reducing probabilistic filter query latency, which instructions, when executed by a processing circuit system, cause the processing circuit system to perform operations including: receiving notification of a page fault, wherein the page fault is a request for a memory page corresponding to a memory-mapped file, and the memory page is not in memory; determining that the memory page is part of a fetch group; and initiating loading of a memory page in the fetch group that is not in memory.
[0242] In example 104, the subject matter of example 103 includes, wherein initiating the load includes performing an asynchronous load of the memory pages in the fetch group that are not in memory.
[0243] In example 105, the subject matter of examples 103-104 includes, wherein determining that the memory page is part of a fetch group includes finding the memory page in a data structure.
[0244] In example 106, the subject matter of example 105 includes, wherein the data structure is a table.
[0245] In example 107, the subject matter of example 106 includes, wherein the table stores more than one extraction group.
[0246] In example 108, the subject matter of examples 105-107 includes, wherein the operation comprises: receiving an identifier of a page in a fetch group; and storing the identifier in the data structure.
[0247] Example 109 is a system for reducing probabilistic filter query latency, the system comprising: a component for receiving notification of a page fault, wherein the page fault is a request for a memory page corresponding to a memory mapped file, the memory page not being in memory; a component for determining that the memory page is part of a fetch group; and a component for initiating a load of a memory page in the fetch group that is not in memory.
[0248] In example 110, the subject matter of example 109 includes, wherein the means for initiating the load includes means for performing an asynchronous load of the memory pages in the fetch group that are not in memory.
[0249] In example 111, the subject matter of examples 109-110 includes, wherein the means for determining that the memory page is part of a fetch group includes means for finding the memory page in a data structure.
[0250] In example 112, the subject matter of example 111 includes, wherein the data structure is a table.
[0251] In example 113, the subject matter of example 112 includes, wherein the table stores more than one extraction group.
[0252] In example 114, the subject matter of examples 111-113 includes: means for receiving an identifier of a page in a fetch group; and means for storing the identifier in the data structure.
[0253] Example 115 is at least one machine-readable medium comprising instructions that, when executed by processing circuitry, cause the processing circuitry to perform operations to implement any of examples 1-114.
[0254] Example 116 is an apparatus comprising means for implementing any of Examples 1-114.
[0255] Example 117 is a system for implementing any of Examples 1-114.
[0256] Example 118 is a method for implementing any of Examples 1-114.
[0257] The above embodiments include references to the accompanying drawings that form a part of the embodiments. The drawings show specific embodiments that can be put into practice by way of illustration. These embodiments are also referred to herein as "examples". These examples may include elements other than those shown or described. However, the present inventors also contemplate examples in which only those shown or described elements are provided. In addition, the present inventors also contemplate examples using any combination or permutation of those shown or described elements with respect to a specific example (or one or more aspects thereof) or with respect to other examples (or one or more aspects thereof) shown or described herein.
[0258] All publications, patents, and patent documents mentioned in this document are incorporated herein by reference in their entirety as if individually incorporated by reference. If there are any inconsistent usages between this document and those incorporated by reference, the usage in the incorporated references shall be deemed supplementary to the usage in this document; in the event of any inconsistency, the usage in this document shall control.
[0259] In this document, as is common in patent documents, the terms "a" or "an" are used to include one or more instances or usages independent of any other instances or usages of "at least one" or "one or more." In this document, the term "or" is used to refer to a non-exclusive or, such that "A or B" includes "A but not B," "B but not A," and "A and B," unless otherwise indicated. In the appended claims, the terms "including" and "in which" are used as the plain English equivalents of the respective terms "comprising" and "wherein." Furthermore, in the claims below, the terms "including" and "comprising" are open-ended, that is, systems, devices, articles, or processes that include elements other than the elements listed after the term in a claim are still considered to fall within the scope of the claim. Furthermore, in the claims below, the terms "first," "second," and "third," etc. are used merely as labels and are not intended to impose numerical requirements on their objects.
[0260] The above description is intended to be illustrative and non-restrictive. For example, the examples described above (or one or more aspects thereof) can be used in combination with each other. After reviewing the above description, for example, a person of ordinary skill in the art can use other embodiments. The description abstract allows the reader to quickly determine the nature of the present invention, and when submitting the description abstract, it should be understood that it is not used to interpret or limit the scope or meaning of the claims. In addition, in the above embodiments, various features can be grouped together to simplify the present invention. This should not be interpreted as hoping that the disclosed features that are not claimed are the key values of any claim. Instead, the subject matter of the invention may be less than all the features of a specific disclosed embodiment. Therefore, the following claims are hereby incorporated into the embodiments, wherein each claim itself is a separate embodiment. The scope of the embodiment should be determined with reference to the appended claims together with the full range of equivalents to which such claims are entitled.
Claims
1. A system for reducing probabilistic filter query latency, comprising processing circuitry for performing operations comprising: receiving, from a calling software application, a query for a probabilistic filter stored on a first medium; In response to receiving the query, obtaining a cached fragment of the probabilistic filters stored on a second medium, the cached fragment comprising a subset of the probabilistic filters stored on the first medium, the probabilistic filters used to determine that an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result, the partial query result representing a query result generated based on executing the query on at least a portion of the probabilistic filter; transmitting the partial query results back to the calling software application; while performing the retrieval of non-cached segments of the probabilistic filter from the first media to the second media without intervention by the calling software application: Searching for a stop condition within the partial query results; In response to identifying the stop condition, the search is stopped and retrieving any remaining non-cached fragments is abandoned.
2. The system of claim 1 , wherein the operations comprise: The retrieval of the non-cached segments of the probabilistic filter from the first media to the second media is initiated. 3 . The system of claim 1 , wherein receiving the query comprises receiving one or more segment identifiers, the segment identifiers specifying which segments of the probabilistic filter are relevant to the query.
4. The system of claim 3, wherein the one or more segment identifiers are byte offsets in a file. The system of claim 4 , wherein the file comprises a key-value set file.
6. The system of claim 5, wherein the operations comprise: maintaining a data structure of extraction groups for pages of the key-value set file; and Pages in the fetch group of the key set file are retrieved in response to a page fault on at least one page in the data structure.
7. The system of claim 1, wherein the partial query results include a list of fragment identifiers that are relevant to the query and are not in the cached fragments.
8. The system of claim 1, wherein the probabilistic filter comprises at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
9. A method for reducing probabilistic filter query latency, comprising: receiving, from a calling software application, a query for a probabilistic filter stored on a first medium; In response to receiving the query, obtaining a cached fragment of the probabilistic filters stored on a second medium, the cached fragment comprising a subset of the probabilistic filters stored on the first medium, the probabilistic filters used to determine that an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result, the partial query result representing a query result generated based on executing the query on at least a portion of the probabilistic filter; transmitting the partial query results back to the calling software application; while performing the retrieval of non-cached segments of the probabilistic filter from the first media to the second media without intervention by the calling software application: Searching for a stop condition within the partial query results; In response to identifying the stop condition, the search is stopped and retrieving any remaining non-cached fragments is abandoned.
10. The method according to claim 9, comprising: The retrieval of the non-cached segments of the probabilistic filter from the first media to the second media is initiated.
11. The method of claim 9, wherein receiving the query comprises receiving one or more segment identifiers, the segment identifiers specifying which segments of the probabilistic filter are relevant to the query.
12. The method of claim 11, wherein the one or more segment identifiers are byte offsets in a file. The method of claim 12 , wherein the file comprises a key-value set file.
14. The method according to claim 13, comprising: maintaining a data structure of extraction groups for pages of the key-value set file; and Pages in the fetch group of the key set file are retrieved in response to a page fault on at least one page in the data structure.
15. The method of claim 9, wherein the partial query results include a list of fragment identifiers that are relevant to the query and are not in the cached fragments.
16. The method of claim 9, wherein the probabilistic filter comprises at least one of a Bloom filter, a counting Bloom filter, or a cuckoo filter.
17. A non-transitory machine-readable storage medium comprising instructions that, when executed by processing circuitry, cause the processing circuitry to perform operations comprising: receiving, from a calling software application, a query for a probabilistic filter stored on a first medium; In response to receiving the query, obtaining a cached fragment of the probabilistic filters stored on a second medium, the cached fragment comprising a subset of the probabilistic filters stored on the first medium, the probabilistic filters used to determine that an element is not in a set; executing the query on the cache fragment, thereby resulting in a partial query result, the partial query result representing a query result generated based on executing the query on at least a portion of the probabilistic filter; transmitting the partial query results back to the calling software application; while performing the retrieval of non-cached segments of the probabilistic filter from the first media to the second media without intervention by the calling software application: Searching for a stop condition within the partial query results; In response to identifying the stop condition, the search is stopped and retrieving any remaining non-cached fragments is abandoned.
18. The non-transitory machine-readable storage medium of claim 17, wherein the operations comprise: The retrieval of the non-cached segments of the probabilistic filter from the first media to the second media is initiated.
19. The non-transitory machine-readable storage medium of claim 17, wherein receiving the query comprises receiving one or more segment identifiers that specify which segments of the probabilistic filter are relevant to the query.
20. The non-transitory machine-readable storage medium of claim 19, wherein the one or more segment identifiers are byte offsets in a file.
Citation Information
Patent Citations
Search cache for document search
CN102419768A
Searching for information utilizing a probabilistic detector
US20070078827A1
Methods and systems for notifying a server with cache information and for serving resources based on it
US20130339472A1