mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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>
|
Reference in New Issue
Block a user