Author: rwesten
Date: Thu Jan 29 10:46:15 2015
New Revision: 1655582

URL: http://svn.apache.org/r1655582
Log:
minor: added debug & trace level loggings; added a parsed argument check for 
the fieldmapper processor; the EntityFieldScore provider now correctly sets the 
field when initialized with the constructor (instead of setConfig(..) as used 
by the indexing tool.

Modified:
    
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/impl/EntityProcessorRunnable.java
    
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FiledMapperProcessor.java
    
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/source/EntityFieldScoreProvider.java

Modified: 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/impl/EntityProcessorRunnable.java
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/impl/EntityProcessorRunnable.java?rev=1655582&r1=1655581&r2=1655582&view=diff
==============================================================================
--- 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/impl/EntityProcessorRunnable.java
 (original)
+++ 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/impl/EntityProcessorRunnable.java
 Thu Jan 29 10:46:15 2015
@@ -47,6 +47,12 @@ public class EntityProcessorRunnable ext
         super(name,IndexerConstants.SEQUENCE_NUMBER_PROCESSOR_DAEMON,
             consume,produce,error);
         this.processors = processors;
+        if(log.isDebugEnabled()){
+            log.debug("Entity Processors:");
+            for(EntityProcessor ep : processors){
+                log.debug("  - {} (type: {})",ep, 
ep.getClass().getSimpleName());
+            }
+        }
         if(keys == null){
             this.keys = Collections.emptySet();
         } else {
@@ -62,14 +68,17 @@ public class EntityProcessorRunnable ext
                 item.setProperty(PROCESS_STARTED, start);
                 Iterator<EntityProcessor> it = processors.iterator();
                 Representation processed = item.getItem();
+                log.trace("> process {}", processed);
                 EntityProcessor processor = null;
                 while(processed != null && it.hasNext()){
                     processor = it.next();
+                    log.trace("   - with {}", processor);
                     processed = processor.process(processed);
                 }
                 if(processed == null){
                     log.debug("Item {} filtered by processor 
{}",item.getItem().getId(),processor);
                 } else {
+                    log.trace("   - done");
                     for(String key : keys){
                         //consume the property and add it to the
                         //transformed representation

Modified: 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FiledMapperProcessor.java
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FiledMapperProcessor.java?rev=1655582&r1=1655581&r2=1655582&view=diff
==============================================================================
--- 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FiledMapperProcessor.java
 (original)
+++ 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FiledMapperProcessor.java
 Thu Jan 29 10:46:15 2015
@@ -60,7 +60,10 @@ public class FiledMapperProcessor implem
         this(nps,vf);
         if(mapper == null){
             throw new IllegalArgumentException("The parsed FieldMapper MUST 
NOT be NULL!");
+        } else if(mapper.getMappings().isEmpty()){
+            throw new IllegalStateException("The parsed field mappings MUST 
contain at least a single valid mapping!");
         }
+        this.mapper = mapper;
     }
     public FiledMapperProcessor(Iterator<String> mappings, 
NamespacePrefixService nps, ValueFactory vf){
         this(nps, vf);

Modified: 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/source/EntityFieldScoreProvider.java
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/source/EntityFieldScoreProvider.java?rev=1655582&r1=1655581&r2=1655582&view=diff
==============================================================================
--- 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/source/EntityFieldScoreProvider.java
 (original)
+++ 
stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/source/EntityFieldScoreProvider.java
 Thu Jan 29 10:46:15 2015
@@ -48,6 +48,8 @@ public class EntityFieldScoreProvider im
     public EntityFieldScoreProvider(String fieldName){
         if(fieldName == null){
             this.fieldName = DEFAULT_FIELD_NAME;
+        } else {
+            this.fieldName = fieldName;
         }
     }
     


Reply via email to