snappy 0.0.17 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. checksums.yaml +5 -5
  2. data/.dockerignore +2 -0
  3. data/.github/workflows/main.yml +34 -0
  4. data/.github/workflows/publish.yml +34 -0
  5. data/.gitignore +2 -1
  6. data/.gitmodules +1 -1
  7. data/Dockerfile +13 -0
  8. data/Gemfile +4 -0
  9. data/README.md +45 -5
  10. data/Rakefile +32 -29
  11. data/ext/api.c +6 -1
  12. data/ext/extconf.rb +31 -22
  13. data/lib/snappy/hadoop/reader.rb +62 -0
  14. data/lib/snappy/hadoop/writer.rb +51 -0
  15. data/lib/snappy/hadoop.rb +22 -0
  16. data/lib/snappy/reader.rb +14 -10
  17. data/lib/snappy/shim.rb +1 -1
  18. data/lib/snappy/version.rb +1 -1
  19. data/lib/snappy.rb +5 -4
  20. data/snappy.gemspec +14 -13
  21. data/test/hadoop/snappy_hadoop_reader_test.rb +115 -0
  22. data/test/hadoop/snappy_hadoop_writer_test.rb +48 -0
  23. data/test/snappy_hadoop_test.rb +26 -0
  24. data/test/snappy_reader_test.rb +148 -0
  25. data/test/snappy_test.rb +95 -0
  26. data/test/snappy_writer_test.rb +55 -0
  27. data/test/test_helper.rb +7 -0
  28. data/test.sh +3 -0
  29. data/vendor/snappy/CMakeLists.txt +420 -0
  30. data/vendor/snappy/CONTRIBUTING.md +31 -0
  31. data/vendor/snappy/NEWS +52 -0
  32. data/vendor/snappy/{README → README.md} +75 -49
  33. data/vendor/snappy/cmake/SnappyConfig.cmake.in +33 -0
  34. data/vendor/snappy/cmake/config.h.in +66 -0
  35. data/vendor/snappy/docs/README.md +72 -0
  36. data/vendor/snappy/snappy-internal.h +200 -32
  37. data/vendor/snappy/snappy-sinksource.cc +26 -9
  38. data/vendor/snappy/snappy-sinksource.h +11 -11
  39. data/vendor/snappy/snappy-stubs-internal.cc +1 -1
  40. data/vendor/snappy/snappy-stubs-internal.h +299 -302
  41. data/vendor/snappy/snappy-stubs-public.h.in +10 -47
  42. data/vendor/snappy/snappy-test.cc +94 -200
  43. data/vendor/snappy/snappy-test.h +101 -358
  44. data/vendor/snappy/snappy.cc +1437 -474
  45. data/vendor/snappy/snappy.h +31 -12
  46. data/vendor/snappy/snappy_benchmark.cc +378 -0
  47. data/vendor/snappy/snappy_compress_fuzzer.cc +60 -0
  48. data/vendor/snappy/snappy_test_data.cc +57 -0
  49. data/vendor/snappy/snappy_test_data.h +68 -0
  50. data/vendor/snappy/snappy_test_tool.cc +471 -0
  51. data/vendor/snappy/snappy_uncompress_fuzzer.cc +58 -0
  52. data/vendor/snappy/snappy_unittest.cc +271 -792
  53. metadata +42 -92
  54. data/.travis.yml +0 -26
  55. data/smoke.sh +0 -8
  56. data/test/test-snappy-reader.rb +0 -129
  57. data/test/test-snappy-writer.rb +0 -55
  58. data/test/test-snappy.rb +0 -58
  59. data/vendor/snappy/ChangeLog +0 -2468
  60. data/vendor/snappy/INSTALL +0 -370
  61. data/vendor/snappy/Makefile +0 -982
  62. data/vendor/snappy/Makefile.am +0 -26
  63. data/vendor/snappy/Makefile.in +0 -982
  64. data/vendor/snappy/aclocal.m4 +0 -9738
  65. data/vendor/snappy/autogen.sh +0 -12
  66. data/vendor/snappy/autom4te.cache/output.0 +0 -18856
  67. data/vendor/snappy/autom4te.cache/output.1 +0 -18852
  68. data/vendor/snappy/autom4te.cache/requests +0 -297
  69. data/vendor/snappy/autom4te.cache/traces.0 +0 -2689
  70. data/vendor/snappy/autom4te.cache/traces.1 +0 -714
  71. data/vendor/snappy/config.guess +0 -1530
  72. data/vendor/snappy/config.h +0 -135
  73. data/vendor/snappy/config.h.in +0 -134
  74. data/vendor/snappy/config.log +0 -1640
  75. data/vendor/snappy/config.status +0 -2318
  76. data/vendor/snappy/config.sub +0 -1773
  77. data/vendor/snappy/configure +0 -18852
  78. data/vendor/snappy/configure.ac +0 -134
  79. data/vendor/snappy/depcomp +0 -688
  80. data/vendor/snappy/install-sh +0 -527
  81. data/vendor/snappy/libtool +0 -10246
  82. data/vendor/snappy/ltmain.sh +0 -9661
  83. data/vendor/snappy/m4/gtest.m4 +0 -74
  84. data/vendor/snappy/m4/libtool.m4 +0 -8001
  85. data/vendor/snappy/m4/ltoptions.m4 +0 -384
  86. data/vendor/snappy/m4/ltsugar.m4 +0 -123
  87. data/vendor/snappy/m4/ltversion.m4 +0 -23
  88. data/vendor/snappy/m4/lt~obsolete.m4 +0 -98
  89. data/vendor/snappy/missing +0 -331
  90. data/vendor/snappy/snappy-stubs-public.h +0 -100
  91. data/vendor/snappy/snappy.pc +0 -10
  92. data/vendor/snappy/snappy.pc.in +0 -10
  93. data/vendor/snappy/stamp-h1 +0 -1
