[top] / ZODB / interfaces / IStorageRestoreable
There are no attributes or fields specified.
load(oid, version)
Load data for an object id and version
A data record and serial are returned. The serial is a transaction identifier of the transaction that wrote the data record.
A POSKeyError is raised if there is no record for the object id and version.
Storages that don't support versions must ignore the version argument.
restore(oid, serial, data, version, prev_txn, transaction)
Write data already committed in a separate database
The restore method is used when copying data from one database to a replica of the database. It differs from store in that the data have already been committed, so there is no check for conflicts and no new transaction is is used for the data.
Arguments:
oid The object id for the record
serial The transaction identifier that originally committed this object.
data The record data. This will be None if the transaction undid the creation of the object.
version The version identifier for the record
prev_txn The identifier of a previous transaction that held the object data. The target storage can sometimes use this as a hint to save space.
transaction The current transaction.
Nothing is returned.
store(oid, serial, data, version, transaction)
Store data for the object id, oid.
Arguments:
oid The object identifier. This is either a string consisting of 8 nulls or a string previously returned by new_oid.
serial The serial of the data that was read when the object was loaded from the database. If the object was created in the current transaction this will be a string consisting of 8 nulls.
data The data record. This is opaque to the storage.
version The version to store the data is. If the storage doesn't support versions, this should be an empty string and the storage is allowed to ignore it.
transaction A transaction object. This should match the current transaction for the storage, set by tpc_begin.
The new serial for the object is returned, but not necessarily immediately. It may be returned directly, or un a subsequent store or tpc_vote call.
The return value may be:
A serial, returned as a string or in a sequence of oid/serial pairs, may be the special value ZODB.ConflictResolution.ResolvedSerial to indicate that a conflict occured and that the object should be invalidated.
lastTransaction()
Return the id of the last committed transaction
isReadOnly()
Test whether a storage allows committing new transactions
For a given storage instance, this method always returns the same value. Read-only-ness is a static property of a storage.
tpc_finish(transaction, func=<function <lambda> at 0x40a685dc>)
Finish the transaction, making any transaction changes permanent.
Changes must be made permanent at this point.
This call is ignored if the storage isn't participating in two-phase commit or if it is commiting a different transaction. Failure of this method is extremely serious.
getName()
The name of the storage
The format and interpretation of this name is storage dependent. It could be a file name, a database name, etc.
This is used soley for informational purposes.
loadBefore(oid, tid)
Load the object data written before a transaction id
If there isn't data before the object before the given transaction, then None is returned, otherwise three values are returned:
sortKey()
Sort key used to order distributed transactions
When a transaction involved multiple storages, 2-phase commit operations are applied in sort-key order. This must be unique among storages used in a transaction. Obviously, the storage can't assure this, but it should construct the sort key so it has a reasonable chance of being unique.
registerDB(db)
Register an IStorageDB.
Note that, for historical reasons, an implementation may require a second argument, however, if required, the None will be passed as the second argument.
getSize()
An approximate size of the database, in bytes.
This is used soley for informational purposes.
tpc_abort(transaction)
Abort the transaction.
Any changes made by the transaction are discarded.
This call is ignored is the storage is not participating in two-phase commit or if the given transaction is not the same as the transaction the storage is commiting.
new_oid()
Allocate a new object id.
The object id returned is reserved at least as long as the storage is opened.
The return value is a string.
__len__()
The approximate number of objects in the storage
This is used soley for informational purposes.
tpc_begin(transaction, tid=None)
Begin the two-phase commit process.
If storage is already participating in a two-phase commit using the same transaction, the call is ignored.
If the storage is already participating in a two-phase commit using a different transaction, the call blocks until the current transaction ends (commits or aborts).
If a transaction id is given, then the transaction will use the given id rather than generating a new id. This is used when copying already committed transactions from another storage.
close()
Close the storage.
loadSerial(oid, serial)
Load the object record for the give transaction id
If a matching data record can be found, it is returned, otherwise, POSKeyError is raised.
pack(pack_time, referencesf)
Pack the storage
It is up to the storage to interpret this call, however, the general idea is that the storage free space by:
The pack time is given as a UTC time in seconds since the empoch.
The second argument is a function that should be used to extract object references from database records. This is needed to determine which objects are referenced from object revisions.
tpc_vote(transaction)
Provide a storage with an opportunity to veto a transaction
This call is ignored if the storage isn't participating in two-phase commit or if it is commiting a different transaction. Failure of this method is extremely serious.
If a transaction can be committed by a storage, then the method should return. If a transaction cannot be committed, then an exception should be raised. If this method returns without an error, then there must not be an error if tpc_finish or tpc_abort is called subsequently.
The return value can be either None or a sequence of object-id and serial pairs giving new serials for objects who's ids were passed to previous store calls in the same transaction. After the tpc_vote call, new serials must have been returned, either from tpc_vote or store for objects passed to store.
A serial returned in a sequence of oid/serial pairs, may be the special value ZODB.ConflictResolution.ResolvedSerial to indicate that a conflict occured and that the object should be invalidated.
history(oid, version, size=1)
Return a sequence of history information dictionaries.
Up to size objects (including no objects) may be returned.
The information provides a log of the changes made to the object. Data are reported in reverse chronological order.
Each dictionary has the following keys:
time UTC seconds since the epoch (as in time.time) that the object revision was committed. tid The transaction identifier of the transaction that committed the version. version The version that the revision is in. If the storage doesn't support versions, then this must be an empty string. user_name The user identifier, if any (or an empty string) of the user on whos behalf the revision was committed. description The transaction description for the transaction that committed the revision. size The size of the revision data record.
If the transaction had extension items, then these items are also included if they don't conflict with the keys above.
There are no specific adapters registered for this interface.
There are no extended adapters registered for this interface.
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: boston.js)
zope.viewlet.manager.<ViewletManager providing IJavaScript>
(name: zope.app.boston.IJavaScript)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/toolbar/viewlet.pt
(name: toolbar)
zope.traversing.namespace.lang
(name: lang)
zope.viewlet.manager.<ViewletManager providing ICSS>
(name: zope.app.boston.ICSS)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.viewlet.metaconfigure.CSSViewlet
(name: xmltree.css)
zope.app.pagetemplate.urlquote.URLQuote
(name: url)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/xmltree/xmltree.pt
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: skin.css)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.default.DefaultPreferences
(name: preferences)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.viewlet.manager.<ViewletManager providing IHead>
(name: zope.app.boston.IHead)
zope.app.component.back35.RegistrationManagerNamespace
(name: registrations)
zope.viewlet.manager.<ViewletManager providing ILeft>
(name: zope.app.boston.ILeft)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: toolbar-css)
zope.traversing.namespace.adapter
(name: adapter)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.app.pagetemplate.talesapi.ZopeTalesAPI
(name: zope)
zope.traversing.namespace.attr
(name: attribute)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.formlib.namedtemplate.NamedTemplatePathAdapter
(name: template)
zope.viewlet.manager.<ViewletManager providing IToolBar>
(name: zope.app.boston.IToolBar)
zope.viewlet.metaconfigure.CSSViewlet
(name: widget.css)
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.