本文整理汇总了Java中cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters类的典型用法代码示例。如果您正苦于以下问题:Java EnumFusionCounters类的具体用法?Java EnumFusionCounters怎么用?Java EnumFusionCounters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnumFusionCounters类属于cz.cuni.mff.odcleanstore.fusiontool.util包,在下文中一共展示了EnumFusionCounters类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printProfilingInformation
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
private static void printProfilingInformation(Config config, LDFusionToolComponentFactory componentFactory, FusionRunner runner) {
if (config.isProfilingOn()) {
ProfilingTimeCounter<EnumFusionCounters> timeProfiler = runner.getTimeProfiler();
timeProfiler.addProfilingTimeCounter(componentFactory.getExecutorTimeProfiler());
MemoryProfiler memoryProfiler = componentFactory.getExecutorMemoryProfiler();
System.out.println("-- Profiling information --------");
System.out.println("Initialization time: " + timeProfiler.formatCounter(EnumFusionCounters.INITIALIZATION));
System.out.println("Reading metadata & sameAs links: " + timeProfiler.formatCounter(EnumFusionCounters.META_INITIALIZATION));
System.out.println("Data preparation time: " + timeProfiler.formatCounter(EnumFusionCounters.DATA_INITIALIZATION));
System.out.println("Quad loading time: " + timeProfiler.formatCounter(EnumFusionCounters.QUAD_LOADING));
System.out.println("Input filtering time: " + timeProfiler.formatCounter(EnumFusionCounters.INPUT_FILTERING));
System.out.println("Buffering time: " + timeProfiler.formatCounter(EnumFusionCounters.BUFFERING));
System.out.println("Conflict resolution time: " + timeProfiler.formatCounter(EnumFusionCounters.CONFLICT_RESOLUTION));
System.out.println("Output writing time: " + timeProfiler.formatCounter(EnumFusionCounters.OUTPUT_WRITING));
System.out.println("Maximum recorded total memory: " + MemoryProfiler.formatMemoryBytes(memoryProfiler.getMaxTotalMemory()));
System.out.println("Maximum recorded used memory: " + MemoryProfiler.formatMemoryBytes(memoryProfiler.getMaxUsedMemory()));
System.out.println("Minimum recorded free memory: " + MemoryProfiler.formatMemoryBytes(memoryProfiler.getMinFreeMemory()));
}
}
示例2: FusionToolDpuComponentFactory
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
/**
* Creates a new instance.
* @param config configuration
* @param executionContext execution context
* @param rdfInputs RDF input data
* @param sameAsInput input owl:sameAs links
* @param metadataInput input metadata
* @param rdfOutput RDF output data
*/
public FusionToolDpuComponentFactory(
ConfigContainer config, DPUContext executionContext, List<? extends RDFDataUnit> rdfInputs,
RDFDataUnit sameAsInput, RDFDataUnit metadataInput, WritableRDFDataUnit rdfOutput) {
this.config = config;
this.executionContext = executionContext;
this.rdfInputs = rdfInputs;
this.sameAsInput = sameAsInput;
this.metadataInput = metadataInput;
this.rdfOutput = rdfOutput;
this.executorTimeProfiler = ProfilingTimeCounter.createInstance(EnumFusionCounters.class, config.isProfilingOn());
this.executorMemoryProfiler = MemoryProfiler.createInstance(config.isProfilingOn());
}
示例3: printProfilingInformation
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
private void printProfilingInformation(FusionToolDpuComponentFactory componentFactory, FusionRunner runner) {
ProfilingTimeCounter<EnumFusionCounters> timeProfiler = runner.getTimeProfiler();
timeProfiler.addProfilingTimeCounter(componentFactory.getExecutorTimeProfiler());
LOG.info("-- Profiling information --------");
LOG.info("Initialization time: " + timeProfiler.formatCounter(EnumFusionCounters.INITIALIZATION));
LOG.info("Reading metadata & sameAs links: " + timeProfiler.formatCounter(EnumFusionCounters.META_INITIALIZATION));
LOG.info("Data preparation time: " + timeProfiler.formatCounter(EnumFusionCounters.DATA_INITIALIZATION));
LOG.info("Triple loading time: " + timeProfiler.formatCounter(EnumFusionCounters.QUAD_LOADING));
LOG.info("Input filtering time: " + timeProfiler.formatCounter(EnumFusionCounters.INPUT_FILTERING));
LOG.info("Buffering time: " + timeProfiler.formatCounter(EnumFusionCounters.BUFFERING));
LOG.info("Conflict resolution time: " + timeProfiler.formatCounter(EnumFusionCounters.CONFLICT_RESOLUTION));
LOG.info("Output writing time: " + timeProfiler.formatCounter(EnumFusionCounters.OUTPUT_WRITING));
}
示例4: LDFusionToolExecutor
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
/**
* @param hasVirtuosoSource indicates whether the {@link cz.cuni.mff.odcleanstore.fusiontool.loaders.InputLoader}
* given to {@code fuse()} may contain a source of type
* {@link cz.cuni.mff.odcleanstore.fusiontool.config.EnumDataSourceType#VIRTUOSO} (need for Virtuoso bug circumvention).
* @param maxOutputTriples maximum number of triples to be processed; null means unlimited
* @param timeProfiler time profiler
* @param memoryProfiler memory profiler
*/
public LDFusionToolExecutor(
boolean hasVirtuosoSource,
Long maxOutputTriples,
ResourceDescriptionFilter resourceDescriptionFilter,
ProfilingTimeCounter<EnumFusionCounters> timeProfiler,
MemoryProfiler memoryProfiler) {
this.hasVirtuosoSource = hasVirtuosoSource;
this.maxOutputTriples = maxOutputTriples;
this.resourceDescriptionFilter = resourceDescriptionFilter;
this.timeProfiler = timeProfiler;
this.memoryProfiler = memoryProfiler;
}
示例5: measuresTimeWhenProfilingIsOn
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
@Test
public void measuresTimeWhenProfilingIsOn() throws Exception {
FusionRunner runner = new FusionRunner(componentFactory);
runner.setProfilingOn(true);
runner.runFusionTool();
ProfilingTimeCounter<EnumFusionCounters> profiler = runner.getTimeProfiler();
assertThat(profiler.getCounter(EnumFusionCounters.META_INITIALIZATION), greaterThan(0L));
}
示例6: doesNotMeasureTimeWhenProfilingIsOff
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
@Test
public void doesNotMeasureTimeWhenProfilingIsOff() throws Exception {
FusionRunner runner = new FusionRunner(componentFactory);
runner.setProfilingOn(false);
runner.runFusionTool();
ProfilingTimeCounter<EnumFusionCounters> profiler = runner.getTimeProfiler();
assertThat(profiler.getCounter(EnumFusionCounters.META_INITIALIZATION), is(0L));
}
示例7: getLDFusionToolExecutor
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
private LDFusionToolExecutor getLDFusionToolExecutor(long maxOutputTriples, boolean hasVirtuosoSource) {
return new LDFusionToolExecutor(
hasVirtuosoSource,
maxOutputTriples,
new NoOpFilter(),
ProfilingTimeCounter.createInstance(EnumFusionCounters.class, false),
MemoryProfiler.createInstance(false));
}
示例8: getExecutorTimeProfiler
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
public ProfilingTimeCounter<EnumFusionCounters> getExecutorTimeProfiler() {
return executorTimeProfiler;
}
示例9: runFusionTool
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
/**
* Performs the actual LD-FusionTool task according to the given configuration.
* @throws cz.cuni.mff.odcleanstore.fusiontool.exceptions.LDFusionToolException general fusion error
* @throws java.io.IOException I/O error when writing results
* @throws cz.cuni.mff.odcleanstore.conflictresolution.exceptions.ConflictResolutionException conflict resolution error
*/
public void runFusionTool() throws LDFusionToolException, IOException, ConflictResolutionException {
InputLoader inputLoader = null;
CloseableRDFWriter rdfWriter = null;
timeProfiler = ProfilingTimeCounter.createInstance(EnumFusionCounters.class, isProfilingOn);
try {
// Load source named graphs metadata
timeProfiler.startCounter(EnumFusionCounters.META_INITIALIZATION);
Model metadata = componentFactory.getMetadata();
// Load & resolve owl:sameAs links
UriMappingIterable uriMapping = componentFactory.getUriMapping();
timeProfiler.stopAddCounter(EnumFusionCounters.META_INITIALIZATION);
// Create & initialize quad loader
timeProfiler.startCounter(EnumFusionCounters.DATA_INITIALIZATION);
inputLoader = componentFactory.getInputLoader();
inputLoader.initialize(uriMapping);
timeProfiler.stopAddCounter(EnumFusionCounters.DATA_INITIALIZATION);
// Initialize executor
timeProfiler.startCounter(EnumFusionCounters.INITIALIZATION);
ResourceDescriptionConflictResolver conflictResolver = componentFactory.getConflictResolver(metadata, uriMapping);
rdfWriter = componentFactory.getRDFWriter();
FusionExecutor executor = componentFactory.getExecutor(uriMapping);
timeProfiler.stopAddCounter(EnumFusionCounters.INITIALIZATION);
// Do the actual work
executor.fuse(conflictResolver, inputLoader, rdfWriter);
// Write metadata
timeProfiler.startCounter(EnumFusionCounters.META_OUTPUT_WRITING);
componentFactory.getCanonicalUriWriter(uriMapping).write(uriMapping);
componentFactory.getSameAsLinksWriter().write(uriMapping);
timeProfiler.stopAddCounter(EnumFusionCounters.META_OUTPUT_WRITING);
} finally {
if (rdfWriter != null) {
rdfWriter.close();
}
if (inputLoader != null) {
inputLoader.close();
}
}
}
示例10: fuse
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
@Override
public void fuse(ResourceDescriptionConflictResolver conflictResolver, InputLoader inputLoader, CloseableRDFWriter rdfWriter)
throws LDFusionToolException, ConflictResolutionException, IOException {
// Initialize triple counters
long outputTriples = 0;
long inputTriples = 0;
boolean checkMaxOutputTriples = maxOutputTriples != null && maxOutputTriples >= 0;
// Load & process input quads
LOG.info("Starting conflict resolution");
timeProfiler.startCounter(EnumFusionCounters.BUFFERING);
while (!isCanceled() && inputLoader.hasNext()) {
timeProfiler.stopAddCounter(EnumFusionCounters.BUFFERING);
// Load quads for the given subject
timeProfiler.startCounter(EnumFusionCounters.QUAD_LOADING);
ResourceDescription resourceDescription = inputLoader.next();
inputTriples += resourceDescription.getDescribingStatements().size();
timeProfiler.stopAddCounter(EnumFusionCounters.QUAD_LOADING);
// Apply input filters
timeProfiler.startCounter(EnumFusionCounters.INPUT_FILTERING);
boolean accept = this.resourceDescriptionFilter.accept(resourceDescription);
timeProfiler.stopAddCounter(EnumFusionCounters.INPUT_FILTERING);
if (!accept) {
LOG.debug("Resource {} doesn't match filter, skipping", resourceDescription.getResource());
timeProfiler.startCounter(EnumFusionCounters.BUFFERING);
continue;
}
// Resolve conflicts
timeProfiler.startCounter(EnumFusionCounters.CONFLICT_RESOLUTION);
Collection<ResolvedStatement> resolvedQuads = conflictResolver.resolveConflicts(resourceDescription);
timeProfiler.stopAddCounter(EnumFusionCounters.CONFLICT_RESOLUTION);
LOG.debug("Resolved {} quads resulting in {} quads (processed totally {} quads)",
new Object[] {resourceDescription.getDescribingStatements().size(), resolvedQuads.size(), inputTriples});
// Check if we have reached the limit on output triples
if (checkMaxOutputTriples && outputTriples + resolvedQuads.size() > maxOutputTriples) {
break;
}
outputTriples += resolvedQuads.size();
// Add objects filtered by CR for traversal
timeProfiler.startCounter(EnumFusionCounters.BUFFERING);
inputLoader.updateWithResolvedStatements(resolvedQuads);
timeProfiler.stopAddCounter(EnumFusionCounters.BUFFERING);
// Write result to output
timeProfiler.startCounter(EnumFusionCounters.OUTPUT_WRITING);
rdfWriter.writeResolvedStatements(resolvedQuads);
timeProfiler.stopAddCounter(EnumFusionCounters.OUTPUT_WRITING);
memoryProfiler.capture();
fixVirtuosoOpenedStatements();
timeProfiler.startCounter(EnumFusionCounters.BUFFERING);
}
timeProfiler.stopAddCounter(EnumFusionCounters.BUFFERING);
if (isCanceled()) {
LOG.warn("The execution was canceled!");
}
LOG.info(String.format("Processed %,d quads which were resolved to %,d output quads.", inputTriples, outputTriples));
}
示例11: getTimeProfiler
import cz.cuni.mff.odcleanstore.fusiontool.util.EnumFusionCounters; //导入依赖的package包/类
/**
* Returns profiling information about the last execution of {@link #runFusionTool()}.
* The profiling information will contain meaningful values only if profiling is turned on with {@link #setProfilingOn(boolean)}.
* @return profiling info
*/
public ProfilingTimeCounter<EnumFusionCounters> getTimeProfiler() {
return timeProfiler;
}