Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-10-17 21:24:06 +0000
committerRyan D. Brooks2017-10-17 21:24:06 +0000
commitbf7c8aaa0fc6a6b8c9e9dbd5f75e133e74d861ca (patch)
treedad8319150a7edc3ee108990725261cbcc27b812 /plugins/org.eclipse.osee.framework.skynet.core
parentf910afe9b072518c1b79e166aa1bfe7a1c49575b (diff)
downloadorg.eclipse.osee-bf7c8aaa0fc6a6b8c9e9dbd5f75e133e74d861ca.tar.gz
org.eclipse.osee-bf7c8aaa0fc6a6b8c9e9dbd5f75e133e74d861ca.tar.xz
org.eclipse.osee-bf7c8aaa0fc6a6b8c9e9dbd5f75e133e74d861ca.zip
bug[ats_TW2861]: Improve performance of change reports
- Add check to not load binary attributes in change report - Add lazy was-is loader in client change reports Change-Id: I7c5f38eccbc40b2d610c50fb5656c4ae0d3ecdd0
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactWasIsLazyProvider.java22
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java26
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java94
3 files changed, 112 insertions, 30 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactWasIsLazyProvider.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactWasIsLazyProvider.java
new file mode 100644
index 00000000000..f4c80acd231
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactWasIsLazyProvider.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.skynet.core.change;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface ArtifactWasIsLazyProvider {
+
+ public String getWasValue();
+
+ public String getIsValue();
+
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
index 7275e12e241..eb2c4d0afaf 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
@@ -35,19 +35,33 @@ import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType;
public final class AttributeChange extends Change {
private final static LoadChangeType changeType = LoadChangeType.attribute;
- private final String isValue;
- private final String wasValue;
+ private String isValue;
+ private String wasValue;
private final AttributeId attrId;
private final AttributeType attributeType;
private final ModificationType artModType;
+ private final ArtifactWasIsLazyProvider wasIsProvider;
public AttributeChange(BranchId branch, GammaId sourceGamma, ArtifactId artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, AttributeId attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
+ this(branch, sourceGamma, artId, txDelta, modType, isValue, wasValue, null, attrId, attributeType, artModType,
+ isHistorical, changeArtifact, artifactDelta);
+ }
+
+ public AttributeChange(BranchId branch, GammaId sourceGamma, ArtifactId artId, TransactionDelta txDelta, ModificationType modType, ArtifactWasIsLazyProvider wasIsProvider, AttributeId attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
+ this(branch, sourceGamma, artId, txDelta, modType, null, null, wasIsProvider, attrId, attributeType, artModType,
+ isHistorical, changeArtifact, artifactDelta);
+ }
+
+ public AttributeChange(BranchId branch, GammaId sourceGamma, ArtifactId artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, ArtifactWasIsLazyProvider wasIsProvider, AttributeId attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
super(branch, sourceGamma, artId, txDelta, modType, isHistorical, changeArtifact, artifactDelta);
this.isValue = isValue;
this.wasValue = wasValue;
+ this.wasIsProvider = wasIsProvider;
this.attrId = attrId;
this.attributeType = attributeType;
this.artModType = artModType;
+ this.isValue = null;
+ this.wasValue = null;
}
@Override
@@ -96,12 +110,18 @@ public final class AttributeChange extends Change {
@Override
public String getIsValue() {
+ if (isValue == null) {
+ isValue = wasIsProvider.getIsValue();
+ }
return isValue != null ? isValue : "";
}
@Override
public String getWasValue() {
- return wasValue;
+ if (wasValue == null) {
+ wasValue = wasIsProvider.getWasValue();
+ }
+ return wasValue != null ? wasValue : "";
}
public Attribute<?> getAttribute() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
index c8f2f2e7804..738e238e5fe 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
@@ -46,6 +46,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.skynet.core.change.ArtifactChange;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
+import org.eclipse.osee.framework.skynet.core.change.ArtifactWasIsLazyProvider;
import org.eclipse.osee.framework.skynet.core.change.AttributeChange;
import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.skynet.core.change.ErrorChange;
@@ -54,6 +55,7 @@ import org.eclipse.osee.framework.skynet.core.change.TupleChange;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
import org.eclipse.osee.framework.skynet.core.internal.ServiceUtil;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
+import org.eclipse.osee.framework.skynet.core.utility.OseeInfo;
import org.eclipse.osee.jaxrs.client.JaxRsExceptions;
import org.eclipse.osee.orcs.rest.client.OseeClient;
import org.eclipse.osee.orcs.rest.model.TransactionEndpoint;
@@ -242,35 +244,21 @@ public class ChangeDataLoader extends AbstractOperation {
item.getDestinationVersion().getApplicabilityToken().getName(), AttributeId.valueOf(itemId),
attributeType, netModType, isHistorical, changeArtifact, artifactDelta);
} else {
- String isValue = item.getCurrentVersion().getValue();
-
- String wasValue = "";
- if (!txDelta.areOnTheSameBranch()) {
- ChangeVersion netChange = item.getNetChange();
- if (!ChangeItemUtil.isNew(netChange) && !ChangeItemUtil.isIntroduced(netChange)) {
- ChangeVersion fromVersion = ChangeItemUtil.getStartingVersion(item);
- wasValue = fromVersion.getValue();
- }
+
+ // Remove after 26.0 release; only set in OseeInfo if want to turn off
+ String value = OseeInfo.getValue("UseWasIsLazyProvider");
+ boolean useWasIsLazyProvider = !"false".equals(value);
+ ChangeDateLoaderWasIsLazyProvider wasIsProvider =
+ new ChangeDateLoaderWasIsLazyProvider(txDelta, item, attributeType, artifactDelta);
+ if (useWasIsLazyProvider) {
+ change = new AttributeChange(startTxBranch, itemGammaId, artId, txDelta, netModType, wasIsProvider,
+ AttributeId.valueOf(itemId), attributeType, netModType, isHistorical, changeArtifact,
+ artifactDelta);
} else {
- Artifact startArtifact = null;
-
- if (artifactDelta != null) {
- startArtifact = artifactDelta.getBaseArtifact();
- if (startArtifact == null) {
- startArtifact = artifactDelta.getStartArtifact();
- }
- }
-
- if (startArtifact != null) {
- wasValue = startArtifact.getAttributesToString(attributeType);
- if (wasValue == null) {
- wasValue = "";
- }
- }
+ change = new AttributeChange(startTxBranch, itemGammaId, artId, txDelta, netModType,
+ wasIsProvider.getIsValue(), wasIsProvider.getWasValue(), AttributeId.valueOf(itemId),
+ attributeType, netModType, isHistorical, changeArtifact, artifactDelta);
}
-
- change = new AttributeChange(startTxBranch, itemGammaId, artId, txDelta, netModType, isValue, wasValue,
- AttributeId.valueOf(itemId), attributeType, netModType, isHistorical, changeArtifact, artifactDelta);
}
break;
case RELATION_CHANGE:
@@ -320,6 +308,58 @@ public class ChangeDataLoader extends AbstractOperation {
return change;
}
+ private static class ChangeDateLoaderWasIsLazyProvider implements ArtifactWasIsLazyProvider {
+
+ private final TransactionDelta txDelta;
+ private final ChangeItem item;
+ private final AttributeType attributeType;
+ private final ArtifactDelta artifactDelta;
+
+ public ChangeDateLoaderWasIsLazyProvider(TransactionDelta txDelta, ChangeItem item, AttributeType attributeType, ArtifactDelta artifactDelta) {
+ this.txDelta = txDelta;
+ this.item = item;
+ this.attributeType = attributeType;
+ this.artifactDelta = artifactDelta;
+
+ }
+
+ @Override
+ public String getWasValue() {
+ String wasValue = "";
+ if (!txDelta.areOnTheSameBranch()) {
+ ChangeVersion netChange = item.getNetChange();
+ if (!ChangeItemUtil.isNew(netChange) && !ChangeItemUtil.isIntroduced(netChange)) {
+ ChangeVersion fromVersion = ChangeItemUtil.getStartingVersion(item);
+ wasValue = fromVersion.getValue();
+ }
+ } else {
+ Artifact startArtifact = null;
+
+ if (artifactDelta != null) {
+ startArtifact = artifactDelta.getBaseArtifact();
+ if (startArtifact == null) {
+ startArtifact = artifactDelta.getStartArtifact();
+ }
+ }
+
+ if (startArtifact != null) {
+ wasValue = startArtifact.getAttributesToString(attributeType);
+ if (wasValue == null) {
+ wasValue = "";
+ }
+ }
+ }
+
+ return wasValue;
+ }
+
+ @Override
+ public String getIsValue() {
+ return item.getCurrentVersion().getValue();
+ }
+
+ }
+
private void bulkLoadArtifactDeltas(CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded, Collection<ChangeItem> changeItems) throws OseeCoreException {
Set<Integer> artIds = asArtIds(changeItems);

Back to the top