ALF-14306: Merged DEV to HEAD (4.2)

Add priorities to transformers
   - Addition of a separate Transformers subsystem (holds configuration to allow JMX to be used to reset it on the fly)
   - Moved supported, unsupported and explicit transformation configuration from spring into transformers.properties in the subsystem
   - Moved all transformer limits configuration from spring and into transformers.properties with the exception of some added for thumbnails
     and the rendering service - not done as this code is known to be changing.
   - Added priority, errorTimes and thresholdCount to enable selection of transformers by priority.
   - Removed the concept of 'Explicit' transformation and replaced with priority and unsupported.
   - Added logging to aid in the creation of global properties and removal of spring configuration.
   - Implementation of spring pluggable transformation selector that uses priority.
   - Merging current state of code changes to allow other work in this area to take place.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46719 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2013-02-16 07:40:55 +00:00
parent 4c393ef70f
commit f5bd27c36c
62 changed files with 3381 additions and 1234 deletions

View File

@@ -1430,16 +1430,17 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<NodeRef> imp
// We have a reader, so use it
boolean readerReady = true;
// transform if necessary (it is not a UTF-8 text document)
if (!EqualsHelper.nullSafeEquals(reader.getMimetype(), MimetypeMap.MIMETYPE_TEXT_PLAIN) || !EqualsHelper.nullSafeEquals(reader.getEncoding(), "UTF-8"))
String sourceMimetype = reader.getMimetype();
if (!EqualsHelper.nullSafeEquals(sourceMimetype, MimetypeMap.MIMETYPE_TEXT_PLAIN) || !EqualsHelper.nullSafeEquals(reader.getEncoding(), "UTF-8"))
{
try
{
// get the transformer
TransformationOptions options = new TransformationOptions();
options.setSourceNodeRef(nodeRef);
transformerDebug.pushAvailable(reader.getContentUrl(), reader.getMimetype(), MimetypeMap.MIMETYPE_TEXT_PLAIN, options);
transformerDebug.pushAvailable(reader.getContentUrl(), sourceMimetype, MimetypeMap.MIMETYPE_TEXT_PLAIN, options);
long sourceSize = reader.getSize();
List<ContentTransformer> transformers = contentService.getActiveTransformers(reader.getMimetype(), sourceSize, MimetypeMap.MIMETYPE_TEXT_PLAIN, options);
List<ContentTransformer> transformers = contentService.getActiveTransformers(sourceMimetype, sourceSize, MimetypeMap.MIMETYPE_TEXT_PLAIN, options);
transformerDebug.availableTransformers(transformers, sourceSize, "ADMLuceneIndexer");
if (transformers.isEmpty())
@@ -1458,7 +1459,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<NodeRef> imp
doc.add(new Field(attributeName, NOT_INDEXED_NO_TRANSFORMATION, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.NO));
}
// is this transformer good enough?
else if (indexAtomicPropertiesOnly && transformers.get(0).getTransformationTime() > maxAtomicTransformationTime)
else if (indexAtomicPropertiesOnly && transformers.get(0).getTransformationTime(sourceMimetype, MimetypeMap.MIMETYPE_TEXT_PLAIN) > maxAtomicTransformationTime)
{
// only indexing atomic properties
// indexing will take too long, so push it to the background