public class ReplChangeManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ORIG_LOC_TAG |
static String |
REMAIN_IN_TRASH_TAG |
static String |
URI_FRAGMENT_SEPARATOR |
Modifier and Type | Method and Description |
---|---|
static String |
encodeFileUri(String fileUriStr,
String fileChecksum)
Concatenate filename and checksum with "#"
|
static String |
getChksumString(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.FileSystem fs) |
static org.apache.hadoop.fs.Path |
getCMPath(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
String chksum)
Convert a path of file inside a partition or table (if non-partitioned)
to a deterministic location of cmroot.
|
static org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path src,
String chksumString,
HiveConf conf)
Get original file specified by src and chksumString.
|
static String[] |
getFileWithChksumFromURI(String fileURIStr)
Split uri with fragment into file uri and checksum
|
static ReplChangeManager |
getInstance(HiveConf hiveConf) |
int |
recycle(org.apache.hadoop.fs.Path path,
boolean ifPurge)
Move a path into cmroot.
|
static void |
scheduleCMClearer(HiveConf hiveConf) |
static void |
setCmRoot(org.apache.hadoop.fs.Path cmRoot) |
public static final String ORIG_LOC_TAG
public static final String REMAIN_IN_TRASH_TAG
public static final String URI_FRAGMENT_SEPARATOR
public static ReplChangeManager getInstance(HiveConf hiveConf) throws MetaException
MetaException
public int recycle(org.apache.hadoop.fs.Path path, boolean ifPurge) throws MetaException
path
- a single file or directoryifPurge
- if the file should skip Trash when deleteMetaException
public static String getChksumString(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
public static void setCmRoot(org.apache.hadoop.fs.Path cmRoot)
public static org.apache.hadoop.fs.Path getCMPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, String chksum) throws IOException, MetaException
path
- original path inside partition or tableconf
- chksum
- checksum of the file, can be retrieved by getCksumString
IOException
MetaException
public static org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path src, String chksumString, HiveConf conf) throws MetaException
src
- Original file locationchksumString
- Checksum of the original fileconf
- MetaException
public static String encodeFileUri(String fileUriStr, String fileChecksum)
fileUriStr
- Filename stringfileChecksum
- Checksum stringpublic static String[] getFileWithChksumFromURI(String fileURIStr)
fileURIStr
- uri with fragmentpublic static void scheduleCMClearer(HiveConf hiveConf)
Copyright © 2021 The Apache Software Foundation. All rights reserved.