public class BookKeeperJournalManager extends Object implements JournalManager
<property>
<name>dfs.namenode.edits.dir</name>
<value>bookkeeper://zk1:2181;zk2:2181;zk3:2181/hdfsjournal</value>
</property>
<property>
<name>dfs.namenode.edits.journal-plugin.bookkeeper</name>
<value>org.apache.hadoop.contrib.bkjournal.BookKeeperJournalManager</value>
</property>
The URI format for bookkeeper is bookkeeper://[zkEnsemble]/[rootZnode]
[zookkeeper ensemble] is a list of semi-colon separated, zookeeper host:port
pairs. In the example above there are 3 servers, in the ensemble,
zk1, zk2 & zk3, each one listening on port 2181.
[root znode] is the path of the zookeeper znode, under which the editlog
information will be stored.
Other configuration options are:
JournalManager.CorruptionException| Modifier and Type | Field and Description |
|---|---|
static String |
BKJM_BOOKKEEPER_ACK_QUORUM_SIZE |
static int |
BKJM_BOOKKEEPER_ADD_ENTRY_TIMEOUT_DEFAULT |
static String |
BKJM_BOOKKEEPER_ADD_ENTRY_TIMEOUT_SEC |
static String |
BKJM_BOOKKEEPER_DIGEST_PW |
static String |
BKJM_BOOKKEEPER_DIGEST_PW_DEFAULT |
static String |
BKJM_BOOKKEEPER_ENSEMBLE_SIZE |
static int |
BKJM_BOOKKEEPER_ENSEMBLE_SIZE_DEFAULT |
static String |
BKJM_BOOKKEEPER_QUORUM_SIZE |
static int |
BKJM_BOOKKEEPER_QUORUM_SIZE_DEFAULT |
static int |
BKJM_BOOKKEEPER_READ_ENTRY_TIMEOUT_DEFAULT |
static String |
BKJM_BOOKKEEPER_READ_ENTRY_TIMEOUT_SEC |
static int |
BKJM_BOOKKEEPER_SPECULATIVE_READ_TIMEOUT_DEFAULT |
static String |
BKJM_BOOKKEEPER_SPECULATIVE_READ_TIMEOUT_MS |
static String |
BKJM_OUTPUT_BUFFER_SIZE |
static int |
BKJM_OUTPUT_BUFFER_SIZE_DEFAULT |
static String |
BKJM_ZK_LEDGERS_AVAILABLE_PATH |
static String |
BKJM_ZK_LEDGERS_AVAILABLE_PATH_DEFAULT |
static String |
BKJM_ZK_SESSION_TIMEOUT |
static int |
BKJM_ZK_SESSION_TIMEOUT_DEFAULT |
| Constructor and Description |
|---|
BookKeeperJournalManager(Configuration conf,
URI uri,
NamespaceInfo nsInfo)
Construct a Bookkeeper journal manager.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRollBack(StorageInfo storage,
StorageInfo prevStorage,
int targetLayoutVersion) |
void |
close() |
void |
discardSegments(long startTxId) |
void |
doFinalize() |
void |
doPreUpgrade() |
void |
doRollback() |
void |
doUpgrade(Storage storage) |
void |
finalizeLogSegment(long firstTxId,
long lastTxId)
Finalize a log segment.
|
void |
format(NamespaceInfo ns) |
long |
getJournalCTime() |
boolean |
hasSomeData() |
void |
purgeLogsOlderThan(long minTxIdToKeep) |
void |
recoverUnfinalizedSegments() |
void |
selectInputStreams(Collection<EditLogInputStream> streams,
long fromTxId,
boolean inProgressOk) |
void |
setOutputBufferCapacity(int size)
Set the amount of memory that this stream should use to buffer edits.
|
EditLogOutputStream |
startLogSegment(long txId,
int layoutVersion)
Start a new log segment in a BookKeeper ledger.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic static final String BKJM_OUTPUT_BUFFER_SIZE
public static final int BKJM_OUTPUT_BUFFER_SIZE_DEFAULT
public static final String BKJM_BOOKKEEPER_ENSEMBLE_SIZE
public static final int BKJM_BOOKKEEPER_ENSEMBLE_SIZE_DEFAULT
public static final String BKJM_BOOKKEEPER_QUORUM_SIZE
public static final int BKJM_BOOKKEEPER_QUORUM_SIZE_DEFAULT
public static final String BKJM_BOOKKEEPER_DIGEST_PW
public static final String BKJM_BOOKKEEPER_DIGEST_PW_DEFAULT
public static final String BKJM_ZK_SESSION_TIMEOUT
public static final int BKJM_ZK_SESSION_TIMEOUT_DEFAULT
public static final String BKJM_ZK_LEDGERS_AVAILABLE_PATH
public static final String BKJM_ZK_LEDGERS_AVAILABLE_PATH_DEFAULT
public static final String BKJM_BOOKKEEPER_SPECULATIVE_READ_TIMEOUT_MS
public static final int BKJM_BOOKKEEPER_SPECULATIVE_READ_TIMEOUT_DEFAULT
public static final String BKJM_BOOKKEEPER_READ_ENTRY_TIMEOUT_SEC
public static final int BKJM_BOOKKEEPER_READ_ENTRY_TIMEOUT_DEFAULT
public static final String BKJM_BOOKKEEPER_ACK_QUORUM_SIZE
public static final String BKJM_BOOKKEEPER_ADD_ENTRY_TIMEOUT_SEC
public static final int BKJM_BOOKKEEPER_ADD_ENTRY_TIMEOUT_DEFAULT
public BookKeeperJournalManager(Configuration conf, URI uri, NamespaceInfo nsInfo) throws IOException
IOExceptionpublic void format(NamespaceInfo ns) throws IOException
format in interface JournalManagerIOExceptionpublic boolean hasSomeData()
throws IOException
hasSomeData in interface Storage.FormatConfirmableIOExceptionpublic EditLogOutputStream startLogSegment(long txId, int layoutVersion) throws IOException
startLogSegment in interface JournalManagertxId - First transaction id to be written to the streamIOExceptionpublic void finalizeLogSegment(long firstTxId,
long lastTxId)
throws IOException
finalizeLogSegment in interface JournalManagerIOExceptionpublic void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxId, boolean inProgressOk) throws IOException
IOExceptionpublic void recoverUnfinalizedSegments()
throws IOException
recoverUnfinalizedSegments in interface JournalManagerIOExceptionpublic void purgeLogsOlderThan(long minTxIdToKeep)
throws IOException
IOExceptionpublic void discardSegments(long startTxId)
throws IOException
discardSegments in interface JournalManagerIOExceptionpublic void doPreUpgrade()
throws IOException
doPreUpgrade in interface JournalManagerIOExceptionpublic void doUpgrade(Storage storage) throws IOException
doUpgrade in interface JournalManagerIOExceptionpublic long getJournalCTime()
throws IOException
getJournalCTime in interface JournalManagerIOExceptionpublic void doFinalize()
throws IOException
doFinalize in interface JournalManagerIOExceptionpublic boolean canRollBack(StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion) throws IOException
canRollBack in interface JournalManagerIOExceptionpublic void doRollback()
throws IOException
doRollback in interface JournalManagerIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface JournalManagerIOExceptionpublic void setOutputBufferCapacity(int size)
setOutputBufferCapacity in interface JournalManagerCopyright © 2018 CERN. All Rights Reserved.