mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +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.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
|
||||||
@@ -198,6 +200,9 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
|||||||
{
|
{
|
||||||
TrackerState state = super.getTrackerState();
|
TrackerState state = super.getTrackerState();
|
||||||
|
|
||||||
|
HashMap<String, String> propertyBag = new HashMap<>();
|
||||||
|
propertyBag.put("coreName", coreName);
|
||||||
|
|
||||||
ShardState shardstate = ShardStateBuilder.shardState()
|
ShardState shardstate = ShardStateBuilder.shardState()
|
||||||
.withMaster(isMaster)
|
.withMaster(isMaster)
|
||||||
.withLastUpdated(System.currentTimeMillis())
|
.withLastUpdated(System.currentTimeMillis())
|
||||||
@@ -217,6 +222,7 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
|||||||
.withTemplate(shardTemplate)
|
.withTemplate(shardTemplate)
|
||||||
.withHasContent(transformContent)
|
.withHasContent(transformContent)
|
||||||
.withShardMethod(ShardMethodEnum.getShardMethod(shardMethod))
|
.withShardMethod(ShardMethodEnum.getShardMethod(shardMethod))
|
||||||
|
.withPropertyBag(propertyBag)
|
||||||
.endFloc()
|
.endFloc()
|
||||||
.endShard()
|
.endShard()
|
||||||
.endShardInstance()
|
.endShardInstance()
|
||||||
@@ -337,6 +343,7 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
|||||||
gnp.setStoreProtocol(storeRef.getProtocol());
|
gnp.setStoreProtocol(storeRef.getProtocol());
|
||||||
gnp.setStoreIdentifier(storeRef.getIdentifier());
|
gnp.setStoreIdentifier(storeRef.getIdentifier());
|
||||||
gnp.setShardProperty(shardProperty);
|
gnp.setShardProperty(shardProperty);
|
||||||
|
gnp.setCoreName(coreName);
|
||||||
|
|
||||||
List<Node> nodes = client.getNodes(gnp, (int) info.getUpdates());
|
List<Node> nodes = client.getNodes(gnp, (int) info.getUpdates());
|
||||||
for (Node node : nodes)
|
for (Node node : nodes)
|
||||||
@@ -855,6 +862,7 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
|||||||
gnp.setStoreProtocol(storeRef.getProtocol());
|
gnp.setStoreProtocol(storeRef.getProtocol());
|
||||||
gnp.setStoreIdentifier(storeRef.getIdentifier());
|
gnp.setStoreIdentifier(storeRef.getIdentifier());
|
||||||
gnp.setShardProperty(shardProperty);
|
gnp.setShardProperty(shardProperty);
|
||||||
|
gnp.setCoreName(coreName);
|
||||||
List<Node> nodes = client.getNodes(gnp, Integer.MAX_VALUE);
|
List<Node> nodes = client.getNodes(gnp, Integer.MAX_VALUE);
|
||||||
|
|
||||||
ArrayList<Node> nodeBatch = new ArrayList<>();
|
ArrayList<Node> nodeBatch = new ArrayList<>();
|
||||||
|
@@ -51,6 +51,7 @@ public class GetNodesParameters
|
|||||||
private Set<QName> excludeAspects;
|
private Set<QName> excludeAspects;
|
||||||
|
|
||||||
private QName shardProperty;
|
private QName shardProperty;
|
||||||
|
private String coreName;
|
||||||
|
|
||||||
public boolean getStoreFilter()
|
public boolean getStoreFilter()
|
||||||
{
|
{
|
||||||
@@ -157,5 +158,13 @@ public class GetNodesParameters
|
|||||||
this.shardProperty = shardProperty;
|
this.shardProperty = shardProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCoreName() {
|
||||||
|
return this.coreName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoreName(String coreName){
|
||||||
|
this.coreName = coreName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -611,6 +611,11 @@ public class SOLRAPIClient
|
|||||||
body.put("shardProperty", parameters.getShardProperty().toString());
|
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");
|
PostRequest req = new PostRequest(url.toString(), body.toString(), "application/json");
|
||||||
|
|
||||||
Response response = null;
|
Response response = null;
|
||||||
|
Reference in New Issue
Block a user