@InterfaceAudience.Private public class Replication extends Object implements WALActionsListener, ReplicationSourceService, ReplicationSinkService
HRegionServer.| Constructor and Description |
|---|
Replication()
Empty constructor
|
Replication(Server server,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir)
Instantiate the replication management (if rep is enabled).
|
| Modifier and Type | Method and Description |
|---|---|
static void |
decorateMasterConfiguration(org.apache.hadoop.conf.Configuration conf)
This method modifies the master's configuration in order to inject
replication-related features
|
ReplicationSourceManager |
getReplicationManager()
Get the replication sources manager
|
WALActionsListener |
getWALActionsListener()
Returns a WALObserver for the service.
|
void |
initialize(Server server,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir)
Initializes the replication service object.
|
static boolean |
isReplication(org.apache.hadoop.conf.Configuration c) |
void |
join()
Join with the replication threads
|
void |
logCloseRequested()
The WAL is about to close.
|
void |
logRollRequested()
A request was made that the WAL be rolled.
|
void |
postLogArchive(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
The WAL has been archived.
|
void |
postLogRoll(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
The WAL has been rolled.
|
void |
preLogArchive(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
The WAL is going to be archived.
|
void |
preLogRoll(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
The WAL is going to be rolled.
|
void |
replicateLogEntries(List<AdminProtos.WALEntry> entries,
CellScanner cells)
Carry on the list of log entries down to the sink
|
static void |
scopeWALEdits(HTableDescriptor htd,
HLogKey logKey,
WALEdit logEdit)
Utility method used to set the correct scopes on each log key.
|
void |
startReplicationService()
If replication is enabled and this cluster is a master,
it starts
|
void |
stopReplicationService()
Stops replication service.
|
void |
visitLogEntryBeforeWrite(HRegionInfo info,
HLogKey logKey,
WALEdit logEdit)
Called before each write.
|
void |
visitLogEntryBeforeWrite(HTableDescriptor htd,
HLogKey logKey,
WALEdit logEdit) |
public Replication(Server server, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path logDir, org.apache.hadoop.fs.Path oldLogDir) throws IOException
server - Hosting serverfs - handle to the filesystemlogDir - oldLogDir - directory where logs are archivedIOExceptionpublic Replication()
public void initialize(Server server, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path logDir, org.apache.hadoop.fs.Path oldLogDir) throws IOException
ReplicationServiceinitialize in interface ReplicationServiceIOExceptionpublic static boolean isReplication(org.apache.hadoop.conf.Configuration c)
c - Configuration to look atpublic WALActionsListener getWALActionsListener()
ReplicationSourceServicegetWALActionsListener in interface ReplicationSourceServicepublic void stopReplicationService()
stopReplicationService in interface ReplicationServicepublic void join()
public void replicateLogEntries(List<AdminProtos.WALEntry> entries, CellScanner cells) throws IOException
replicateLogEntries in interface ReplicationSinkServiceentries - list of entries to replicatecells - The data -- the cells -- that entries describes (the entries
do not contain the Cells we are replicating; they are passed here on the side in this
CellScanner).IOExceptionpublic void startReplicationService()
throws IOException
startReplicationService in interface ReplicationServiceIOExceptionpublic ReplicationSourceManager getReplicationManager()
public void visitLogEntryBeforeWrite(HRegionInfo info, HLogKey logKey, WALEdit logEdit)
WALActionsListenervisitLogEntryBeforeWrite in interface WALActionsListenerpublic void visitLogEntryBeforeWrite(HTableDescriptor htd, HLogKey logKey, WALEdit logEdit)
visitLogEntryBeforeWrite in interface WALActionsListenerpublic static void scopeWALEdits(HTableDescriptor htd, HLogKey logKey, WALEdit logEdit)
htd - Descriptor used to find the scope to uselogKey - Key that may get scoped according to its editslogEdit - Edits used to lookup the scopespublic void preLogRoll(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
throws IOException
WALActionsListenerpreLogRoll in interface WALActionsListeneroldPath - the path to the old hlognewPath - the path to the new hlogIOExceptionpublic void postLogRoll(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
throws IOException
WALActionsListenerpostLogRoll in interface WALActionsListeneroldPath - the path to the old hlognewPath - the path to the new hlogIOExceptionpublic void preLogArchive(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
throws IOException
WALActionsListenerpreLogArchive in interface WALActionsListeneroldPath - the path to the old hlognewPath - the path to the new hlogIOExceptionpublic void postLogArchive(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
throws IOException
WALActionsListenerpostLogArchive in interface WALActionsListeneroldPath - the path to the old hlognewPath - the path to the new hlogIOExceptionpublic static void decorateMasterConfiguration(org.apache.hadoop.conf.Configuration conf)
conf - public void logRollRequested()
WALActionsListenerlogRollRequested in interface WALActionsListenerpublic void logCloseRequested()
WALActionsListenerlogCloseRequested in interface WALActionsListenerCopyright © 2014 The Apache Software Foundation. All rights reserved.