本文整理汇总了Java中org.apache.hadoop.hbase.util.FSUtils.setVersion方法的典型用法代码示例。如果您正苦于以下问题:Java FSUtils.setVersion方法的具体用法?Java FSUtils.setVersion怎么用?Java FSUtils.setVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.util.FSUtils
的用法示例。
在下文中一共展示了FSUtils.setVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: upgradeTableDirs
import org.apache.hadoop.hbase.util.FSUtils; //导入方法依赖的package包/类
public void upgradeTableDirs() throws IOException, DeserializationException {
// if new version is written then upgrade is done
if (verifyNSUpgrade(fs, rootDir)) {
return;
}
makeNamespaceDirs();
migrateTables();
migrateSnapshots();
migrateDotDirs();
migrateMeta();
migrateACL();
deleteRoot();
FSUtils.setVersion(fs, rootDir);
}
示例2: createRootDir
import org.apache.hadoop.hbase.util.FSUtils; //导入方法依赖的package包/类
/**
* Creates an hbase rootdir in user home directory. Also creates hbase
* version file. Normally you won't make use of this method. Root hbasedir
* is created for you as part of mini cluster startup. You'd only use this
* method if you were doing manual operation.
* @param create This flag decides whether to get a new
* root or data directory path or not, if it has been fetched already.
* Note : Directory will be made irrespective of whether path has been fetched or not.
* If directory already exists, it will be overwritten
* @return Fully qualified path to hbase root dir
* @throws IOException
*/
public Path createRootDir(boolean create) throws IOException {
FileSystem fs = FileSystem.get(this.conf);
Path hbaseRootdir = getDefaultRootDirPath(create);
FSUtils.setRootDir(this.conf, hbaseRootdir);
fs.mkdirs(hbaseRootdir);
FSUtils.setVersion(fs, hbaseRootdir);
return hbaseRootdir;
}