gpt4 book ai didi

org.apache.zookeeper.server.ZKDatabase.clear()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 08:34:40 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.zookeeper.server.ZKDatabase.clear()方法的一些代码示例,展示了ZKDatabase.clear()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKDatabase.clear()方法的具体详情如下:
包路径:org.apache.zookeeper.server.ZKDatabase
类名称:ZKDatabase
方法名:clear

ZKDatabase.clear介绍

[英]clear the zkdatabase. Note to developers - be careful to see that the clear method does clear out all the data structures in zkdatabase.
[中]清除数据库。开发人员注意:请注意,clear方法确实清除了数据库中的所有数据结构。

代码示例

代码示例来源:origin: apache/zookeeper

/**
 * Truncate the ZKDatabase to the specified zxid
 * @param zxid the zxid to truncate zk database to
 * @return true if the truncate is successful and false if not
 * @throws IOException
 */
public boolean truncateLog(long zxid) throws IOException {
  clear();
  // truncate the log
  boolean truncated = snapLog.truncateLog(zxid);
  if (!truncated) {
    return false;
  }
  loadDataBase();
  return true;
}

代码示例来源:origin: apache/zookeeper

/**
 * deserialize a snapshot from an input archive
 * @param ia the input archive you want to deserialize from
 * @throws IOException
 */
public void deserializeSnapshot(InputArchive ia) throws IOException {
  clear();
  SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
  initialized = true;
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
 * Truncate the ZKDatabase to the specified zxid
 * @param zxid the zxid to truncate zk database to
 * @return true if the truncate is successful and false if not
 * @throws IOException
 */
public boolean truncateLog(long zxid) throws IOException {
  clear();
  // truncate the log
  boolean truncated = snapLog.truncateLog(zxid);
  if (!truncated) {
    return false;
  }
  loadDataBase();
  return true;
}

代码示例来源:origin: apache/zookeeper

zkDb.clear();
} else {
  } catch (IOException e) {
    LOG.error("Error updating DB", e);
    zkDb.clear();

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
 * deserialize a snapshot from an input archive 
 * @param ia the input archive you want to deserialize from
 * @throws IOException
 */
public void deserializeSnapshot(InputArchive ia) throws IOException {
  clear();
  SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
  initialized = true;
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

zkDb.clear();
} else {
  } catch (IOException e) {
    LOG.error("Error updating DB", e);
    zkDb.clear();

代码示例来源:origin: org.apache.zookeeper/zookeeper

zk.getZKDatabase().clear();
zk.getZKDatabase().deserializeSnapshot(leaderIs);
String signature = leaderIs.readString("signature");

代码示例来源:origin: org.apache.hadoop/zookeeper

/**
 * truncate the zkdatabase to this zxid
 * @param zxid the zxid to truncate zk database to
 * @return true if the truncate is succesful and false if not
 * @throws IOException
 */
public boolean truncateLog(long zxid) throws IOException {
  clear();
  boolean truncated = this.snapLog.truncateLog(zxid);
  loadDataBase();
  return truncated;
}

代码示例来源:origin: org.apache.hadoop/zookeeper

/**
 * deserialize a snapshot from an input archive 
 * @param ia the input archive you want to deserialize from
 * @throws IOException
 */
public void deserializeSnapshot(InputArchive ia) throws IOException {
  clear();
  SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
  initialized = true;
}

代码示例来源:origin: org.apache.hadoop/zookeeper

public void shutdown() {
  // new RuntimeException("Calling shutdown").printStackTrace();
  this.running = false;
  // Since sessionTracker and syncThreads poll we just have to
  // set running to false and they will detect it during the poll
  // interval.
  if (sessionTracker != null) {
    sessionTracker.shutdown();
  }
  if (firstProcessor != null) {
    firstProcessor.shutdown();
  }
  if (zkDb != null) {
    zkDb.clear();
  }
  unregisterJMX();
}

代码示例来源:origin: org.apache.hadoop/zookeeper

zk.getZKDatabase().clear();
zk.getZKDatabase().deserializeSnapshot(leaderIs);
String signature = leaderIs.readString("signature");

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com