private void shipZKDatabaseSnapshot(long joiningAgreementSite, long txnId) throws IOException {
m_recoveryLog.info("Shipping ZK snapshot from " + CoreUtils.hsIdToString(m_hsId) +
" to " + CoreUtils.hsIdToString(joiningAgreementSite));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
BinaryOutputArchive boa = new BinaryOutputArchive(dos);
m_server.getZKDatabase().serializeSnapshot(boa);
dos.flush();
byte databaseBytes[] = org.xerial.snappy.Snappy.compress(baos.toByteArray());
ByteBuffer metadata = ByteBuffer.allocate(9);
metadata.put(BINARY_PAYLOAD_SNAPSHOT);