Class MetaTableManager
- java.lang.Object
-
- de.julielab.jcore.consumer.xmi.MetaTableManager
-
public class MetaTableManager extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringBINARY_FEATURES_TO_MAP_COL_FEATUREstatic StringBINARY_FEATURES_TO_MAP_COL_MAPstatic StringBINARY_FEATURES_TO_MAP_TABLEstatic StringBINARY_MAPPING_COL_IDstatic StringBINARY_MAPPING_COL_STRINGstatic StringBINARY_MAPPING_TABLEstatic StringNS_URIstatic StringPREFIXstatic StringXMI_NS_TABLE
-
Constructor Summary
Constructors Constructor Description MetaTableManager(de.julielab.costosys.dbconnection.DataBaseConnector dbc, String xmiMetaSchema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)Synchronized updates to the map XMI string -> ID.
-
-
-
Field Detail
-
BINARY_MAPPING_TABLE
public static final String BINARY_MAPPING_TABLE
- See Also:
- Constant Field Values
-
BINARY_FEATURES_TO_MAP_TABLE
public static final String BINARY_FEATURES_TO_MAP_TABLE
- See Also:
- Constant Field Values
-
BINARY_MAPPING_COL_STRING
public static final String BINARY_MAPPING_COL_STRING
- See Also:
- Constant Field Values
-
BINARY_MAPPING_COL_ID
public static final String BINARY_MAPPING_COL_ID
- See Also:
- Constant Field Values
-
BINARY_FEATURES_TO_MAP_COL_FEATURE
public static final String BINARY_FEATURES_TO_MAP_COL_FEATURE
- See Also:
- Constant Field Values
-
BINARY_FEATURES_TO_MAP_COL_MAP
public static final String BINARY_FEATURES_TO_MAP_COL_MAP
- See Also:
- Constant Field Values
-
XMI_NS_TABLE
public static final String XMI_NS_TABLE
- See Also:
- Constant Field Values
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
NS_URI
public static final String NS_URI
- See Also:
- Constant Field Values
-
-
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.
-
-