|
24 | 24 | import com.orientechnologies.orient.core.storage.impl.local.paginated.wal.*;
|
25 | 25 |
|
26 | 26 | /**
|
| 27 | + * Base class for all durable data structures, that is data structures state of which can be consistently restored after system |
| 28 | + * crash but results of last operations in small interval before crash may be lost. |
| 29 | + * |
| 30 | + * This class contains methods which are used to support such concepts as: |
| 31 | + * <ol> |
| 32 | + * <li>"atomic operation" - set of operations which should be either applied together or not. It includes not only changes on |
| 33 | + * current data structure but on all durable data structures which are used by current one during implementation of specific |
| 34 | + * operation.</li> |
| 35 | + * <li>write ahead log - log of all changes which were done with page content after loading it from cache.</li> |
| 36 | + * </ol> |
| 37 | + * |
| 38 | + * |
| 39 | + * To support of "atomic operation" concept following should be done: |
| 40 | + * <ol> |
| 41 | + * <li>Call {@link #startAtomicOperation()} method.</li> |
| 42 | + * <li>If changes should be isolated till operation completes call also {@link #lockTillAtomicOperationCompletes()} which will apply |
| 43 | + * exclusive lock on existing data structure till atomic operation completes. This lock is not replacement of data structure locking |
| 44 | + * system it is used to serialize access to set of components which participate in single atomic operation. It is kind of rudiment |
| 45 | + * lock manager which is used to isolate access to units which participate in single transaction and which is going to be created to |
| 46 | + * provide efficient multi core scalability feature. It is recommended to always call it just after start of atomic operation but |
| 47 | + * always remember it is not replacement of thread safety mechanics for current data structure it is a mean to provide isolation |
| 48 | + * between atomic operations.</li> |
| 49 | + * <li>Log all page changes in WAL by calling of {@link #logPageChanges(ODurablePage, long, long, boolean)}</li> |
| 50 | + * <li>Call {@link #endAtomicOperation(boolean)} method when atomic operation completes, passed in parameter should be |
| 51 | + * <code>false</code> if atomic operation completes with success and <code>true</code> if there were some exceptions and it is |
| 52 | + * needed to rollback given operation.</li> |
| 53 | + * </ol> |
| 54 | + * |
| 55 | + * |
27 | 56 | * @author Andrey Lomakin
|
28 | 57 | * @since 8/27/13
|
29 | 58 | */
|
|
0 commit comments