Commit e7c9200f authored by Grégory Wisniewski's avatar Grégory Wisniewski

No more serialize objects since it's already done by ZODB.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@377 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 94afb9ba
...@@ -401,7 +401,7 @@ class Application(object): ...@@ -401,7 +401,7 @@ class Application(object):
self._cache_lock_release() self._cache_lock_release()
if end_serial == INVALID_SERIAL: if end_serial == INVALID_SERIAL:
end_serial = None end_serial = None
return loads(data), start_serial, end_serial return data, start_serial, end_serial
def load(self, oid, version=None): def load(self, oid, version=None):
...@@ -413,7 +413,7 @@ class Application(object): ...@@ -413,7 +413,7 @@ class Application(object):
try: try:
if oid in self.mq_cache: if oid in self.mq_cache:
logging.debug('load oid %s is cached', dump(oid)) logging.debug('load oid %s is cached', dump(oid))
return loads(self.mq_cache[oid][1]), self.mq_cache[oid][0] return self.mq_cache[oid][1], self.mq_cache[oid][0]
finally: finally:
self._cache_lock_release() self._cache_lock_release()
# Otherwise get it from storage node # Otherwise get it from storage node
...@@ -489,8 +489,7 @@ class Application(object): ...@@ -489,8 +489,7 @@ class Application(object):
# FIXME must wait for cluster to be ready # FIXME must wait for cluster to be ready
raise NEOStorageError raise NEOStorageError
# Store data on each node # Store data on each node
ddata = dumps(data) compressed_data = compress(data)
compressed_data = compress(ddata)
checksum = makeChecksum(compressed_data) checksum = makeChecksum(compressed_data)
for cell in cell_list: for cell in cell_list:
logging.info("storing object %s %s" %(cell.getServer(),cell.getState())) logging.info("storing object %s %s" %(cell.getServer(),cell.getState()))
...@@ -524,7 +523,7 @@ class Application(object): ...@@ -524,7 +523,7 @@ class Application(object):
# Store object in tmp cache # Store object in tmp cache
noid, nserial = self.txn_object_stored noid, nserial = self.txn_object_stored
self.txn_data_dict[oid] = ddata self.txn_data_dict[oid] = data
return self.tid return self.tid
...@@ -658,9 +657,9 @@ class Application(object): ...@@ -658,9 +657,9 @@ class Application(object):
self._cache_lock_acquire() self._cache_lock_acquire()
try: try:
for oid in self.txn_data_dict.iterkeys(): for oid in self.txn_data_dict.iterkeys():
ddata = self.txn_data_dict[oid] data = self.txn_data_dict[oid]
# Now serial is same as tid # Now serial is same as tid
self.mq_cache[oid] = self.tid, ddata self.mq_cache[oid] = self.tid, data
finally: finally:
self._cache_lock_release() self._cache_lock_release()
self._clear_txn() self._clear_txn()
......
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