Package org.apache.stanbol.entityhub.servicesapi.mapping

Examples of org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper


        if(yard == null){
            throw new IllegalArgumentException("The parsed Yard MUST NOT be NULL!");
        }
        Representation addConfig = yard.getRepresentation(Cache.ADDITIONAL_CONFIGURATION_URI);
        if(addConfig != null){
            FieldMapper mapper = readFieldConfig(yard,addConfig);
            if(mapper == null){
                log.warn("Invalid Additinal Configuration: Unable to parse FieldMappings from Field "+Cache.FIELD_MAPPING_CONFIG_FIELD+"-> return NULL (no additional Configuration)");
                if(log.isWarnEnabled()){
                    log.warn(ModelUtils.getRepresentationInfo(addConfig));
                }
View Full Code Here


     * argument to this method.
     * @param mappings The mappings or <code>null</code> if none
     * @return A new and configured FieldMapper instance.
     */
    public static FieldMapper createDefaultFieldMapper(Iterator<String> mappings){
        FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if(mappings != null){
            for(FieldMapping mapping : parseFieldMappings(mappings)){
                mapper.addMapping(mapping);
            }
        }
        return mapper;
    }
View Full Code Here

     * it with {@link FieldMapping}s
     * @param mappings The mappings or <code>null</code> if none
     * @return A new and configured FieldMapper instance.
     */
    public static FieldMapper createDefaultFieldMapper(Iterable<FieldMapping> mappings){
        FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if(mappings != null){
            for(FieldMapping mapping : mappings){
                mapper.addMapping(mapping);
            }
        }
        return mapper;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public void finalise() {
        //write the indexing configuration
        FieldMapper mapper = FieldMappingUtils.createDefaultFieldMapper(indexFieldConfiguration);
        try {
            CacheUtils.storeBaseMappingsConfiguration(solrYard, mapper);
        } catch (YardException e) {
            log.error("Unable to store FieldMapperConfiguration to the Store!",e);
        }
View Full Code Here

     * @throws YardException would be really bad if after successfully indexing
     * about 8 millions of documents we get an error from the yard at the
     * last possible opportunity :(
     */
    private void writeCacheBaseConfiguration() throws YardException {
        FieldMapper baseMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        log.info("Write BaseMappings for geonames.org Cache");
        log.info(" > Mappings");
        for(String mapping : GeoNamesIndexer.fieldMappings){
            log.info("    - "+mapping);
            baseMapper.addMapping(FieldMappingUtils.parseFieldMapping(mapping));
        }
        CacheUtils.storeBaseMappingsConfiguration(yard, baseMapper);
        log.info(" < completed");
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public void finalise() {
        //write the indexing configuration
        FieldMapper mapper = FieldMappingUtils.createDefaultFieldMapper(indexFieldConfiguration);
        try {
            CacheUtils.storeBaseMappingsConfiguration(solrYard, mapper);
        } catch (YardException e) {
            log.error("Unable to store FieldMapperConfiguration to the Store!",e);
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.