Skip to content

Commit c79990b

Browse files
committed
Release 1.0.3
1 parent e7ba0c4 commit c79990b

File tree

3 files changed

+57
-19
lines changed

3 files changed

+57
-19
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
snzip 1.0.3 - 2016-03-12
2+
3+
* Add hadoop-snappy format support.
4+
* Add raw format support.
5+
16
snzip 1.0.2 - 2015-01-04
27

38
* Use SSE4.2 to calculate CRC32C if it is available.

README.md

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Snzip, a compression/decompression tool based on snappy.
44
What is snzip.
55
--------------
66

7-
Snzip is one of command line tools using [snappy][]. This supports five types of
8-
file formats; [framing-format][], [old framing-format][] and obsolete three formats
9-
used by snzip, [snappy-java][] and [snappy-in-java][] before official framing-format
10-
was defined. The default format is [framing-format][].
7+
Snzip is one of command line tools using [snappy][]. This supports several file
8+
formats; [framing-format][], [old framing-format][], [hadoop-snappy format][], [raw format][]
9+
and obsolete three formats used by snzip, [snappy-java][] and [snappy-in-java][]
10+
before official framing-format was defined. The default format is [framing-format][].
1111

1212
Notable Changes
1313
---------------
@@ -21,11 +21,11 @@ Installation
2121

2222
### Install from a tar-ball
2323

24-
Download snzip-1.0.2.tar.gz from https://bintray.com/kubo/generic/snzip,
24+
Download snzip-1.0.3.tar.gz from https://bintray.com/kubo/generic/snzip,
2525
uncompress and untar it, and run configure.
2626

27-
tar xvfz snzip-1.0.2.tar.gz
28-
cd snzip-1.0.2
27+
tar xvfz snzip-1.0.3.tar.gz
28+
cd snzip-1.0.3
2929
./configure
3030

3131
If you didn't install snappy under `/usr` or `/usr/local`, you need to specify
@@ -40,8 +40,8 @@ the location by `--with-snappy` as follows.
4040
cd ..
4141

4242
# install snzip
43-
tar xvfz snzip-1.0.2.tar.gz
44-
cd snzip-1.0.2
43+
tar xvfz snzip-1.0.3.tar.gz
44+
cd snzip-1.0.3
4545
./configure --with-snappy=/usr/local/snappy
4646

4747
You can use `--with-default-format` to change the default compression format.
@@ -50,12 +50,12 @@ You can use `--with-default-format` to change the default compression format.
5050

5151
### Install as a rpm package
5252

53-
We don't provide rpm packages. You need to download snzip-1.0.2.tar.gz
53+
We don't provide rpm packages. You need to download snzip-1.0.3.tar.gz
5454
from https://bintray.com/kubo/generic/snzip, create a rpm package as follows and
5555
install it.
5656

5757
# The rpm package will be created under $HOME/rpmbuild/RPMS.
58-
rpmbuild -tb snzip-1.0.2.tar.gz
58+
rpmbuild -tb snzip-1.0.3.tar.gz
5959

6060
### Install from the latest source
6161

@@ -68,7 +68,7 @@ To use source code in the github repository.
6868

6969
### Install a Windows package.
7070

71-
Download `snzip-1.0.2-win32.zip` or `snzip-1.0.2-win64.zip` from
71+
Download `snzip-1.0.3-win32.zip` or `snzip-1.0.3-win64.zip` from
7272
https://bintray.com/kubo/generic/snzip and copy `snzip.exe` and `snunzip.exe`
7373
to a directory in the PATH environment variable.
7474

@@ -80,7 +80,8 @@ Usage
8080
snzip file.tar
8181

8282
Compressed file name is `file.tar.sz` and the original file is deleted.
83-
Timestamp, mode and permissions are not changed as possible as it can.
83+
The file attributes such as timestamp, mode and permissions are not changed
84+
as possible as it can.
8485

8586
The compressed file's format is [framing-format][]. You need to add an option `-t snappy-java` or
8687
`-t snappy-in-java` to use other formats.
@@ -114,7 +115,8 @@ or
114115
snunzip file.tar.sz
115116

116117
Uncompressed file name is `file.tar` and the original file is deleted.
117-
Timestamp, mode and permissions are not changed as possible as it can.
118+
The file attributes such as timestamp, mode and permissions are not changed
119+
as possible as it can.
118120

119121
If the program name includes `un` such as `snunzip`, it acts as `-d` is set.
120122

@@ -136,9 +138,8 @@ If the program name includes `cat` such as snzcat, it acts as `-dc` is set.
136138
Raw format
137139
----------
138140

139-
Note: This feature will be added in snzip 1.0.3.
140-
141-
Unlike other formats, the raw format has a few limitations:
141+
Raw format is native format of snappy.
142+
Unlike other formats, there are a few limitations:
142143
(1) The total data length before compression must be known on compression.
143144
(2) Automatic file format detection doesn't work on uncompression.
144145
(3) The raw format support is enabled only when snzip is compiled for snappy 1.1.3 or upper.
@@ -158,7 +159,7 @@ However the following command doesn't work.
158159
cat file.tar | snzip -t raw > file.tar.raw
159160

160161
It uses a pipe. snzip cannot get the total length before compression.
161-
The totel length must be specified by the `-s` option in this case.
162+
The total length must be specified by the `-s` option in this case.
162163

163164
cat file.tar | snzip -t raw -s "size of file.tar" > file.tar.raw
164165

@@ -173,6 +174,36 @@ or
173174
You need to set the `-t raw` option to tell snzip the format of the
174175
file to be uncompressed.
175176

177+
Hadoop-snappy format
178+
--------------------
179+
180+
Hadoop-snappy format is one of the compression formats used in Hadoop.
181+
It uses its own framing format as follows:
182+
183+
* A compressed file consists of one or more blocks.
184+
* A block consists of uncompressed length (big endian 4 byte integer) and one or more subblocks.
185+
* A subblock consists of compressed length (big endian 4 byte integer) and raw compressed data.
186+
187+
### To compress a file:
188+
189+
snzip -t hadoop-snappy file_name
190+
191+
The default block size used by `snzip` for hadoop-snappy format is 256k.
192+
It is same with the default value of the `io.compression.codec.snappy.buffersize`
193+
parameter. If the block size used by `snzip` is larger than the parameter,
194+
you would get an InternalError `Could not decompress data. Buffer length is too small`
195+
while hadoop is reading a file compressed by snzip. You need to change the block
196+
size by the `-b` option as follows if you get the error.
197+
198+
# if io.compression.codec.snappy.buffersize is 32768
199+
snzip -t hadoop-snappy -b 32768 file_name_to_be_compressed
200+
201+
### To uncompress a file:
202+
203+
snzip compressed_file.snappy
204+
205+
The file format is guessed by the first 8 bytes of the file.
206+
176207
SNZ File format
177208
---------------
178209

@@ -207,3 +238,5 @@ License
207238
[old framing-format]: https://github.com/google/snappy/blob/0755c815197dacc77d8971ae917c86d7aa96bf8e/framing_format.txt
208239
[snappy-java]: https://github.com/xerial/snappy-java
209240
[snappy-in-java]: https://github.com/dain/snappy
241+
[raw format]: https://github.com/kubo/snzip#raw-format
242+
[Hadoop-snappy format]: https://github.com/kubo/snzip#hadoop-snappy-format

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The autoconf version must be at least 2.64 to correctly detect
22
# endianess of Mac OS X universal binary.
33
AC_PREREQ(2.64)
4-
AC_INIT([snzip], [1.0.2])
4+
AC_INIT([snzip], [1.0.3])
55

66
AM_INIT_AUTOMAKE
77

0 commit comments

Comments
 (0)