| Package | Description |
|---|---|
| journal.io.api |
| Modifier and Type | Method and Description |
|---|---|
Location |
Journal.write(byte[] data,
Journal.WriteType write)
Write the given byte buffer record, either sync (if
WriteType.SYNC) or async (if WriteType.ASYNC), and
returns the stored Location.A sync write causes all previously batched async writes to be synced too. |
Location |
Journal.write(byte[] data,
Journal.WriteType write,
WriteCallback callback)
Write the given byte buffer record, either sync (if
WriteType.SYNC) or async (if WriteType.ASYNC), and
returns the stored Location.A sync write causes all previously batched async writes to be synced too. The provided callback will be invoked if sync is completed or if some error occurs during syncing. |
| Modifier and Type | Method and Description |
|---|---|
Iterable<Location> |
Journal.redo()
Return an iterable to replay the journal by going through all records
locations.
|
Iterable<Location> |
Journal.redo(Location start)
Return an iterable to replay the journal by going through all records
locations starting from the given one.
|
Iterable<Location> |
Journal.undo()
Return an iterable to replay the journal in reverse, starting with the
newest location and ending with the first.
|
Iterable<Location> |
Journal.undo(Location end)
Return an iterable to replay the journal in reverse, starting with the
newest location and ending with the specified end location.
|
| Modifier and Type | Method and Description |
|---|---|
int |
Location.compareTo(Location o) |
void |
Journal.delete(Location location)
Delete the record at the given
Location.Deletes cause first a batch sync and always are logical: records will be actually deleted at log cleanup time. |
void |
WriteCallback.onError(Location location,
Throwable error)
Method called after failed write syncing.
|
void |
WriteCallback.onSync(Location syncedLocation)
Method called after successful write syncing.
|
byte[] |
Journal.read(Location location,
Journal.ReadType read)
Read the record stored at the given
Location, either by syncing
with the disk state (if ReadType.SYNC) or by taking advantage of
speculative disk reads (if ReadType.ASYNC); the latter is faster,
while the former is slower but will suddenly detect deleted records. |
Iterable<Location> |
Journal.redo(Location start)
Return an iterable to replay the journal by going through all records
locations starting from the given one.
|
void |
ReplicationTarget.replicate(Location startLocation,
byte[] data) |
Iterable<Location> |
Journal.undo(Location end)
Return an iterable to replay the journal in reverse, starting with the
newest location and ending with the specified end location.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RecoveryErrorHandler.onError(Journal journal,
List<Location> locations)
Invoked by the journal during its recovery process in case of a checksum
error for the given locations.
|
void |
RecoveryErrorHandler.AbortOnError.onError(Journal journal,
List<Location> locations) |
void |
RecoveryErrorHandler.DeleteOnError.onError(Journal journal,
List<Location> locations) |
void |
RecoveryErrorHandler.IgnoreOnError.onError(Journal journal,
List<Location> locations) |
| Constructor and Description |
|---|
Location(Location source) |
Copyright © 2014. All Rights Reserved.