HBASE-7098 Fix minor typos and formatting issues in HFileArchiver/HFileLink
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1406860 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e7f5eea91c
commit
0cf5cfec84
|
@ -204,7 +204,7 @@ public class HFileArchiver {
|
||||||
* Archive the given files and resolve any conflicts with existing files via appending the time
|
* Archive the given files and resolve any conflicts with existing files via appending the time
|
||||||
* archiving started (so all conflicts in the same group have the same timestamp appended).
|
* archiving started (so all conflicts in the same group have the same timestamp appended).
|
||||||
* <p>
|
* <p>
|
||||||
* If any of the passed files to archive are directories, archives the all files under that
|
* If any of the passed files to archive are directories, archives all the files under that
|
||||||
* directory. Archive directory structure for children is the base archive directory name + the
|
* directory. Archive directory structure for children is the base archive directory name + the
|
||||||
* parent directory and is built recursively is passed files are directories themselves.
|
* parent directory and is built recursively is passed files are directories themselves.
|
||||||
* @param fs {@link FileSystem} on which to archive the files
|
* @param fs {@link FileSystem} on which to archive the files
|
||||||
|
|
|
@ -47,7 +47,7 @@ class HFileArchiveManager {
|
||||||
|
|
||||||
public HFileArchiveManager(HConnection connection, Configuration conf)
|
public HFileArchiveManager(HConnection connection, Configuration conf)
|
||||||
throws ZooKeeperConnectionException, IOException {
|
throws ZooKeeperConnectionException, IOException {
|
||||||
this.zooKeeper = new ZooKeeperWatcher(conf, "hfileArchiveManger-on-" + connection.toString(),
|
this.zooKeeper = new ZooKeeperWatcher(conf, "hfileArchiveManager-on-" + connection.toString(),
|
||||||
connection);
|
connection);
|
||||||
this.archiveZnode = ZKTableArchiveClient.getArchiveZNode(this.zooKeeper.getConfiguration(),
|
this.archiveZnode = ZKTableArchiveClient.getArchiveZNode(this.zooKeeper.getConfiguration(),
|
||||||
this.zooKeeper);
|
this.zooKeeper);
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.util.FSUtils;
|
import org.apache.hadoop.hbase.util.FSUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The FileLink is a sort of hardlink, that allows to access a file given a set of locations.
|
* The FileLink is a sort of hardlink, that allows access to a file given a set of locations.
|
||||||
*
|
*
|
||||||
* <p><b>The Problem:</b>
|
* <p><b>The Problem:</b>
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -49,7 +49,7 @@ import org.apache.hadoop.hbase.util.FSUtils;
|
||||||
* </li>
|
* </li>
|
||||||
* <li>
|
* <li>
|
||||||
* HBase store files in one location (e.g. table/region/family/) and when the file is not
|
* HBase store files in one location (e.g. table/region/family/) and when the file is not
|
||||||
* needed anymore (e.g. compaction, region deletetion, ...) moves it to an archive directory.
|
* needed anymore (e.g. compaction, region deletion, ...) moves it to an archive directory.
|
||||||
* </li>
|
* </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* If we want to create a reference to a file, we need to remember that it can be in its
|
* If we want to create a reference to a file, we need to remember that it can be in its
|
||||||
|
@ -83,7 +83,7 @@ import org.apache.hadoop.hbase.util.FSUtils;
|
||||||
* (Back-reference to the link in table-cloned)
|
* (Back-reference to the link in table-cloned)
|
||||||
* </li>
|
* </li>
|
||||||
* <li>
|
* <li>
|
||||||
* /hbase/.archive/table/region-x/.links-file-k/region-z.table-cloned
|
* /hbase/.archive/table/region-x/.links-file-k/region-z.table-2nd-cloned
|
||||||
* (Back-reference to the link in table-2nd-cloned)
|
* (Back-reference to the link in table-2nd-cloned)
|
||||||
* </li>
|
* </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
|
|
@ -73,7 +73,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Chore
|
||||||
protected abstract boolean validate(Path file);
|
protected abstract boolean validate(Path file);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instanitate and initialize all the file cleaners set in the configuration
|
* Instantiate and initialize all the file cleaners set in the configuration
|
||||||
* @param confKey key to get the file cleaner classes from the configuration
|
* @param confKey key to get the file cleaner classes from the configuration
|
||||||
*/
|
*/
|
||||||
private void initCleanerChain(String confKey) {
|
private void initCleanerChain(String confKey) {
|
||||||
|
@ -129,7 +129,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Chore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn("Failed to get status of:" + oldFileDir);
|
LOG.warn("Failed to get status of: " + oldFileDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Chore
|
||||||
LOG.warn("Found a wrongly formatted file: " + filePath.getName() + " deleting it.");
|
LOG.warn("Found a wrongly formatted file: " + filePath.getName() + " deleting it.");
|
||||||
boolean success = this.fs.delete(filePath, true);
|
boolean success = this.fs.delete(filePath, true);
|
||||||
if(!success)
|
if(!success)
|
||||||
LOG.warn("Attempted to delete:" + filePath
|
LOG.warn("Attempted to delete: " + filePath
|
||||||
+ ", but couldn't. Run cleaner chain and attempt to delete on next pass.");
|
+ ", but couldn't. Run cleaner chain and attempt to delete on next pass.");
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
@ -205,7 +205,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Chore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// delete this file if it passes all the cleaners
|
// delete this file if it passes all the cleaners
|
||||||
LOG.debug("Removing:" + filePath + " from archive");
|
LOG.debug("Removing: " + filePath + " from archive");
|
||||||
boolean success = this.fs.delete(filePath, false);
|
boolean success = this.fs.delete(filePath, false);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
LOG.warn("Attempted to delete:" + filePath
|
LOG.warn("Attempted to delete:" + filePath
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class HFileLinkCleaner extends BaseHFileCleanerDelegate {
|
||||||
// HFile Link is always deletable
|
// HFile Link is always deletable
|
||||||
if (HFileLink.isHFileLink(filePath)) return true;
|
if (HFileLink.isHFileLink(filePath)) return true;
|
||||||
|
|
||||||
// If the file is inside a link references directory, means that is a back ref link.
|
// If the file is inside a link references directory, means that it is a back ref link.
|
||||||
// The back ref can be deleted only if the referenced file doesn't exists.
|
// The back ref can be deleted only if the referenced file doesn't exists.
|
||||||
Path parentDir = filePath.getParent();
|
Path parentDir = filePath.getParent();
|
||||||
if (HFileLink.isBackReferencesDir(parentDir)) {
|
if (HFileLink.isBackReferencesDir(parentDir)) {
|
||||||
|
|
Loading…
Reference in New Issue