@@ -1,134 +0,0 @@
1
- m4_define([snappy_major], [1])
2
- m4_define([snappy_minor], [1])
3
- m4_define([snappy_patchlevel], [4])
4
-
5
- # Libtool shared library interface versions (current:revision:age)
6
- # Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B)
7
- # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
8
- m4_define([snappy_ltversion], [4:1:3])
9
-
10
- AC_INIT([snappy], [snappy_major.snappy_minor.snappy_patchlevel])
11
- AC_CONFIG_MACRO_DIR([m4])
12
- AC_CONFIG_AUX_DIR([.])
13
-
14
- # These are flags passed to automake (though they look like gcc flags!)
15
- AM_INIT_AUTOMAKE([-Wall])
16
-
17
- LT_INIT
18
- AC_SUBST([LIBTOOL_DEPS])
19
- AC_PROG_CXX
20
- AC_LANG([C++])
21
- AC_C_BIGENDIAN
22
- AC_TYPE_SIZE_T
23
- AC_TYPE_SSIZE_T
24
- AC_CHECK_HEADERS([stdint.h stddef.h sys/mman.h sys/resource.h windows.h byteswap.h sys/byteswap.h sys/endian.h sys/time.h])
25
-
26
- # Don't use AC_FUNC_MMAP, as it checks for mappings of already-mapped memory,
27
- # which we don't need (and does not exist on Windows).
28
- AC_CHECK_FUNC([mmap])
29
-
30
- GTEST_LIB_CHECK([], [true], [true # Ignore; we can live without it.])
31
-
32
- AC_ARG_WITH([gflags],
33
- [AS_HELP_STRING(
34
- [--with-gflags],
35
- [use Google Flags package to enhance the unit test @<:@default=check@:>@])],
36
- [],
37
- [with_gflags=check])
38
-
39
- if test "x$with_gflags" != "xno"; then
40
- PKG_CHECK_MODULES(
41
- [gflags],
42
- [libgflags],
43
- [AC_DEFINE([HAVE_GFLAGS], [1], [Use the gflags package for command-line parsing.])],
44
- [if test "x$with_gflags" != "xcheck"; then
45
- AC_MSG_FAILURE([--with-gflags was given, but test for gflags failed])
46
- fi])
47
- fi
48
-
49
- # See if we have __builtin_expect.
50
- # TODO: Use AC_CACHE.
51
- AC_MSG_CHECKING([if the compiler supports __builtin_expect])
52
-
53
- AC_TRY_COMPILE(, [
54
- return __builtin_expect(1, 1) ? 1 : 0
55
- ], [
56
- snappy_have_builtin_expect=yes
57
- AC_MSG_RESULT([yes])
58
- ], [
59
- snappy_have_builtin_expect=no
60
- AC_MSG_RESULT([no])
61
- ])
62
- if test x$snappy_have_builtin_expect = xyes ; then
63
- AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.])
64
- fi
65
-
66
- # See if we have working count-trailing-zeros intrinsics.
67
- # TODO: Use AC_CACHE.
68
- AC_MSG_CHECKING([if the compiler supports __builtin_ctzll])
69
-
70
- AC_TRY_COMPILE(, [
71
- return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0
72
- ], [
73
- snappy_have_builtin_ctz=yes
74
- AC_MSG_RESULT([yes])
75
- ], [
76
- snappy_have_builtin_ctz=no
77
- AC_MSG_RESULT([no])
78
- ])
79
- if test x$snappy_have_builtin_ctz = xyes ; then
80
- AC_DEFINE([HAVE_BUILTIN_CTZ], [1], [Define to 1 if the compiler supports __builtin_ctz and friends.])
81
- fi
82
-
83
- # Other compression libraries; the unit test can use these for comparison
84
- # if they are available. If they are not found, just ignore.
85
- UNITTEST_LIBS=""
86
- AC_DEFUN([CHECK_EXT_COMPRESSION_LIB], [
87
- AH_CHECK_LIB([$1])
88
- AC_CHECK_LIB(
89
- [$1],
90
- [$2],
91
- [
92
- AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
93
- UNITTEST_LIBS="-l$1 $UNITTEST_LIBS"
94
- ],
95
- [true]
96
- )
97
- ])
98
- CHECK_EXT_COMPRESSION_LIB([z], [zlibVersion])
99
- CHECK_EXT_COMPRESSION_LIB([lzo2], [lzo1x_1_15_compress])
100
- CHECK_EXT_COMPRESSION_LIB([lzf], [lzf_compress])
101
- CHECK_EXT_COMPRESSION_LIB([fastlz], [fastlz_compress])
102
- CHECK_EXT_COMPRESSION_LIB([quicklz], [qlz_compress])
103
- AC_SUBST([UNITTEST_LIBS])
104
-
105
- # These are used by snappy-stubs-public.h.in.
106
- if test "$ac_cv_header_stdint_h" = "yes"; then
107
- AC_SUBST([ac_cv_have_stdint_h], [1])
108
- else
109
- AC_SUBST([ac_cv_have_stdint_h], [0])
110
- fi
111
- if test "$ac_cv_header_stddef_h" = "yes"; then
112
- AC_SUBST([ac_cv_have_stddef_h], [1])
113
- else
114
- AC_SUBST([ac_cv_have_stddef_h], [0])
115
- fi
116
- if test "$ac_cv_header_sys_uio_h" = "yes"; then
117
- AC_SUBST([ac_cv_have_sys_uio_h], [1])
118
- else
119
- AC_SUBST([ac_cv_have_sys_uio_h], [0])
120
- fi
121
-
122
- # Export the version to snappy-stubs-public.h.
123
- SNAPPY_MAJOR="snappy_major"
124
- SNAPPY_MINOR="snappy_minor"
125
- SNAPPY_PATCHLEVEL="snappy_patchlevel"
126
-
127
- AC_SUBST([SNAPPY_MAJOR])
128
- AC_SUBST([SNAPPY_MINOR])
129
- AC_SUBST([SNAPPY_PATCHLEVEL])
130
- AC_SUBST([SNAPPY_LTVERSION], snappy_ltversion)
131
-
132
- AC_CONFIG_HEADERS([config.h])
133
- AC_CONFIG_FILES([Makefile snappy-stubs-public.h snappy.pc])
134
- AC_OUTPUT