Skip to content

Commit

Permalink
Moved prefetch methods to separate interfaces
Browse files Browse the repository at this point in the history
Cus there's no such thing as an optional method in interfaces.
  • Loading branch information
Jim Fulton committed Jul 17, 2016
1 parent 9b1121e commit 7875e65
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ZODB/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,6 @@ def loadBefore(oid, tid):
If the object id isn't in the storage, then POSKeyError is raised.
"""

def prefetch(oids, tid):
"""Prefetch data for the given object ids before the given tid
The oids argument is an iterable that should be iterated no
more than once.
This method is optional. It is an optimization
"""

def loadSerial(oid, serial):
"""Load the object record for the give transaction id
Expand Down Expand Up @@ -763,6 +754,16 @@ def tpc_vote(transaction):
"""


class IPrefetchStorage(IStorage):

def prefetch(oids, tid):
"""Prefetch data for the given object ids before the given tid
The oids argument is an iterable that should be iterated no
more than once.
"""


class IMultiCommitStorage(IStorage):
"""A multi-commit storage can commit multiple transactions at once.
Expand Down Expand Up @@ -1121,16 +1122,15 @@ def load(oid):
A POSKeyError is raised if there is no record for the object id.
"""

class IMVCCPrefetchStorage(IMVCCStorage):

def prefetch(oids):
"""Prefetch data for the given object ids
The oids argument is an iterable that should be iterated no
more than once.
This method is optional. It is an optimization
"""


class IStorageCurrentRecordIteration(IStorage):

def record_iternext(next=None):
Expand Down

0 comments on commit 7875e65

Please sign in to comment.