Add lz4 compression type.
This commit is contained in:
parent
302d1a6440
commit
2ef04007c4
4 changed files with 16 additions and 0 deletions
|
@ -730,6 +730,8 @@ CompressionTypes
|
|||
.. py:attribute:: snappy_compression
|
||||
.. py:attribute:: zlib_compression
|
||||
.. py:attribute:: bzip2_compression
|
||||
.. py:attribute:: lz4_compression
|
||||
.. py:attribute:: lz4hc_compression
|
||||
|
||||
BytewiseComparator
|
||||
==================
|
||||
|
|
|
@ -58,6 +58,8 @@ New:
|
|||
* Add init options to :py:class:`rocksdb.BlockBasedTableFactory`
|
||||
* Add more option to :py:class:`rocksdb.PlainTableFactory`
|
||||
* Add :py:class:`rocksdb.WriteBatchIterator`
|
||||
* add :py:attr:`rocksdb.CompressionType.lz4_compression`
|
||||
* add :py:attr:`rocksdb.CompressionType.lz4hc_compression`
|
||||
|
||||
|
||||
Version 0.2
|
||||
|
|
|
@ -704,6 +704,8 @@ cdef class CompressionType(object):
|
|||
snappy_compression = u'snappy_compression'
|
||||
zlib_compression = u'zlib_compression'
|
||||
bzip2_compression = u'bzip2_compression'
|
||||
lz4_compression = u'lz4_compression'
|
||||
lz4hc_compression = u'lz4hc_compression'
|
||||
|
||||
cdef class Options(object):
|
||||
cdef options.Options* opts
|
||||
|
@ -787,6 +789,10 @@ cdef class Options(object):
|
|||
return CompressionType.zlib_compression
|
||||
elif self.opts.compression == options.kBZip2Compression:
|
||||
return CompressionType.bzip2_compression
|
||||
elif self.opts.compression == options.kLZ4Compression:
|
||||
return CompressionType.lz4_compression
|
||||
elif self.opts.compression == options.kLZ4HCCompression:
|
||||
return CompressionType.lz4hc_compression
|
||||
else:
|
||||
raise Exception("Unknonw type: %s" % self.opts.compression)
|
||||
|
||||
|
@ -799,6 +805,10 @@ cdef class Options(object):
|
|||
self.opts.compression = options.kZlibCompression
|
||||
elif value == CompressionType.bzip2_compression:
|
||||
self.opts.compression = options.kBZip2Compression
|
||||
elif value == CompressionType.lz4_compression:
|
||||
self.opts.compression = options.kLZ4Compression
|
||||
elif value == CompressionType.lz4hc_compression:
|
||||
self.opts.compression = options.kLZ4HCCompression
|
||||
else:
|
||||
raise TypeError("Unknown compression: %s" % value)
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ cdef extern from "rocksdb/options.h" namespace "rocksdb":
|
|||
kSnappyCompression
|
||||
kZlibCompression
|
||||
kBZip2Compression
|
||||
kLZ4Compression
|
||||
kLZ4HCCompression
|
||||
|
||||
ctypedef enum ReadTier:
|
||||
kReadAllTier
|
||||
|
|
Loading…
Reference in a new issue