public class BookKeeperJournalManager extends Object implements org.apache.hadoop.hdfs.server.namenode.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:
| Modifier and Type | Field and Description |
|---|---|
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 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(org.apache.hadoop.conf.Configuration conf,
URI uri,
org.apache.hadoop.hdfs.server.protocol.NamespaceInfo nsInfo)
Construct a Bookkeeper journal manager.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRollBack(org.apache.hadoop.hdfs.server.common.StorageInfo storage,
org.apache.hadoop.hdfs.server.common.StorageInfo prevStorage,
int targetLayoutVersion) |
void |
close() |
void |
discardSegments(long startTxId) |
void |
doFinalize() |
void |
doPreUpgrade() |
void |
doRollback() |
void |
doUpgrade(org.apache.hadoop.hdfs.server.common.Storage storage) |
void |
finalizeLogSegment(long firstTxId,
long lastTxId)
Finalize a log segment.
|
void |
format(org.apache.hadoop.hdfs.server.protocol.NamespaceInfo ns) |
long |
getJournalCTime() |
boolean |
hasSomeData() |
void |
purgeLogsOlderThan(long minTxIdToKeep) |
void |
recoverUnfinalizedSegments() |
void |
selectInputStreams(Collection<org.apache.hadoop.hdfs.server.namenode.EditLogInputStream> streams,
long fromTxId,
boolean inProgressOk) |
void |
setOutputBufferCapacity(int size)
Set the amount of memory that this stream should use to buffer edits.
|
org.apache.hadoop.hdfs.server.namenode.EditLogOutputStream |
startLogSegment(long txId,
int layoutVersion)
Start a new log segment in a BookKeeper ledger.
|
public 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 BookKeeperJournalManager(org.apache.hadoop.conf.Configuration conf,
URI uri,
org.apache.hadoop.hdfs.server.protocol.NamespaceInfo nsInfo)
throws IOException
IOExceptionpublic void format(org.apache.hadoop.hdfs.server.protocol.NamespaceInfo ns)
throws IOException
format in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic boolean hasSomeData()
throws IOException
hasSomeData in interface org.apache.hadoop.hdfs.server.common.Storage.FormatConfirmableIOExceptionpublic org.apache.hadoop.hdfs.server.namenode.EditLogOutputStream startLogSegment(long txId,
int layoutVersion)
throws IOException
startLogSegment in interface org.apache.hadoop.hdfs.server.namenode.JournalManagertxId - First transaction id to be written to the streamIOExceptionpublic void finalizeLogSegment(long firstTxId,
long lastTxId)
throws IOException
finalizeLogSegment in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void selectInputStreams(Collection<org.apache.hadoop.hdfs.server.namenode.EditLogInputStream> streams, long fromTxId, boolean inProgressOk) throws IOException
IOExceptionpublic void recoverUnfinalizedSegments()
throws IOException
recoverUnfinalizedSegments in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void purgeLogsOlderThan(long minTxIdToKeep)
throws IOException
IOExceptionpublic void discardSegments(long startTxId)
throws IOException
discardSegments in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void doPreUpgrade()
throws IOException
doPreUpgrade in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void doUpgrade(org.apache.hadoop.hdfs.server.common.Storage storage)
throws IOException
doUpgrade in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic long getJournalCTime()
throws IOException
getJournalCTime in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void doFinalize()
throws IOException
doFinalize in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic boolean canRollBack(org.apache.hadoop.hdfs.server.common.StorageInfo storage,
org.apache.hadoop.hdfs.server.common.StorageInfo prevStorage,
int targetLayoutVersion)
throws IOException
canRollBack in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void doRollback()
throws IOException
doRollback in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerIOExceptionpublic void setOutputBufferCapacity(int size)
setOutputBufferCapacity in interface org.apache.hadoop.hdfs.server.namenode.JournalManagerCopyright © 2014 Apache Software Foundation. All Rights Reserved.