@Override public void setUpProcess() throws LuzzuIOException { try { this.processor = HDTManager.loadIndexedHDT(datasetLocation); this.hdtDictionary = this.processor.getDictionary(); this.nodeDictionary = new NodeDictionary(this.hdtDictionary); logger.debug("Dataset {} is loaded into HDT processor.", datasetLocation); } catch (IOException e) { ExceptionOutput.output(e, "Error loading HDT File", logger); throw new LuzzuIOException(e.getMessage()); } try { loadMetrics(); this.executor = Executors.newSingleThreadExecutor(); this.isInitalised = true; } catch (ExternalMetricLoaderException e) { ExceptionOutput.output(e, "Error loading metrics", logger); } }
@Override public Model open(Assembler a, Resource root, Mode mode) { String file = GraphUtils.getStringValue(root, HDTJenaConstants.pFileName) ; boolean loadInMemory = Boolean.parseBoolean(GraphUtils.getStringValue(root, HDTJenaConstants.pKeepInMemory)); try { // FIXME: Read more properties. Cache config? HDT hdt; if(loadInMemory) { hdt = HDTManager.loadIndexedHDT(file, null); } else { hdt = HDTManager.mapIndexedHDT(file, null); } HDTGraph graph = new HDTGraph(hdt); return ModelFactory.createModelForGraph(graph); } catch (IOException e) { log.error("Error reading HDT file: {}", file, e); throw new AssemblerException(root, "Error reading HDT file: "+file+" / "+e.toString()); } }
public void execute() throws IOException { HDT hdt; if(loadInMemory) { hdt = HDTManager.loadIndexedHDT(hdtInput, this); } else { hdt= HDTManager.mapIndexedHDT(hdtInput, this);