airlift / slice Goto Github PK
View Code? Open in Web Editor NEWJava library for efficiently working with heap and off-heap memory
License: Apache License 2.0
Java library for efficiently working with heap and off-heap memory
License: Apache License 2.0
It seems sun.misc.Unsafe is deprecated since JDK11, and a replacement looks like using VarHandle:
http://openjdk.java.net/jeps/193
Do you have any idea on how we should migrate to JDK11?
Is there a place where I can view documentation for this library? I see it used extensively in Presto, but I wouldn't know where to start if I wanted to use it in my own library. Is there a place we can see Slice's design and related software?
are there any plans on removing it?
it's a gpl so it's causing all sorts of problems...
Slice is ASLv2 licensed, but has jol-core as a hard dependency. jol-core is released under the GPL.
Do you have a plan to remove the dependence on jol-core? Is there some workaround to make airlift's zstd compressor work without the GPL code?
This is a public method. Experience would be better if negative array size produced a user-friendly message, similar to the one we get for too large size.
https://github.com/airlift/slice/blob/master/src/main/java/io/airlift/slice/Slices.java#L83:L92
On negative size, throws
java.lang.NegativeArraySizeException: -2147483636
at io.airlift.slice.Slices.allocate(Slices.java:91)
at io.trino.execution.buffer.PageSerializer$WriteBuffer.<init>(PageSerializer.java:626)
at io.trino.execution.buffer.PageSerializer$SerializedPageOutput.startPage(PageSerializer.java:154)
at io.trino.execution.buffer.PageSerializer.serialize(PageSerializer.java:83)
at io.trino.spiller.FileSingleStreamSpiller.writePages(FileSingleStreamSpiller.java:157)
at io.trino.spiller.FileSingleStreamSpiller.lambda$spill$0(FileSingleStreamSpiller.java:123)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
This is in pursuance of supporting FNV hash in Presto.
Expand javadoc to note that .slice()
should be called to have Slice respect the position and limit.
is there comparision for slice vs netty ByteBuf ?
I consider using your library for API.
Unfortunately, Slice
can't be explicitly typed.
If I write public Slice getValue()
, user can't be sure whether it is a slice of byte
s, int
s or something else.
The same for parameters.
This information could be specified in doc. But we still lose type checking from the compiler.
Did you consider having several classes, for each primitive type?
I saw this comment, but, maybe, to avoid code duplication, you could have one template and a generator?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.