|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.backup.example.ZKTableArchiveClient
@InterfaceAudience.Public public class ZKTableArchiveClient
Example class for how to use the table archiving coordinated via zookeeper
Constructor Summary | |
---|---|
ZKTableArchiveClient(org.apache.hadoop.conf.Configuration conf,
HConnection connection)
|
Method Summary | |
---|---|
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 |
Methods inherited from class org.apache.hadoop.conf.Configured |
---|
getConf, setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZKTableArchiveClient(org.apache.hadoop.conf.Configuration conf, HConnection connection)
Method Detail |
---|
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 up
IOException
- if an unexpected exception occurs
org.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 up
IOException
- if an unexpected exception occurs
org.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 up
IOException
- if an unexpected exception occurs
org.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 occurs
org.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 check
IOException
- if a connection to ZooKeeper cannot be established
org.apache.zookeeper.KeeperException
public boolean getArchivingEnabled(String table) throws IOException, org.apache.zookeeper.KeeperException
table
- name of the table to check
IOException
- if an unexpected network issue occurs
org.apache.zookeeper.KeeperException
- if zookeeper can't be reachedpublic 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 path
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |