private ValidWriteIdList getValidWriteIdList(String dbName, String tableName) throws LockException {
    long txnId = Optional.ofNullable(SessionState.get())
      .map(ss -> ss.getTxnMgr().getCurrentTxnId()).orElse(0L);
    
    return (txnId > 0) ? AcidUtils.getTableValidWriteIdListWithTxnList(conf, dbName, tableName) : 
        new ValidReaderWriteIdList();
  }
Get ValidWriteIdList for the current transaction.
This fetches the ValidWriteIdList from the metastore for a given table if txnManager has an open transaction.

@param dbName
@param tableName
@return
@throws LockException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java