Issue #2038 Correct required size estimations for subscription updates
Change-Id: I7994cb1492a4a541b6fe4720179fe928b3365db0 Former-commit-id: 2fb575c534a756a835cc072429ba78a417d3c445
This commit is contained in:
parent
08eb034abc
commit
94eeac2f7d
6 changed files with 44 additions and 7 deletions
|
@ -100,7 +100,8 @@ import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
||||||
* Jan 25, 2013 1528 djohnson Use priority enum instead of raw integers.
|
* Jan 25, 2013 1528 djohnson Use priority enum instead of raw integers.
|
||||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||||
* May 15, 2013 1040 mpduff Add Shared sites.
|
* May 15, 2013 1040 mpduff Add Shared sites.
|
||||||
* Jun 04, 2013 223 mpduff Modify for point data.
|
* Jun 04, 2013 223 mpduff Modify for point data.
|
||||||
|
* Jun 12, 2013 2038 djohnson No longer modal.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -185,7 +186,7 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
||||||
* true for new subscription, false for edit
|
* true for new subscription, false for edit
|
||||||
*/
|
*/
|
||||||
public CreateSubscriptionDlg(Shell parent, boolean create) {
|
public CreateSubscriptionDlg(Shell parent, boolean create) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL,
|
super(parent, SWT.DIALOG_TRIM,
|
||||||
CAVE.INDEPENDENT_SHELL | CAVE.PERSPECTIVE_INDEPENDENT);
|
CAVE.INDEPENDENT_SHELL | CAVE.PERSPECTIVE_INDEPENDENT);
|
||||||
this.create = create;
|
this.create = create;
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 29, 2012 djohnson Initial creation
|
* Nov 29, 2012 djohnson Initial creation
|
||||||
* May 22, 2013 1650 djohnson Add more bandwidth information.
|
* May 22, 2013 1650 djohnson Add more bandwidth information.
|
||||||
|
* Jun 12, 2013 2038 djohnson Maximum allowed size is returned in kilobytes.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -133,7 +134,7 @@ public class DisplayForceApplyPromptDialog extends CaveSWTDialog {
|
||||||
sizeLabel
|
sizeLabel
|
||||||
.setText("Maximum allowed size with current latency: "
|
.setText("Maximum allowed size with current latency: "
|
||||||
+ SizeUtil
|
+ SizeUtil
|
||||||
.prettyByteSize(configuration.maximumAllowedSize));
|
.prettyKiloByteSize(configuration.maximumAllowedSize));
|
||||||
sizeLabel
|
sizeLabel
|
||||||
.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||||
* May 14, 2013 2000 djohnson Check for subscription overlap/duplication.
|
* May 14, 2013 2000 djohnson Check for subscription overlap/duplication.
|
||||||
* May 23, 2013 1650 djohnson Move out some presentation logic to DisplayForceApplyPromptDialog.
|
* May 23, 2013 1650 djohnson Move out some presentation logic to DisplayForceApplyPromptDialog.
|
||||||
|
* Jun 12, 2013 2038 djohnson Launch subscription manager on the UI thread.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -649,9 +650,14 @@ public class SubscriptionService implements ISubscriptionService {
|
||||||
return new SubscriptionServiceResult(true);
|
return new SubscriptionServiceResult(true);
|
||||||
case EDIT_SUBSCRIPTIONS:
|
case EDIT_SUBSCRIPTIONS:
|
||||||
if (!result.config.isNotAbleToScheduleOnlyTheSubscription()) {
|
if (!result.config.isNotAbleToScheduleOnlyTheSubscription()) {
|
||||||
new SubscriptionManagerAction()
|
VizApp.runSync(new Runnable() {
|
||||||
.loadSubscriptionManager(SubscriptionManagerFilters
|
@Override
|
||||||
.getByNames(result.config.wouldBeUnscheduledSubscriptions));
|
public void run() {
|
||||||
|
new SubscriptionManagerAction()
|
||||||
|
.loadSubscriptionManager(SubscriptionManagerFilters
|
||||||
|
.getByNames(result.config.wouldBeUnscheduledSubscriptions));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return new SubscriptionServiceResult(true);
|
return new SubscriptionServiceResult(true);
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -33,6 +33,7 @@ import java.util.Set;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 29, 2012 1286 djohnson Initial creation
|
* Nov 29, 2012 1286 djohnson Initial creation
|
||||||
* May 28, 2013 1650 djohnson More information when failing to schedule.
|
* May 28, 2013 1650 djohnson More information when failing to schedule.
|
||||||
|
* Jun 12, 2013 2038 djohnson Maximum allowed size is returned in kilobytes.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -84,7 +85,7 @@ public interface IProposeScheduleResponse {
|
||||||
* Get the required dataset size for the subscription to not unschedule any
|
* Get the required dataset size for the subscription to not unschedule any
|
||||||
* subscriptions.
|
* subscriptions.
|
||||||
*
|
*
|
||||||
* @return the required dataset size
|
* @return the required dataset size, in kilobytes
|
||||||
*/
|
*/
|
||||||
long getRequiredDataSetSize();
|
long getRequiredDataSetSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
* Mar 29, 2013 1841 djohnson Renamed to UserSubscription.
|
* Mar 29, 2013 1841 djohnson Renamed to UserSubscription.
|
||||||
* May 15, 2013 1040 mpduff Added addOfficeId.
|
* May 15, 2013 1040 mpduff Added addOfficeId.
|
||||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||||
|
* Jun 12, 2013 2038 djohnson Set registryId from each constructor with arguments.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -103,6 +104,7 @@ public class SiteSubscription extends RecurringSubscription {
|
||||||
public SiteSubscription(SiteSubscription sub) {
|
public SiteSubscription(SiteSubscription sub) {
|
||||||
super(sub);
|
super(sub);
|
||||||
this.setOwner(sub.getOwner());
|
this.setOwner(sub.getOwner());
|
||||||
|
this.setId(RegistryUtil.getRegistryObjectKey(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
|
|
|
@ -73,6 +73,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
||||||
* Feb 26, 2013 1643 djohnson BandwidthService extends reusable class.
|
* Feb 26, 2013 1643 djohnson BandwidthService extends reusable class.
|
||||||
* Feb 27, 2013 1644 djohnson Bandwidth service is the WFO version.
|
* Feb 27, 2013 1644 djohnson Bandwidth service is the WFO version.
|
||||||
* May 20, 2013 1650 djohnson Add test for returning required dataset size.
|
* May 20, 2013 1650 djohnson Add test for returning required dataset size.
|
||||||
|
* Jun 12, 2013 2038 djohnson Add test for returning required dataset size on subscription update.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -393,6 +394,31 @@ public class BandwidthServiceIntTest extends AbstractWfoBandwidthManagerIntTest
|
||||||
expectedRequiredDataSetSize, requiredDataSetSize);
|
expectedRequiredDataSetSize, requiredDataSetSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testProposeScheduleSubscriptionsSecondDoesntFitReturnsRequiredSizeForSubscriptionUpdate() {
|
||||||
|
|
||||||
|
Subscription subscription = createSubscriptionThatFillsHalfABucket();
|
||||||
|
subscription.getTime().setCycleTimes(
|
||||||
|
Arrays.asList(Integer.valueOf(6), Integer.valueOf(8)));
|
||||||
|
|
||||||
|
Set<String> unscheduledSubscriptions = service.schedule(subscription);
|
||||||
|
verifyNoSubscriptionsWereUnscheduled(unscheduledSubscriptions);
|
||||||
|
|
||||||
|
// We can only fit up to a bucket
|
||||||
|
final long expectedRequiredDataSetSize = createSubscriptionThatFillsUpABucket()
|
||||||
|
.getDataSetSize();
|
||||||
|
|
||||||
|
// Try to update the subscription to fill two buckets
|
||||||
|
subscription.setDataSetSize(createSubscriptionThatFillsUpTwoBuckets()
|
||||||
|
.getDataSetSize());
|
||||||
|
|
||||||
|
final long requiredDataSetSize = service.proposeSchedule(subscription)
|
||||||
|
.getRequiredDataSetSize();
|
||||||
|
assertEquals(
|
||||||
|
"The required dataset size should have been returned from propose schedule!",
|
||||||
|
expectedRequiredDataSetSize, requiredDataSetSize);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDetermineRequiredSizeReturnsZeroIfUnableToFitAtAll() {
|
public void testDetermineRequiredSizeReturnsZeroIfUnableToFitAtAll() {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue