public final class Fork extends View
A fork represents the database state at the time it was created plus any changes to the database made using this fork.
A fork allows to perform a transaction: a number of independent writes to the database, which then may be atomically applied (i.e. committed) to the database and change the database state.
nativeHandle| Modifier and Type | Method and Description |
|---|---|
void |
createCheckpoint()
Creates in-memory checkpoint of the current state of this Fork.
|
Cleaner |
getCleaner()
Returns the cleaner of this view.
|
static Fork |
newInstance(long nativeHandle,
boolean owningHandle,
Cleaner cleaner)
Creates a new Fork proxy.
|
static Fork |
newInstance(long nativeHandle,
Cleaner cleaner)
Creates a new owning Fork proxy.
|
void |
rollback()
Rollbacks changes to the latest checkpoint.
|
canModify, findOpenIndex, getViewNativeHandle, registerIndexgetNativeHandle, isValidHandlepublic static Fork newInstance(long nativeHandle, Cleaner cleaner)
nativeHandle - a handle of the native Fork objectcleaner - a cleaner to perform any operationspublic static Fork newInstance(long nativeHandle, boolean owningHandle, Cleaner cleaner)
nativeHandle - a handle of the native Fork objectowningHandle - whether a proxy owns the corresponding native object and is responsible
to clean it upcleaner - a cleaner to destroy this fork and any dependent objectspublic Cleaner getCleaner()
ViewgetCleaner in class Viewpublic void createCheckpoint()
rollback(). The changes made before the last checkpoint cannot be reverted,
because each new checkpoint replaces the previous: checkpoints are not stacked.
Creating a checkpoint will invalidate all collections that were instantiated with this fork.
This operation is not intended to be used by services.
public void rollback()
Rollback will invalidate all collections that were created with this fork.
This operation is not intended to be used by services.
Copyright © 2019 Exonum. All rights reserved.