-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass before syncs for this morning.
I think this change generally makes sense, I need to look at GzipCompressingInputStream
in more detail
byte[] data = new byte[1_000_000]; | ||
fillWithIncompressibleData(data); | ||
assertThat(ByteStreams.toByteArray(LZ4.decompress((GZIP.compress( | ||
new ByteArrayInputStream(data)))))).isEqualTo(data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-actionable. The current impl allows it the other way as well. This makes sense for easy migration from one compression method to another (though from no compression is still tricky - I guess you open a new stream store if you want to do that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah - i'm open to having a CompressionType which adds a single byte for no compression
import com.google.common.io.CountingInputStream; | ||
|
||
|
||
public final class GzipCompressingInputStream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't read the impl closely here - but I'm guessing there's some reason we can't have this mostly delegate to GZIPOutputStream
. Might be good to document that somewhere / how this is different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to provide atlas with an input stream, and creating an inputstream out of an output stream is tricky (needs a thread to avoid locking up). PipedInputStream and PipedOutputStream help, but I don't want a thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of the documentation - I would be tempted to literally point out that just like, the person who thinks this is probably bogus and tries to reimplement will immediately figure out the issue :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay - yeah I was thinking of hooking them up via the piped streams, but fair enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the header/content/trailer logic. Looks right
import com.google.common.io.CountingInputStream; | ||
|
||
|
||
public final class GzipCompressingInputStream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay - yeah I was thinking of hooking them up via the piped streams, but fair enough
Released 0.162.3 |
Update of Murat's PR