mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-10 14:11:25 +00:00
Added coreName in nodeParameters Added coreName in propertyBag (shardState)
This commit is contained in:
@@ -20,9 +20,11 @@ package org.alfresco.solr.tracker;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
@@ -197,6 +199,9 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
||||
private ShardState getShardState()
|
||||
{
|
||||
TrackerState state = super.getTrackerState();
|
||||
|
||||
HashMap<String, String> propertyBag = new HashMap<>();
|
||||
propertyBag.put("coreName", coreName);
|
||||
|
||||
ShardState shardstate = ShardStateBuilder.shardState()
|
||||
.withMaster(isMaster)
|
||||
@@ -217,6 +222,7 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
||||
.withTemplate(shardTemplate)
|
||||
.withHasContent(transformContent)
|
||||
.withShardMethod(ShardMethodEnum.getShardMethod(shardMethod))
|
||||
.withPropertyBag(propertyBag)
|
||||
.endFloc()
|
||||
.endShard()
|
||||
.endShardInstance()
|
||||
@@ -337,6 +343,7 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
||||
gnp.setStoreProtocol(storeRef.getProtocol());
|
||||
gnp.setStoreIdentifier(storeRef.getIdentifier());
|
||||
gnp.setShardProperty(shardProperty);
|
||||
gnp.setCoreName(coreName);
|
||||
|
||||
List<Node> nodes = client.getNodes(gnp, (int) info.getUpdates());
|
||||
for (Node node : nodes)
|
||||
@@ -855,6 +862,7 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
||||
gnp.setStoreProtocol(storeRef.getProtocol());
|
||||
gnp.setStoreIdentifier(storeRef.getIdentifier());
|
||||
gnp.setShardProperty(shardProperty);
|
||||
gnp.setCoreName(coreName);
|
||||
List<Node> nodes = client.getNodes(gnp, Integer.MAX_VALUE);
|
||||
|
||||
ArrayList<Node> nodeBatch = new ArrayList<>();
|
||||
|
@@ -49,9 +49,10 @@ public class GetNodesParameters
|
||||
|
||||
private Set<QName> includeAspects;
|
||||
private Set<QName> excludeAspects;
|
||||
|
||||
private QName shardProperty;
|
||||
|
||||
private QName shardProperty;
|
||||
private String coreName;
|
||||
|
||||
public boolean getStoreFilter()
|
||||
{
|
||||
return (storeProtocol != null || storeIdentifier != null);
|
||||
@@ -156,6 +157,14 @@ public class GetNodesParameters
|
||||
{
|
||||
this.shardProperty = shardProperty;
|
||||
}
|
||||
|
||||
public String getCoreName() {
|
||||
return this.coreName;
|
||||
}
|
||||
|
||||
public void setCoreName(String coreName){
|
||||
this.coreName = coreName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -610,6 +610,11 @@ public class SOLRAPIClient
|
||||
{
|
||||
body.put("shardProperty", parameters.getShardProperty().toString());
|
||||
}
|
||||
|
||||
if (parameters.getCoreName() != null){
|
||||
body.put("coreName", parameters.getCoreName());
|
||||
}
|
||||
|
||||
|
||||
PostRequest req = new PostRequest(url.toString(), body.toString(), "application/json");
|
||||
|
||||
|
Reference in New Issue
Block a user