code: public synchronized void set(long maxTxId) throws IOException {
      maxTxIdWritable.set(maxTxId);
      try {
        byte[] data = WritableUtil.writableToByteArray(maxTxIdWritable);
        if (lastZNodeStat != null) {
          try {
            zooKeeper.setData(
                fullyQualifiedZNode, data, lastZNodeStat.getVersion());
          } catch (KeeperException.BadVersionException e) {
            LOG.error(fullyQualifiedZNode + " was updated by another process",
                e);
            throw new StaleVersionException(
                fullyQualifiedZNode + " has been updated by another process");
          }
        } else {
          zooKeeper.create(fullyQualifiedZNode,
              data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          lastZNodeStat = zooKeeper.exists(fullyQualifiedZNode, false);
        }
      } catch (KeeperException e) {
        LOG.error("Unrecoverable ZooKeeper writing to " +
            fullyQualifiedZNode, e);
        throw new IOException("Unrecoverable writing to " +
            fullyQualifiedZNode, e);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        LOG.error("Interrupted reading from " + fullyQualifiedZNode, e);
        throw new IOException("Interrupted reading from " + fullyQualifiedZNode,
            e);
      }
    }
docs: Store the specified transaction in ZooKeeper irrespective of what the
  current max transaction id is (can be used to reset the max transaction
  to an older one).
  @param maxTxId The max transaction id to set
  @throws StaleVersionException If last max transaction id read by this
  is out of date compared to the version in
  ZooKeeper
  @throws IOException If there an unrecoverable error communicating with
  ZooKeeper