Merged master to 7.N

aa41767 SEARCH-2028: New SOLR database query to provide the next transaction commit time from a given time commit.
This commit is contained in:
Angel Borroy
2020-01-20 14:02:10 +01:00
parent ac68ff3e79
commit 291a5ea1e0
4 changed files with 42 additions and 0 deletions

View File

@@ -4972,6 +4972,12 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
return selectMaxTxInNodeIdRange(fromNodeId, toNodeId);
}
@Override
public Long getNextTxCommitTime(Long fromCommitTime)
{
return selectNextTxCommitTime(fromCommitTime);
}
/*
* Abstract methods for underlying CRUD
*/
@@ -5142,4 +5148,5 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
protected abstract Long selectMinUnusedTxnCommitTime();
protected abstract Long selectMinTxInNodeIdRange(Long fromNodeId, Long toNodeId);
protected abstract Long selectMaxTxInNodeIdRange(Long fromNodeId, Long toNodeId);
protected abstract Long selectNextTxCommitTime(Long fromCommitTime);
}

View File

@@ -956,4 +956,12 @@ public interface NodeDAO extends NodeBulkLoader
*/
public Long getMaxTxInNodeIdRange(Long fromNodeId, Long toNodeId);
/**
* Gets the next commit time from [fromCommitTime]
*
* @param fromCommitTime Initial commit time
* @return next commit time
*/
public Long getNextTxCommitTime(Long fromCommitTime);
}

View File

@@ -168,6 +168,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
private static final String SELECT_ONE_TXNS_BY_COMMIT_TIME_DESC = "alfresco.node.select_OneTxnsByCommitTimeDescending";
private static final String SELECT_TXN_MIN_TX_ID_IN_NODE_IDRANGE = "alfresco.node.select_TxnMinTxIdInNodeIdRange";
private static final String SELECT_TXN_MAX_TX_ID_IN_NODE_IDRANGE = "alfresco.node.select_TxnMaxTxIdInNodeIdRange";
private static final String SELECT_TXN_NEXT_TXN_COMMIT_TIME = "select_TxnNextTxnCommitTime";
protected QNameDAO qnameDAO;
protected DictionaryService dictionaryService;
@@ -1790,6 +1791,23 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
return template.selectOne(SELECT_TXN_MAX_TX_ID_IN_NODE_IDRANGE, nodeRangeEntity);
}
/**
* Gets the next commit time from [fromCommitTime]
*
* @param fromCommitTime Initial commit time
* @return next commit time
*/
@Override
public Long selectNextTxCommitTime(Long fromCommitTime)
{
TransactionQueryEntity fromCommitTimeEntity = new TransactionQueryEntity();
fromCommitTimeEntity.setMinCommitTime(fromCommitTime);
return template.selectOne(SELECT_TXN_NEXT_TXN_COMMIT_TIME, fromCommitTimeEntity);
}
/*
* DAO OVERRIDES
*/

View File

@@ -1523,4 +1523,13 @@
)
</select>
<select id="select_TxnNextTxnCommitTime" resultType="java.lang.Long">
select
min(commit_time_ms)
from
alf_transaction
where
commit_time_ms > #{minCommitTime}
</select>
</mapper>