/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
zk.getZKDatabase().clear(); zk.getZKDatabase().deserializeSnapshot(leaderIs); String signature = leaderIs.readString("signature");
/** * 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; }
/** * 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; }
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(); }
zk.getZKDatabase().clear(); zk.getZKDatabase().deserializeSnapshot(leaderIs); String signature = leaderIs.readString("signature");