Class MetaTableManager


  • public class MetaTableManager
    extends Object
    • Constructor Detail

      • MetaTableManager

        public MetaTableManager​(de.julielab.costosys.dbconnection.DataBaseConnector dbc,
                                String xmiMetaSchema)
    • Method Detail

      • updateBinaryStringMappingTable

        public org.apache.commons.lang3.tuple.Pair<Map<String,​Integer>,​Map<String,​Boolean>> updateBinaryStringMappingTable​(de.julielab.xml.binary.BinaryStorageAnalysisResult analysisResult,
                                                                                                                                             Map<String,​Integer> currentMappingState,
                                                                                                                                             Map<String,​Boolean> currentMappedAttributes,
                                                                                                                                             boolean writeToDatabase)
                                                                                                                                      throws org.apache.uima.analysis_engine.AnalysisEngineProcessException

        Synchronized updates to the map XMI string -> ID. The 'XMI strings' are XML element names, attribute names and also attribute values which don't seem to have a lot of values as determined by the BinaryJeDISNodeEncoder.findMissingItemsForMapping(Collection, TypeSystem, Map, Map) method. An attribute is assumed to not have a lot of different values if it has at most half as many different values as there are occurrences of the attribute, and, thus, the respective UIMA type feature. This strategy is currently only applied to string values.

        This method checks if there are items to be mapped which are not yet present in the current mapping which is passed from the XMIDBWriter. If there are new items, the mapping table is locked from concurrent access and updated with the new values. The updated mapping is returned to be kept for future applications.

        Parameters:
        analysisResult - The analysis result of the documents to be encoded next.
        currentMappingState - The mapping as it is currently known to the XMIDBWriter instance.
        Returns:
        The mapping with all known mappings from the database, potentially with updated elements from the current document.
        Throws:
        org.apache.uima.analysis_engine.AnalysisEngineProcessException - If the database communication fails.