Revert "Feature/search 1654 (#463)"

This reverts commit e3a832dfee.

Will be putting this back, but it currently breaks alfresco-enterprise-repository and alfresco-enterprise-remote-api.
This commit is contained in:
Alan Davis
2019-06-01 09:28:55 +01:00
parent 2c741912a0
commit 418db22fb8
7 changed files with 192 additions and 253 deletions

View File

@@ -40,42 +40,40 @@ public interface Node extends NodeIdAndAclId
/**
* Helper method to get a key that includes the node and its current version number
*/
NodeVersionKey getNodeVersionKey();
public NodeVersionKey getNodeVersionKey();
/**
* Helper method to force the instance to be read-only
*/
void lock();
public void lock();
NodeRef getNodeRef();
public abstract NodeRef getNodeRef();
NodeRef.Status getNodeStatus(QNameDAO qnameDAO);
public NodeRef.Status getNodeStatus(QNameDAO qnameDAO);
Pair<Long, NodeRef> getNodePair();
public abstract Pair<Long, NodeRef> getNodePair();
/**
* Checks the {@link #getTypeQNameId() type} of the node to determine if the node is deleted
* @param qnameDAO DAO to work out type IDs
* @return <tt>true</tt> if the node is {@link ContentModel#TYPE_DELETED}
*/
boolean getDeleted(QNameDAO qnameDAO);
public abstract boolean getDeleted(QNameDAO qnameDAO);
Long getVersion();
public abstract Long getVersion();
StoreEntity getStore();
public abstract StoreEntity getStore();
String getUuid();
public abstract String getUuid();
Long getTypeQNameId();
public abstract Long getTypeQNameId();
Long getLocaleId();
public abstract Long getLocaleId();
TransactionEntity getTransaction();
public abstract TransactionEntity getTransaction();
AuditablePropertiesEntity getAuditableProperties();
public abstract AuditablePropertiesEntity getAuditableProperties();
String getShardKey();
Integer getExplicitShardId();
public abstract String getShardKey();
}

View File

@@ -56,7 +56,6 @@ public class NodeEntity implements Node, PermissionCheckValue, Serializable, Clo
private TransactionEntity transaction;
private AuditablePropertiesEntity auditableProperties;
private String shardKey;
private Integer explicitShardId;
/**
* Required default constructor
@@ -343,22 +342,10 @@ public class NodeEntity implements Node, PermissionCheckValue, Serializable, Clo
return this.shardKey;
}
@Override
public Integer getExplicitShardId()
{
return this.explicitShardId;
}
public synchronized void setShardKey(String shardKey)
{
this.shardKey = shardKey;
}
public synchronized void setExplicitShardId(Integer explicitShardId)
{
this.explicitShardId = explicitShardId;
}
}

View File

@@ -25,44 +25,28 @@
*/
package org.alfresco.repo.index.shard;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.Set;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.util.Pair;
/**
* A registry which collects all the active shard subscriptions.
*
* @author Andy
* @author agazzarini
* @author eporciani
*
*/
public interface ShardRegistry
{
/**
* Registers (or updates the existing subscription) of a shard.
*
* @param shardState the shard state, which contains the information about the shard that wants to subscribe/register.
*/
void registerShardState(ShardState shardState);
public void registerShardState(ShardState shardState);
List<ShardInstance> getIndexSlice(SearchParameters searchParameters);
public List<ShardInstance> getIndexSlice(SearchParameters searchParameters);
void purge();
public void purge();
Map<Floc, Map<Shard, Set<ShardState>>> getFlocs();
public HashMap<Floc, HashMap<Shard, HashSet<ShardState>>> getFlocs();
void purgeAgedOutShards();
/**
* Returns the shard instance (i.e. shard number) which owns (or should own) the transaction associated with the given timestamp.
*
* @param coreId an identifier (e.g. core name, base url) of the core / collection whose requested shard belongs to.
* @param txnTimestamp the transaction timestamp used as search criteria.
* @return the shard instance (i.e. shard number) which owns (or should own) the transaction associated with the given timestamp.
*/
OptionalInt getShardInstanceByTransactionTimestamp(String coreId, long txnTimestamp);
public void purgeAgedOutShards();
}

View File

@@ -57,7 +57,6 @@ public class NodeParameters
private Set<QName> excludeAspects;
private String shardProperty;
private String coreName;
public int getMaxResults()
{
@@ -193,14 +192,4 @@ public class NodeParameters
{
this.shardProperty = shardProperty;
}
public String getCoreName() {
return this.coreName;
}
public void setCoreName(String coreName){
this.coreName = coreName;
}
}

View File

@@ -36,7 +36,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.TreeSet;
import java.util.zip.CRC32;
@@ -47,7 +46,6 @@ import org.alfresco.repo.dictionary.DictionaryDAO;
import org.alfresco.repo.domain.node.Node;
import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.domain.node.NodeDAO.ChildAssocRefQueryCallback;
import org.alfresco.repo.domain.node.NodeEntity;
import org.alfresco.repo.domain.permissions.AclDAO;
import org.alfresco.repo.domain.qname.QNameDAO;
import org.alfresco.repo.domain.solr.SOLRDAO;
@@ -377,15 +375,6 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
for (Node node : nodes)
{
if (shardRegistry != null){
shardRegistry.getShardInstanceByTransactionTimestamp(
nodeParameters.getCoreName(),
node.getTransaction().getCommitTimeMs()).ifPresent(
shardId -> ((NodeEntity) node).setExplicitShardId(shardId));
}
callback.handleNode(node);
}
}

View File

@@ -26,7 +26,6 @@
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="typeQNameId" column="type_qname_id" jdbcType="BIGINT" javaType="java.lang.Long" />
<result property="transaction.id" column="txn_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="transaction.commitTimeMs" column="txn_commit_time_ms" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="aclId" column="acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="store.protocol" column="protocol" jdbcType="VARCHAR" javaType="java.lang.String"/>
<result property="store.identifier" column="identifier" jdbcType="VARCHAR" javaType="java.lang.String"/>
@@ -118,7 +117,6 @@
COALESCE(np.long_value, node.id) as id,
node.type_qname_id as type_qname_id,
node.transaction_id as txn_id,
txn.commit_time_ms as txn_commit_time_ms,
node.uuid as uuid,
node.acl_id as acl_id,
store.protocol as protocol,

View File

@@ -139,10 +139,4 @@ class TestNode implements Node
return null;
}
@Override
public Integer getExplicitShardId()
{
return null;
}
}