public class ReplicationUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REPL_STATE_ID |
Modifier and Type | Method and Description |
---|---|
static Command |
deserializeCommand(String s)
Command implements Writable, but that's not terribly easy to use compared
to String, even if it plugs in easily into the rest of Hadoop.
|
static long |
getLastReplicationId(HCatDatabase db)
Gets the last known replication state of this db.
|
static long |
getLastReplicationId(HCatPartition ptn,
HCatTable parentTable)
Gets the last known replication state of the provided partition.
|
static long |
getLastReplicationId(HCatTable tbl)
Gets the last known replication state of the provided table.
|
static String |
getUniqueKey(long eventId,
String db,
String table,
Map<String,String> ptnDesc)
Used to generate a unique key for a combination of given event id, dbname,
tablename and partition keyvalues.
|
static String |
mapIfMapAvailable(String s,
com.google.common.base.Function<String,String> mapping)
Return a mapping from a given map function if available, and the key itself if not.
|
static String |
partitionDescriptor(Map<String,String> ptnDesc) |
static String |
serializeCommand(Command command)
Command implements Writable, but that's not terribly easy to use compared
to String, even if it plugs in easily into the rest of Hadoop.
|
static String |
toStringWordCharsOnly(String s)
Return alphanumeric(and '_') chars only of a string, lowercased
|
public static final String REPL_STATE_ID
public static long getLastReplicationId(HCatDatabase db)
public static long getLastReplicationId(HCatTable tbl)
public static long getLastReplicationId(HCatPartition ptn, @Nullable HCatTable parentTable)
public static String getUniqueKey(long eventId, String db, String table, Map<String,String> ptnDesc)
public static String toStringWordCharsOnly(String s)
public static String mapIfMapAvailable(String s, com.google.common.base.Function<String,String> mapping)
public static String serializeCommand(Command command) throws IOException
IOException
public static Command deserializeCommand(String s) throws IOException
IOException
Copyright © 2017 The Apache Software Foundation. All rights reserved.