Comments (17)
I thought about that. I don't think we'll want to serialize those at all. Instead I'm leaning towards having overloads on the deserialization call that accept a functional callback that will be used to recreate the context given the expression and flags.
from hyperscan-java.
I believe the link is broken. :(
from hyperscan-java.
Fixed it, thanks :-) Intel moved their open source repositories from the 01org to the Intel organization. Will have to fix all the other links, too (see issue #38)
from hyperscan-java.
I was thinking of implementing this feature because it might be very useful on a project I'm currently working on but after looking into it a bit I've identified some limitations/design issues.
-
Should the serialized database be usable directly by hyperscan or is it sufficient that only hyperscan-java be able to load this back in? I ask this because hyperscan-java's Database instance holds on to the list of wrapper's expression instanced used to compile it. This is needed by the Scanner API so that returned matches can be associated with the original expressions. Unfortunately I don't think that hyperscan APIs allow for interrogating a database about its expressions (please correct me if I'm wrong). This implies that the wrapper's serialization implementation will also need to serialize the expressions so the resulting artifact will not be usable by anything other than the wrapper. I could also produce 2 separate artifacts but that API seems overly complex and error prone on the user end.
-
If I provide serialization support there is a good chance someone will try to load the database on a different platform than it was compiled. Should this be a supported usecase? If so then I also need to provide compilation API that accepts target platform. Currently you call the hyperscan compile methods with null meaning compile for the current host platform. Personally I think I'm fine with this limitation but I wanted to see what you thought.
from hyperscan-java.
Thank you very much for considering a contribution.
I think the tradeoffs proposed by you are fine.
One additional thought about the serialization: Right now expressions can have a context reference (Object) assigned to them to enable association between expressions and other business objects. This might need some additional consideration.
https://github.com/LocateTech/hyperscan-java/blob/3085f047772d21504c98c050c82431777205bacc/src/main/java/com/gliwka/hyperscan/wrapper/Expression.java#L118
from hyperscan-java.
I agree, that would be the best way to proceed. Looking forward to your contribution!
from hyperscan-java.
I opened the PR here: #50
from hyperscan-java.
Closed by #50. Will be part of the next release.
from hyperscan-java.
Thanks @gliwka. Any idea when the next release might be? We're trying to determine if my team should fork and publish to our internal nexus or if there will be an official release by the time we need this feature.
from hyperscan-java.
Today :-)
from hyperscan-java.
Is there an update on the release?
from hyperscan-java.
Sorry for the delay, the flu is dragging me down.
v0.6.0 has just been released to maven central.
from hyperscan-java.
Hope you feel better soon.
I noticed that the changes were merged to master but I can't seem to find the artifacts on maven central.
from hyperscan-java.
https://repo1.maven.org/maven2/com/gliwka/hyperscan/hyperscan/0.6.0/ exists, but the pom and .jar is missing inside. I'll release a v0.6.1, since I can't take a release down once it's published.
from hyperscan-java.
I'm getting hit by travis-ci/travis-ci#9555, I'm investigation how to fix this.
from hyperscan-java.
The CI environment (Travis) is switching IP addresses during uploads, which causes Nexus to think it's two different releases and it creates multiple different staging repositories per IP address, which in turn caused an incomplete release.
Using nexus-staging-maven-plugin fixes the issue.
v0.6.2 is now released and works fine.
It's already on OSS Sonatype (https://oss.sonatype.org/content/repositories/releases/com/gliwka/hyperscan/hyperscan/0.6.2/) and should sync to the other maven central repositories in the 2 hours.
from hyperscan-java.
Thanks so much @gliwka
from hyperscan-java.
Related Issues (20)
- ERROR :- There can only be 256 non-closed Scanner instances. Create them once per thread! HOT 4
- The Scanner.class has a bug HOT 1
- java.lang.OutOfMemoryError: Cannot allocate new PointerPointer(13): totalBytes = 0, physicalBytes = 8085M\n\tat org.bytedeco.javacpp.PointerPointer.<init>(PointerPointer.java:149)\n\tat com.gliwka.hyperscan.wrapper.Database.compile(Database.java:83) HOT 1
- Migrate to project panama
- Race condition in Scanner ctor HOT 1
- Database instances not reclaimable by GC HOT 2
- Allow arbitrary expression IDs
- The library should cleanup memory garbage after itself. HOT 3
- NullPointerException: null HOT 1
- Scanner.scan utf8ByteIndexesMapping Array Out Of Bounds HOT 4
- Memory leak in the PatternFilter HOT 2
- Any plans to support linux_arm in the future? HOT 4
- Is there a MULTILINE support for hyperscan?
- Investigate JEP 454: Foreign Function & Memory API HOT 1
- Hyperscan upgrade to 5.4.11-3.0.0 does not support compilation on Windows HOT 3
- Hyperscan java wrapper throws an exception when one scratch space is used with multiple databases HOT 2
- There can only be 256 non-closed Scanner instances. Create them once per thread!
- Create a compressed BASE64 encoded version of the hyperscan database. HOT 1
- The javadoc link of README is unavailable
- ExpressionFlag class is not getting resolved in 5.4.11-3.0.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperscan-java.