public class ReplicationSpec extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReplicationSpec.KEY |
static class |
ReplicationSpec.SCOPE |
Constructor and Description |
---|
ReplicationSpec()
Default ctor that is useful for determining default states
|
ReplicationSpec(ASTNode node)
Constructor to construct spec based on either the ASTNode that
corresponds to the replication clause itself, or corresponds to
the parent node, and will scan through the children to instantiate
itself.
|
ReplicationSpec(boolean isInReplicationScope,
boolean isMetadataOnly,
String eventReplicationState,
String currentReplicationState,
boolean isNoop) |
ReplicationSpec(com.google.common.base.Function<String,String> keyFetcher) |
Modifier and Type | Method and Description |
---|---|
com.google.common.base.Predicate<Partition> |
allowEventReplacementInto()
Returns a predicate filter to filter an Iterable
|
boolean |
allowEventReplacementInto(Partition ptn)
Determines if a current replication event specification is allowed to
replicate-replace-into a given partition
|
boolean |
allowEventReplacementInto(Table table)
Determines if a current replication event specification is allowed to
replicate-replace-into a given table
|
static boolean |
allowReplacement(String currReplState,
String replacementReplState) |
boolean |
allowReplacementInto(Partition ptn)
Determines if a current replication object(current state of dump) is allowed to
replicate-replace-into a given partition
|
boolean |
allowReplacementInto(Table table)
Determines if a current replication object(current state of dump) is allowed to
replicate-replace-into a given table
|
String |
get(ReplicationSpec.KEY key) |
String |
getCurrentReplicationState() |
String |
getReplicationState() |
ReplicationSpec.SCOPE |
getScope() |
static boolean |
isApplicable(ASTNode node)
Tests if an ASTNode is a Replication Specification
|
boolean |
isInReplicationScope() |
boolean |
isMetadataOnly() |
boolean |
isNoop() |
void |
setCurrentReplicationState(String currStateId) |
void |
setNoop(boolean isNoop) |
public ReplicationSpec(ASTNode node)
node
- replicationClause node, or parent of replicationClause nodepublic ReplicationSpec()
public ReplicationSpec(boolean isInReplicationScope, boolean isMetadataOnly, String eventReplicationState, String currentReplicationState, boolean isNoop)
public static boolean isApplicable(ASTNode node)
public static boolean allowReplacement(String currReplState, String replacementReplState)
currReplState
- Current object statereplacementReplState
- Replacement-candidate statepublic boolean allowReplacementInto(Partition ptn)
public boolean allowEventReplacementInto(Partition ptn)
public boolean allowReplacementInto(Table table)
public boolean allowEventReplacementInto(Table table)
public com.google.common.base.Predicate<Partition> allowEventReplacementInto()
public boolean isInReplicationScope()
public boolean isMetadataOnly()
public String getReplicationState()
public String getCurrentReplicationState()
public void setCurrentReplicationState(String currStateId)
public boolean isNoop()
public void setNoop(boolean isNoop)
isNoop
- whether or not the current replication action should be a nooppublic String get(ReplicationSpec.KEY key)
public ReplicationSpec.SCOPE getScope()
Copyright © 2017 The Apache Software Foundation. All rights reserved.