public abstract class AbstractReplicationProtocol extends Object implements IReplicationProtocol
Modifier and Type | Field and Description |
---|---|
protected IHoleFillPolicy |
holeFillPolicy
The hole fill policy to apply.
|
Constructor and Description |
---|
AbstractReplicationProtocol(IHoleFillPolicy holeFillPolicy)
Build the replication protocol using the given hole filling policy.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
holeFill(RuntimeLayout runtimeLayout,
long globalAddress)
Write a special hole filling entry using the
given address.
|
ILogData |
read(RuntimeLayout runtimeLayout,
long globalAddress)
Read data from a given address.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
peek, readAll, write
protected final IHoleFillPolicy holeFillPolicy
public AbstractReplicationProtocol(IHoleFillPolicy holeFillPolicy)
holeFillPolicy
- The hole filling policy to be applied when
a read returns uncommitted data.@Nonnull public ILogData read(RuntimeLayout runtimeLayout, long globalAddress)
This function only returns committed data. If the address given has not committed, the implementation may either block until it is committed, or commit a hole filling entry to that address.
In the base implementation, we attempt to read data using the peek method. If data is returned by peek, we use it. Otherwise, we invoke the hole filling protocol.
read
in interface IReplicationProtocol
runtimeLayout
- the RuntimeLayout stamped with layout to use for the read.globalAddress
- the global address to read the data from.protected abstract void holeFill(RuntimeLayout runtimeLayout, long globalAddress)
globalAddress
- The address to hole fill.Copyright © 2019 CorfuDB. All rights reserved.