当前位置: 首页>>代码示例>>Java>>正文


Java RecoverableZooKeeper.exists方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists方法的典型用法代码示例。如果您正苦于以下问题:Java RecoverableZooKeeper.exists方法的具体用法?Java RecoverableZooKeeper.exists怎么用?Java RecoverableZooKeeper.exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper的用法示例。


在下文中一共展示了RecoverableZooKeeper.exists方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanZookeeper

import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; //导入方法依赖的package包/类
/**
 * Deletes just the splice-specific paths in zookeeper.  Does not delete hbase paths.
 */
public static void cleanZookeeper() throws InterruptedException, KeeperException{
    RecoverableZooKeeper rzk=getRecoverableZooKeeper();
    String rootPath=HConfiguration.getConfiguration().getSpliceRootPath();
    for(String path : HConfiguration.zookeeperPaths){
        path=rootPath+path;
        if(rzk.exists(path,false)!=null){
            for(String child : rzk.getChildren(path,false)){
                for(String grandChild : rzk.getChildren(path+"/"+child,false)){
                    rzk.delete(path+"/"+child+"/"+grandChild,-1);
                }
                rzk.delete(path+"/"+child,-1);
            }
            rzk.delete(path,-1);
        }
    }
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:20,代码来源:ZkUtils.java

示例2: captureIncrementalChanges

import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; //导入方法依赖的package包/类
/**
 * An HFile is eligible for incremental backup if
 * 1) There is an ongoing full backup, flush is not triggered by preparing and backup for this region is done.
 * 2) There is no ongoing backup, AND there is a previous full/incremental backup
 * 3) There is an ongoing incremental backup
 * @param fileName
 * @throws StandardException
 */
public static void captureIncrementalChanges( Configuration conf,
                                              HRegion region,
                                              String path,
                                              FileSystem fs,
                                              Path rootDir,
                                              Path backupDir,
                                              String tableName,
                                              String fileName,
                                              boolean preparing) throws StandardException {
    boolean shouldRegister = false;
    try {
        RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper();
        String spliceBackupPath = HConfiguration.getConfiguration().getBackupPath();
        if (BackupUtils.existsDatabaseBackup(fs, rootDir)) {
            if (LOG.isDebugEnabled()) {
                SpliceLogUtils.debug(LOG, "There exists a successful full or incremental backup in the system");
            }
            shouldRegister = true;
        }
        else if (zooKeeper.exists(spliceBackupPath, false) != null) {

            if (LOG.isDebugEnabled()) {
                SpliceLogUtils.debug(LOG, "A backup is running");
            }
            shouldRegister = true;
        }

        if (shouldRegister) {
            registerHFile(conf, fs, backupDir, region, fileName);
        }
    }
    catch (Exception e) {
        e.printStackTrace();
        throw Exceptions.parseException(e);
    }
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:45,代码来源:BackupUtils.java

示例3: validZookeeper

import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; //导入方法依赖的package包/类
public static boolean validZookeeper() throws InterruptedException, KeeperException{
    RecoverableZooKeeper rzk=getRecoverableZooKeeper();

    String rootPath=HConfiguration.getConfiguration().getSpliceRootPath();
    for(String path : HConfiguration.zookeeperPaths){
        if(rzk.exists(rootPath+path,false)==null)
            return false;
    }
    return true;
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:11,代码来源:ZkUtils.java

示例4: isSpliceLoaded

import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; //导入方法依赖的package包/类
public static boolean isSpliceLoaded() throws InterruptedException, KeeperException{
    RecoverableZooKeeper rzk=getRecoverableZooKeeper();
    String path=HConfiguration.getConfiguration().getSpliceRootPath()+HConfiguration.STARTUP_PATH;
    return rzk.exists(path,false)!=null;
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:6,代码来源:ZkUtils.java

示例5: backupInProgress

import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; //导入方法依赖的package包/类
public static boolean backupInProgress() throws Exception {
    String path = HConfiguration.getConfiguration().getBackupPath();
    RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper();
    Stat stat = zooKeeper.exists(path, false);
    return (stat != null);
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:7,代码来源:BackupUtils.java

示例6: backupCanceled

import org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper; //导入方法依赖的package包/类
public static boolean backupCanceled() throws KeeperException, InterruptedException {
    RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper();
    String path = HConfiguration.getConfiguration().getBackupPath();
    return zooKeeper.exists(path, false) == null;
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:6,代码来源:BackupUtils.java


注:本文中的org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。