private int getSequenceNumber(String resPath, String path) {
    String tst = resPath.substring(path.length());
    try {
      return Integer.parseInt(tst);
    } catch (Exception e) {
      return -1; // invalid number
    }
  }
Get the sequence number from the path. The sequence number is always at the end of the path.
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/zookeeper/ZooKeeperHiveLockManager.java