use of org.apache.zookeeper_voltpatches.server.persistence.FileHeader in project voltdb by VoltDB.
the class FileTxnLog method getDbId.
/**
* the dbid of this transaction database
* @return the dbid of this database
*/
public long getDbId() throws IOException {
FileTxnIterator itr = new FileTxnIterator(logDir, 0);
FileHeader fh = readHeader(itr.logFile);
itr.close();
if (fh == null)
throw new IOException("Unsupported Format.");
return fh.getDbid();
}
use of org.apache.zookeeper_voltpatches.server.persistence.FileHeader in project voltdb by VoltDB.
the class FileHeader method equals.
@Override
public boolean equals(Object peer_) {
if (!(peer_ instanceof FileHeader)) {
return false;
}
if (peer_ == this) {
return true;
}
FileHeader peer = (FileHeader) peer_;
boolean ret = false;
ret = (magic == peer.magic);
if (!ret)
return ret;
ret = (version == peer.version);
if (!ret)
return ret;
ret = (dbid == peer.dbid);
if (!ret)
return ret;
return ret;
}
use of org.apache.zookeeper_voltpatches.server.persistence.FileHeader in project voltdb by VoltDB.
the class FileSnap method deserialize.
/**
* deserialize the datatree from an inputarchive
* @param dt the datatree to be serialized into
* @param sessions the sessions to be filled up
* @param ia the input archive to restore from
* @throws IOException
*/
public void deserialize(DataTree dt, Map<Long, Long> sessions, InputArchive ia) throws IOException {
FileHeader header = new FileHeader();
header.deserialize(ia, "fileheader");
if (header.getMagic() != SNAP_MAGIC) {
throw new IOException("mismatching magic headers " + header.getMagic() + " != " + FileSnap.SNAP_MAGIC);
}
SerializeUtils.deserializeSnapshot(dt, ia, sessions);
}
Aggregations