public class ReplicationSpec extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReplicationSpec.KEY |
static class |
ReplicationSpec.ReplStateMap<K,V extends Comparable>
Class that extends HashMap with a slightly different put semantic, where
put behaves as follows:
a) If the key does not already exist, then retains existing HashMap.put behaviour
b) If the map already contains an entry for the given key, then will replace only
if the new value is "greater" than the old value.
|
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,
boolean isLazy,
boolean isInsert) |
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(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 |
isInsert() |
boolean |
isLazy() |
boolean |
isMetadataOnly() |
boolean |
isNoop() |
void |
setCurrentReplicationState(String currStateId) |
void |
setIsInsert(boolean isInsert) |
void |
setIsMetadataOnly(boolean isMetadataOnly) |
void |
setLazy(boolean isLazy) |
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, boolean isLazy, boolean isInsert)
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 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 void setIsMetadataOnly(boolean isMetadataOnly)
public boolean isInsert()
public void setIsInsert(boolean isInsert)
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 boolean isLazy()
public void setLazy(boolean isLazy)
isLazy
- whether or not the current replication action should be lazypublic String get(ReplicationSpec.KEY key)
public ReplicationSpec.SCOPE getScope()
Copyright © 2021 The Apache Software Foundation. All rights reserved.