Fix for ACE-4089 SOLR 4 - sharded - Remove the requirement for shard configuration on the Alfresco One Platform

- added basic index state, refined property bags, slaves register, fix config read from wrong property bag

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@111421 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2015-09-03 13:48:24 +00:00
parent a57feb95b4
commit 6efcc5f134

View File

@@ -69,12 +69,21 @@ public class TransactionsGet extends DeclarativeWebScript
String hasContent = req.getParameter("hasContent");
String shardMethod = req.getParameter("shardMethod");
String lastUpdated = req.getParameter("lastUpdated");
String lastIndexedChangeSetCommitTime = req.getParameter("lastIndexedChangeSetCommitTime");
String lastIndexedChangeSetId = req.getParameter("lastIndexedChangeSetId");
String lastIndexedTxCommitTime = req.getParameter("lastIndexedTxCommitTime");
String lastIndexedTxId = req.getParameter("lastIndexedTxId");
if(baseUrl != null)
{
ShardState shardState = ShardStateBuilder.shardState()
.withMaster(Boolean.valueOf(isMaster))
.withLastUpdated(Long.valueOf(lastUpdated))
.withLastIndexedChangeSetCommitTime(Long.valueOf(lastIndexedChangeSetCommitTime))
.withLastIndexedChangeSetId(Long.valueOf(lastIndexedChangeSetId))
.withLastIndexedTxCommitTime(Long.valueOf(lastIndexedTxCommitTime))
.withLastIndexedTxId(Long.valueOf(lastIndexedTxId))
.withShardInstance()
.withBaseUrl(baseUrl)
.withPort(Integer.valueOf(port))
@@ -96,6 +105,22 @@ public class TransactionsGet extends DeclarativeWebScript
shardState.getShardInstance().getShard().getFloc().getStoreRefs().add(new StoreRef(store));
}
for(String pName : req.getParameterNames())
{
if(pName.startsWith("floc.property."))
{
String key = pName.substring("floc.property.".length());
String value = req.getParameter(pName);
shardState.getShardInstance().getShard().getFloc().getPropertyBag().put(key, value);
}
else if(pName.startsWith("state.property."))
{
String key = pName.substring("state.property.".length());
String value = req.getParameter(pName);
shardState.getPropertyBag().put(key, value);
}
}
solrTrackingComponent.registerShardState(shardState);
}