Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
com.googlecode.concurrent-trees:concurrent-trees
Advanced tools
Concurrent Radix Trees and Concurrent Suffix Trees for Java.
"A tree is a tree. How many more do you have to look at?"
―Ronald Reagan
This project provides concurrent Radix Trees and concurrent Suffix Trees for Java.
A Radix Tree (also known as patricia trie, radix trie or compact prefix tree) is a space-optimized tree data structure which allows keys (and optionally values associated with those keys) to be inserted for subsequent lookup using only a prefix of the key rather than the whole key. Radix trees have applications in string or document indexing and scanning, where they can allow faster scanning and lookup than brute force approaches. Some applications of Radix Trees:
document.contains(keyword)
, see below)A Suffix Tree (also known as PAT tree or position tree) is an extension of a radix tree which allows the suffixes of keys to be inserted into the tree. This allows subsequent lookup using any suffix or fragment of the key rather than the whole key, and in turn this can support fast string operations or analysis of documents. Some applications of Suffix Trees:
The implementation in this project is actually a Generalized Suffix Tree.
All of the trees (data structures and algorithms) in this project are optimized for high-concurrency and high performance reads, and low-concurrency or background writes:
As such reading threads should never encounter latency due to ongoing writes or other concurrent readers.
The trees in this project support lock-free reads while allowing concurrent writes, by treating the tree as a mostly-immutable structure, and assembling the changes to be made to the tree into a patch, which is then applied to the tree in a single atomic operation.
Inserting an entry into Concurrent Radix Tree which requires an existing node within the tree to be split:
Feature matrix for tree implementations provided in this project, and lookup operations supported.
Tree Interface | Implementation | Key Equals (exact match) | Key Starts With | Key Ends With | Key Contains | Find Keywords In External Documents [1] |
---|---|---|---|---|---|---|
RadixTree | ConcurrentRadixTree | ✓ | ✓ | |||
ReversedRadixTree | ConcurrentReversedRadixTree | ✓ | ✓ | |||
InvertedRadixTree | ConcurrentInvertedRadixTree | ✓ | ✓ | ✓ | ||
SuffixTree | ConcurrentSuffixTree | ✓ | ✓ | ✓ |
[1] Scanning for Keywords in External Documents
ConcurrentInvertedRadixTree
allows unseen documents to be scanned efficiently for keywords contained in the tree, and performance does not degrade as additional keywords are added.
Let d = number of characters in document, n = number of keywords, k = average keyword length
Keyword scanning approach | Time Complexity (Number of character comparisons) | Example: 10000 10-character keywords, 10000 character document |
---|---|---|
Naive document.contains(keyword) for every keyword | O(d n k) | 1,000,000,000 character comparisons |
ConcurrentInvertedRadixTree | O(d log(k)) | 10,000 character comparisons (≤100,000 times faster) |
Utilities included which solve problems using the included trees.
Solver | Solves |
---|---|
LCSubstringSolver | Longest common substring problem |
General Documentation
For more documentation see the documentation directory.
Example Usage
Concurrent-Trees is in Maven Central. See Downloads.
As of writing (December 2016), version 2.6.0 of concurrent-trees is the latest release.
See Release Notes and Frequently Asked Questions for details.
Report any bugs/feature requests in the Issues tab. For support please use the Discussion Group, not direct email to the developers.
FAQs
Concurrent Radix Trees and Concurrent Suffix Trees for Java.
We found that com.googlecode.concurrent-trees:concurrent-trees demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.