<commit_before>import org.cloudifysource.dsl.context.ServiceContextFactory
config = new ConfigSlurper().parse(new File("mongod-service.properties").toURL())

def serviceContext = ServiceContextFactory.getServiceContext()



instanceID = serviceContext.getInstanceId()
println "mongod_start.groovy: mongod instanceID is ${instanceID}"

def home= serviceContext.attributes.thisInstance["home"]
println "mongod_start.groovy: mongod(${instanceID}) home ${home}"

def script= serviceContext.attributes.thisInstance["script"]
println "mongod_start.groovy: mongod(${instanceID}) script ${script}"

def port = serviceContext.attributes.thisInstance["port"] 

println "mongod_start.groovy: mongod(${instanceID}) port ${port}"

def dataDir = "${home}/data"
println "mongod_start.groovy: mongod(${instanceID}) dataDir ${dataDir}"

println "mongod_start.groovy: Running mongod(${instanceID}) script ${script} ..."

new AntBuilder().sequential {
	//creating the data directory 	
	mkdir(dir:"${dataDir}")
}

if (config.sharded) {
	new AntBuilder().sequential {
		exec(executable:"${script}") {
			arg line:"--journal"
			arg line:"--shardsvr"
			arg line:"--dbpath \"${dataDir}\""
			arg line:"--port ${port}"
		}
	}
} else {
	new AntBuilder().sequential {
		exec(executable:"${script}") {
			arg line:"--journal"
			arg line:"--dbpath \"${dataDir}\""
			arg line:"--port ${port}"
		}
	}
}



<commit_msg>Enable rest interface when installing Mongod<commit_after>import org.cloudifysource.dsl.context.ServiceContextFactory
config = new ConfigSlurper().parse(new File("mongod-service.properties").toURL())

def serviceContext = ServiceContextFactory.getServiceContext()



instanceID = serviceContext.getInstanceId()
println "mongod_start.groovy: mongod instanceID is ${instanceID}"

def home= serviceContext.attributes.thisInstance["home"]
println "mongod_start.groovy: mongod(${instanceID}) home ${home}"

def script= serviceContext.attributes.thisInstance["script"]
println "mongod_start.groovy: mongod(${instanceID}) script ${script}"

def port = serviceContext.attributes.thisInstance["port"] 

println "mongod_start.groovy: mongod(${instanceID}) port ${port}"

def dataDir = "${home}/data"
println "mongod_start.groovy: mongod(${instanceID}) dataDir ${dataDir}"

println "mongod_start.groovy: Running mongod(${instanceID}) script ${script} ..."

new AntBuilder().sequential {
	//creating the data directory 	
	mkdir(dir:"${dataDir}")
}

if (config.sharded) {
	new AntBuilder().sequential {
		exec(executable:"${script}") {
			arg line:"--rest"
			arg line:"--journal"
			arg line:"--shardsvr"
			arg line:"--dbpath \"${dataDir}\""
			arg line:"--port ${port}"
		}
	}
} else {
	new AntBuilder().sequential {
		exec(executable:"${script}") {
			arg line:"--rest"
			arg line:"--journal"
			arg line:"--dbpath \"${dataDir}\""
			arg line:"--port ${port}"
		}
	}
}




{'fraction_non_alphanumeric': 0.1681260945709282, 'fraction_numerical': 0.0, 'mean_word_length': 5.4324324324324325, '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': '6191513', 'n_tokens_mistral': 970, 'n_tokens_neox': 905, 'n_words': 187}