Java Code Examples for org.apache.hadoop.hdfs.protocol.HdfsConstants#RESERVED_PATH_COMPONENTS

The following examples show how to use org.apache.hadoop.hdfs.protocol.HdfsConstants#RESERVED_PATH_COMPONENTS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DFSUtil.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Returns if the component is reserved.
 * 
 * <p>
 * Note that some components are only reserved under certain directories, e.g.
 * "/.reserved" is reserved, while "/hadoop/.reserved" is not.
 * @return true, if the component is reserved
 */
public static boolean isReservedPathComponent(String component) {
  for (String reserved : HdfsConstants.RESERVED_PATH_COMPONENTS) {
    if (component.equals(reserved)) {
      return true;
    }
  }
  return false;
}
 
Example 2
Source File: FSImageFormat.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Use the default key-value pairs that will be used to determine how to
 * rename reserved paths on upgrade.
 */
@VisibleForTesting
public static void useDefaultRenameReservedPairs() {
  renameReservedMap.clear();
  for (String key: HdfsConstants.RESERVED_PATH_COMPONENTS) {
    renameReservedMap.put(
        key,
        key + "." + HdfsConstants.NAMENODE_LAYOUT_VERSION + "."
            + "UPGRADE_RENAMED");
  }
}
 
Example 3
Source File: DFSUtil.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Returns if the component is reserved.
 * 
 * <p>
 * Note that some components are only reserved under certain directories, e.g.
 * "/.reserved" is reserved, while "/hadoop/.reserved" is not.
 * @return true, if the component is reserved
 */
public static boolean isReservedPathComponent(String component) {
  for (String reserved : HdfsConstants.RESERVED_PATH_COMPONENTS) {
    if (component.equals(reserved)) {
      return true;
    }
  }
  return false;
}
 
Example 4
Source File: FSImageFormat.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Use the default key-value pairs that will be used to determine how to
 * rename reserved paths on upgrade.
 */
@VisibleForTesting
public static void useDefaultRenameReservedPairs() {
  renameReservedMap.clear();
  for (String key: HdfsConstants.RESERVED_PATH_COMPONENTS) {
    renameReservedMap.put(
        key,
        key + "." + HdfsConstants.NAMENODE_LAYOUT_VERSION + "."
            + "UPGRADE_RENAMED");
  }
}