Class LddEsJsonWriter

java.lang.Object
gov.nasa.pds.registry.common.dd.LddEsJsonWriter

public class LddEsJsonWriter extends Object
Writes Elasticsearch JSON data file to be loaded into data dictionary index.
Author:
karpenko
  • Constructor Details

    • LddEsJsonWriter

      public LddEsJsonWriter(File outFile, Pds2EsDataTypeMap dtMap, Map<String,DDAttribute> ddAttrCache, boolean overwrite) throws Exception
      Constructor
      Parameters:
      outFile - Elasticsearch JSON data file
      dtMap - PDS to Elasticsearch data type map
      ddAttrCache - LDD attribute cache
      Throws:
      Exception - an exception
  • Method Details

    • setNamespaceFilter

      public void setNamespaceFilter(String filter)
      Set namespace filter. Only process classes having this namespace.
      Parameters:
      filter - namespace, such as 'pds'
    • close

      public void close() throws Exception
      Close output file
      Throws:
      Exception - an exception
    • writeFieldDefinition

      public void writeFieldDefinition(String classNs, String className, String attrId) throws Exception
      Write field definition (Elasticsearch field name, data type and other information)
      Parameters:
      classNs - LDD class namespace
      className - LDD class name
      attrId - LDD attribute ID
      Throws:
      Exception - an exception
    • writeLddInfo

      public void writeLddInfo(String namespace, String schemaFileName, String imVersion, String lddVersion, String date) throws Exception
      Write PDS LDD version and date
      Parameters:
      namespace - namespace
      schemaFileName - schema file name
      imVersion - IM version
      lddVersion - LDD version
      date - date
      Throws:
      Exception - an exception