summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjohn.r.misinco2011-06-06 16:16:38 (EDT)
committerRyan D. Brooks2011-06-06 16:16:38 (EDT)
commit543772efe6dbd68af233748354918a0ddadd14fb (patch)
treee152044d2bdd5f0b78ad49f1d6c8a7fb761b7767
parent35ca5ddb65c91649d228f509f05d74144ac7587d (diff)
downloadorg.eclipse.osee-543772efe6dbd68af233748354918a0ddadd14fb.zip
org.eclipse.osee-543772efe6dbd68af233748354918a0ddadd14fb.tar.gz
org.eclipse.osee-543772efe6dbd68af233748354918a0ddadd14fb.tar.bz2
refinement[bgz_348467]: Improve loading coverage package performance
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java20
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java4
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java8
3 files changed, 21 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
index 35725d9..c2004b7 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
@@ -38,7 +38,6 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
-import org.eclipse.osee.framework.skynet.core.utility.ElapsedTime;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.HelpUtil;
@@ -101,11 +100,13 @@ public class CoverageEditor extends FormEditor implements IActionable {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
+ monitor.beginTask("Load Coverage", 3);
+ monitor.worked(1);
@SuppressWarnings("unused")
Collection<Artifact> artifactLoadCache = null;
if (getCoverageEditorInput().getCoveragePackageArtifact() != null) {
try {
- ElapsedTime elapsedTime = new ElapsedTime("Coverage - bulk load");
+ // ElapsedTime elapsedTime = new ElapsedTime("Coverage - bulk load");
artifactLoadCache =
RelationManager.getRelatedArtifacts(
Collections.singleton(getCoverageEditorInput().getCoveragePackageArtifact()), 8,
@@ -113,17 +114,26 @@ public class CoverageEditor extends FormEditor implements IActionable {
// TODO Need to bulk load binary attributes also; Some Coverage Items are binary attributes
// that are not bulk loaded with attributes. This was mitigated by moving test units to seperate table
// and only referencing their ids in Coverage Items.
- elapsedTime.end();
+ // elapsedTime.end();
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
if (getCoverageEditorInput().getCoveragePackageArtifact() != null) {
- ElapsedTime elapsedTime = new ElapsedTime("Coverage - load model");
+ // ElapsedTime elapsedTime = new ElapsedTime("Coverage - load model");
CoveragePackage coveragePackage =
OseeCoveragePackageStore.get(getCoverageEditorInput().getCoveragePackageArtifact());
+ if (monitor.isCanceled()) {
+ return;
+ }
+ monitor.worked(1);
getCoverageEditorInput().setCoveragePackageBase(coveragePackage);
- elapsedTime.end();
+ if (monitor.isCanceled()) {
+ return;
+ }
+ monitor.worked(1);
+
+ // elapsedTime.end();
}
if (getCoverageEditorInput().isInTest()) {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java
index d5ce0c7..ce179b5 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java
@@ -12,9 +12,7 @@ package org.eclipse.osee.coverage.store;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.logging.Level;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoveragePackage;
@@ -36,7 +34,6 @@ public class DbWorkProductTaskProvider implements IWorkProductTaskProvider {
private CoveragePackage coveragePackage;
private final Branch branch;
List<WorkProductAction> actions = new ArrayList<WorkProductAction>();
- Map<String, WorkProductTask> guidToTasks = new HashMap<String, WorkProductTask>();
public DbWorkProductTaskProvider(Branch branch) {
this.branch = branch;
@@ -50,7 +47,6 @@ public class DbWorkProductTaskProvider implements IWorkProductTaskProvider {
@Override
public void reload() {
actions.clear();
- guidToTasks.clear();
try {
OseeCoveragePackageStore store = OseeCoveragePackageStore.get(coveragePackage, branch);
IOseeCmService cm = SkynetGuiPlugin.getInstance().getOseeCmService();
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
index 5ff3e13..cd36419 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
@@ -98,6 +98,10 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
public void loadWorkProductTaskNames(Collection<? extends ICoverage> coverages) {
this.coveragePackage.getWorkProductTaskProvider().reload();
+ loadWorkProductTaskNamesHelper(coverages);
+ }
+
+ private void loadWorkProductTaskNamesHelper(Collection<? extends ICoverage> coverages) {
for (ICoverage coverage : coverages) {
if (coverage instanceof IWorkProductRelatable) {
if (Strings.isValid(((IWorkProductRelatable) coverage).getWorkProductTaskGuid())) {
@@ -106,10 +110,10 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
}
}
if (coverage instanceof ICoverageUnitProvider) {
- loadWorkProductTaskNames(((ICoverageUnitProvider) coverage).getCoverageUnits());
+ loadWorkProductTaskNamesHelper(((ICoverageUnitProvider) coverage).getCoverageUnits());
}
if (coverage instanceof ICoverageItemProvider) {
- loadWorkProductTaskNames(((ICoverageItemProvider) coverage).getCoverageItems());
+ loadWorkProductTaskNamesHelper(((ICoverageItemProvider) coverage).getCoverageItems());
}
}
}