@InterfaceStability.Evolving public abstract class ReplicationTask extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ReplicationTask.Factory |
Modifier and Type | Field and Description |
---|---|
protected com.google.common.base.Function<String,String> |
dbNameMapping |
protected StagingDirectoryProvider |
dstStagingDirProvider |
protected HCatNotificationEvent |
event |
protected static MessageFactory |
messageFactory |
protected StagingDirectoryProvider |
srcStagingDirProvider |
protected com.google.common.base.Function<String,String> |
tableNameMapping |
Modifier | Constructor and Description |
---|---|
protected |
ReplicationTask(HCatNotificationEvent event) |
Modifier and Type | Method and Description |
---|---|
static ReplicationTask |
create(HCatClient client,
HCatNotificationEvent event)
Factory method to return appropriate subtype of ReplicationTask for given event
|
abstract Iterable<? extends Command> |
getDstWhCommands()
Returns a Iterable
|
HCatNotificationEvent |
getEvent()
Returns the event that this ReplicationTask is attempting to replicate
|
abstract Iterable<? extends Command> |
getSrcWhCommands()
Returns a Iterable
|
boolean |
isActionable()
Returns true if this ReplicationTask is prepared with all info it needs, and is
ready to be used
|
abstract boolean |
needsStagingDirs()
Returns true if the replication task in question needs to create staging
directories to complete its operation.
|
static void |
resetFactory(Class<? extends ReplicationTask.Factory> factoryClass)
Package scoped method used for testing - allows resetting the ReplicationTaskFactory used
|
protected void |
validateEventType(HCatNotificationEvent event,
String allowedEventType) |
protected void |
verifyActionable() |
ReplicationTask |
withDbNameMapping(com.google.common.base.Function<String,String> dbNameMapping)
Allows a user to specify a db name mapping, where the the function provided maps the name of
the db in the source warehouse to the name of the db in the dest warehouse.
|
ReplicationTask |
withDstStagingDirProvider(StagingDirectoryProvider dstStagingDirProvider)
|
ReplicationTask |
withSrcStagingDirProvider(StagingDirectoryProvider srcStagingDirProvider)
|
ReplicationTask |
withTableNameMapping(com.google.common.base.Function<String,String> tableNameMapping)
Allows a user to specify a table name mapping, where the the function provided maps the name of
the table in the source warehouse to the name of the table in the dest warehouse.
|
protected HCatNotificationEvent event
protected StagingDirectoryProvider srcStagingDirProvider
protected StagingDirectoryProvider dstStagingDirProvider
protected static MessageFactory messageFactory
protected ReplicationTask(HCatNotificationEvent event)
public static void resetFactory(Class<? extends ReplicationTask.Factory> factoryClass)
factoryClass
- The new ReplicationTaskFactory to use.public static ReplicationTask create(HCatClient client, HCatNotificationEvent event)
event
- HCatEventMessage returned by the notification subsystempublic HCatNotificationEvent getEvent()
public abstract boolean needsStagingDirs()
public boolean isActionable()
public ReplicationTask withSrcStagingDirProvider(StagingDirectoryProvider srcStagingDirProvider)
srcStagingDirProvider
- Staging Directory Provider for the source warehousepublic ReplicationTask withDstStagingDirProvider(StagingDirectoryProvider dstStagingDirProvider)
dstStagingDirProvider
- Staging Directory Provider for the destination warehousepublic ReplicationTask withTableNameMapping(com.google.common.base.Function<String,String> tableNameMapping)
tableNameMapping
- public ReplicationTask withDbNameMapping(com.google.common.base.Function<String,String> dbNameMapping)
dbNameMapping
- protected void verifyActionable()
public abstract Iterable<? extends Command> getSrcWhCommands()
public abstract Iterable<? extends Command> getDstWhCommands()
protected void validateEventType(HCatNotificationEvent event, String allowedEventType)
Copyright © 2017 The Apache Software Foundation. All rights reserved.