@InterfaceAudience.Private public class ZKTableArchiveClient extends org.apache.hadoop.conf.Configured
Modifier and Type | Field and Description |
---|---|
private ClusterConnection |
connection |
private static String |
ZOOKEEPER_ZNODE_HFILE_ARCHIVE_KEY
Configuration key for the archive node.
|
Constructor and Description |
---|
ZKTableArchiveClient(org.apache.hadoop.conf.Configuration conf,
ClusterConnection connection) |
Modifier and Type | Method and Description |
---|---|
private HFileArchiveManager |
createHFileArchiveManager() |
void |
disableHFileBackup()
Disable hfile backups for all tables.
|
void |
disableHFileBackup(byte[] table)
Disable hfile backups for the given table.
|
void |
disableHFileBackup(String table)
Disable hfile backups for the given table.
|
void |
enableHFileBackupAsync(byte[] table)
Turn on backups for all HFiles for the given table.
|
static String |
getArchiveZNode(org.apache.hadoop.conf.Configuration conf,
ZooKeeperWatcher zooKeeper) |
boolean |
getArchivingEnabled(byte[] table)
Determine if archiving is enabled (but not necessarily fully propagated) for a table
|
boolean |
getArchivingEnabled(String table)
Determine if archiving is enabled (but not necessarily fully propagated) for a table
|
private static final String ZOOKEEPER_ZNODE_HFILE_ARCHIVE_KEY
private ClusterConnection connection
public ZKTableArchiveClient(org.apache.hadoop.conf.Configuration conf, ClusterConnection connection)
public void enableHFileBackupAsync(byte[] table) throws IOException, org.apache.zookeeper.KeeperException
All deleted hfiles are moved to the archive directory under the table directory, rather than being deleted.
If backups are already enabled for this table, does nothing.
If the table does not exist, the archiving the table's hfiles is still enabled as a future table with that name may be created shortly.
table
- name of the table to start backing upIOException
- if an unexpected exception occursorg.apache.zookeeper.KeeperException
- if zookeeper can't be reachedpublic void disableHFileBackup(String table) throws IOException, org.apache.zookeeper.KeeperException
Previously backed up files are still retained (if present).
Asynchronous operation - some extra HFiles may be retained, in the archive directory after disable is called, dependent on the latency in zookeeper to the servers.
table
- name of the table stop backing upIOException
- if an unexpected exception occursorg.apache.zookeeper.KeeperException
- if zookeeper can't be reachedpublic void disableHFileBackup(byte[] table) throws IOException, org.apache.zookeeper.KeeperException
Previously backed up files are still retained (if present).
Asynchronous operation - some extra HFiles may be retained, in the archive directory after disable is called, dependent on the latency in zookeeper to the servers.
table
- name of the table stop backing upIOException
- if an unexpected exception occursorg.apache.zookeeper.KeeperException
- if zookeeper can't be reachedpublic void disableHFileBackup() throws IOException, org.apache.zookeeper.KeeperException
Previously backed up files are still retained (if present).
Asynchronous operation - some extra HFiles may be retained, in the archive directory after disable is called, dependent on the latency in zookeeper to the servers.
IOException
- if an unexpected exception occursorg.apache.zookeeper.KeeperException
- if zookeeper can't be reachedpublic boolean getArchivingEnabled(byte[] table) throws IOException, org.apache.zookeeper.KeeperException
table
- name of the table to checkIOException
- if a connection to ZooKeeper cannot be establishedorg.apache.zookeeper.KeeperException
public boolean getArchivingEnabled(String table) throws IOException, org.apache.zookeeper.KeeperException
table
- name of the table to checkIOException
- if an unexpected network issue occursorg.apache.zookeeper.KeeperException
- if zookeeper can't be reachedprivate HFileArchiveManager createHFileArchiveManager() throws org.apache.zookeeper.KeeperException, IOException
HFileArchiveManager
to manage which tables' hfiles should be archived
rather than deleted.org.apache.zookeeper.KeeperException
- if we can't reach zookeeperIOException
- if an unexpected network issue occurspublic static String getArchiveZNode(org.apache.hadoop.conf.Configuration conf, ZooKeeperWatcher zooKeeper)
conf
- conf to read for the base archive nodezooKeeper
- zookeeper to used for building the full pathCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.