From 4c9e828cf6f38f88f9e3cff94a5d585b3b9d36d5 Mon Sep 17 00:00:00 2001 From: Bibek Date: Mon, 25 Aug 2014 14:13:03 +0200 Subject: [PATCH] Load BSBM from multiple (splitted) nt files instead of just one. --- .../BerlinSparqlEvaluationParallel.scala | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/signalcollect/triplerush/evaluation/BerlinSparqlEvaluationParallel.scala b/src/main/scala/com/signalcollect/triplerush/evaluation/BerlinSparqlEvaluationParallel.scala index a0ea853..c59cb06 100644 --- a/src/main/scala/com/signalcollect/triplerush/evaluation/BerlinSparqlEvaluationParallel.scala +++ b/src/main/scala/com/signalcollect/triplerush/evaluation/BerlinSparqlEvaluationParallel.scala @@ -49,11 +49,17 @@ class BerlinSparqlEvaluationParallel extends TorqueDeployableAlgorithm { commonResults += "java.runtime.version" -> System.getProperty("java.runtime.version") val queriesObjectName = s"com.signalcollect.triplerush.evaluation.BerlinSparqlParameterized$datasetSize" - val ntriplesFileLocation = s"berlinsparql_$datasetSize-nt/dataset_$datasetSize.nt" + //val ntriplesFileLocation = s"berlinsparql_$datasetSize-nt/dataset_$datasetSize.nt" + val ntriplesFileLocation = s"berlinsparql_$datasetSize-nt" - val loadingTime = measureTime { + /*val loadingTime = measureTime { tr.loadNtriples(ntriplesFileLocation) tr.awaitIdle + }*/ + + val loadingTime = measureTime { + loadBSBMFromNTriples(ntriplesFileLocation, tr) + tr.awaitIdle } println(s"Finished loading") @@ -126,6 +132,22 @@ class BerlinSparqlEvaluationParallel extends TorqueDeployableAlgorithm { tr.shutdown } + def loadBSBMFromNTriples(location: String, triplerush: TripleRush) { + + val sourceFiles = filesIn(location). + filter(_.getName.endsWith(".nt")). + sorted + + for (src <- sourceFiles) { + val ntFile = s"$src" + println(s"Loading file $ntFile") + triplerush.loadNtriples(ntFile) + println(s"Awaiting idle. Continuing graph loading...") + triplerush.awaitIdle + JvmWarmup.sleepUntilGcInactiveForXSeconds(60, 120) + } + } + def executeEvaluationRun(queryString: String, queryRun: Int, queryDescription: String, tr: TripleRush, commonResults: Map[String, String]): Map[String, String] = { val gcs = ManagementFactory.getGarbageCollectorMXBeans.toList val compilations = ManagementFactory.getCompilationMXBean