public static long getLastReplicationId(HCatTable tbl) {
    Map<String, String> tblProps = tbl.getTblProps();
    if (tblProps != null){
      if (tblProps.containsKey(REPL_STATE_ID)){
        return Long.parseLong(tblProps.get(REPL_STATE_ID));
      }
    }
    return 0l; // default is to return earliest possible state.
  }
Gets the last known replication state of the provided table. This
is applicable only if it is the destination of a replication
and has had data replicated into it via imports previously.
Defaults to 0.
hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java