<commit_before>package com.ligadata.installer

import scala.collection.immutable.{Set, HashMap}
import scala.io.Source
import java.io._
import com.ligadata.MetadataAPI.{ MetadataAPIImpl }
import com.ligadata.fatafat.metadata._

class NodeInfoExtract(val metadataAPIConfig : String, val nodeConfigPath : String, val clusterId : String, val installDir : String) {

	//MetadataAPIImpl.InitMdMgrFromBootStrap(metadataAPIConfig)
	MetadataAPIImpl.InitMdMgr(metadataAPIConfig)
	
	/** FIXME: At some point, the engine and MetadataAPI prop name will converge and these keys will likely be wrong!!!!!!!!!!!!!!!!!!! */
	var metadataStoreType : String = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("DATABASE")
	var metadataSchemaName : String = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("DATABASE_SCHEMA")
	var metadataLocation : String = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("DATABASE_LOCATION")
	
	
	//println(result)
	
	def MetadataStoreType : String = metadataStoreType
	def MetadataSchemaName : String = metadataSchemaName
	def MetadataLocation : String = metadataLocation
	
	/** 
	 *  Optionally called when an EngineConfig file with cluster decl in it is supplied as an argument, this
	 *  command updates the metadata referred to by the metadataapiconfig properties file. 
	 */
	def initializeEngineConfig : Unit = {
		if (nodeConfigPath != null) {
			val result : String = MetadataAPIImpl.UploadConfig(Source.fromFile(nodeConfigPath).mkString)
			//println(result)
		} else {
			throw new RuntimeException("initializeEngineConfig erroneously called... logic error ")
		}<commit_msg>Issue381: fix compile error in the NodeExtractor<commit_after>package com.ligadata.installer

import scala.collection.immutable.{Set, HashMap}
import scala.io.Source
import java.io._
import com.ligadata.MetadataAPI.{ MetadataAPIImpl }
import com.ligadata.fatafat.metadata._

class NodeInfoExtract(val metadataAPIConfig : String, val nodeConfigPath : String, val clusterId : String, val installDir : String) {

	//MetadataAPIImpl.InitMdMgrFromBootStrap(metadataAPIConfig)
	MetadataAPIImpl.InitMdMgr(metadataAPIConfig)
	
	/** FIXME: At some point, the engine and MetadataAPI prop name will converge and these keys will likely be wrong!!!!!!!!!!!!!!!!!!! */
	var metadataStoreType : String = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("DATABASE")
	var metadataSchemaName : String = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("DATABASE_SCHEMA")
	var metadataLocation : String = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("DATABASE_LOCATION")
	
	
	//println(result)
	
	def MetadataStoreType : String = metadataStoreType
	def MetadataSchemaName : String = metadataSchemaName
	def MetadataLocation : String = metadataLocation
	
	/** 
	 *  Optionally called when an EngineConfig file with cluster decl in it is supplied as an argument, this
	 *  command updates the metadata referred to by the metadataapiconfig properties file. 
	 */
	def initializeEngineConfig : Unit = {
		if (nodeConfigPath != null) {
			val result : String = MetadataAPIImpl.UploadConfig(Source.fromFile(nodeConfigPath).mkString, None, "NodeInfoExtract")
			//println(result)
		} else {
			throw new RuntimeException("initializeEngineConfig erroneously called... logic error ")
		}
{'fraction_non_alphanumeric': 0.08848744641763626, 'fraction_numerical': 0.0009185548071034905, 'mean_word_length': 5.547094188376754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6082414', 'n_tokens_mistral': 931, 'n_tokens_neox': 897, 'n_words': 248}