Commit be7d1e6e authored by Vincent Pelletier's avatar Vincent Pelletier

Add option to control compression.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2290 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5edb6d92
...@@ -35,7 +35,9 @@ class Storage(BaseStorage.BaseStorage, ...@@ -35,7 +35,9 @@ class Storage(BaseStorage.BaseStorage,
__name__ = 'NEOStorage' __name__ = 'NEOStorage'
def __init__(self, master_nodes, name, connector=None, read_only=False, def __init__(self, master_nodes, name, connector=None, read_only=False,
compress=True, **kw): compress=None, **kw):
if compress is None:
compress = True
BaseStorage.BaseStorage.__init__(self, name) BaseStorage.BaseStorage.__init__(self, name)
self._is_read_only = read_only self._is_read_only = read_only
self.app = Application(master_nodes, name, connector, self.app = Application(master_nodes, name, connector,
......
...@@ -22,6 +22,8 @@ class NeoStorage(BaseConfig): ...@@ -22,6 +22,8 @@ class NeoStorage(BaseConfig):
def open(self): def open(self):
from neo.client.Storage import Storage from neo.client.Storage import Storage
return Storage(master_nodes=self.config.master_nodes, return Storage(master_nodes=self.config.master_nodes,
name=self.config.name, connector = self.config.connector) name=self.config.name, connector = self.config.connector,
compress=self.config.compress,
)
...@@ -19,5 +19,11 @@ ...@@ -19,5 +19,11 @@
Give the name of the connector used at low-level Give the name of the connector used at low-level
</description> </description>
</key> </key>
<key name="compress" required="no" default="true" datatype="boolean">
<description>
true: enable automatic data compression (compression is only used when compressed size is smaller).
false: disable data compression.
</description>
</key>
</sectiontype> </sectiontype>
</component> </component>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment