Issue #2106 Fix setting of data size on gridded subscriptions

Change-Id: I5dea937a9ad9f4691e58fb08a97ad6770cd8f925

Former-commit-id: 2184e50ce1 [formerly 71da2985f7] [formerly b486e5f2fe] [formerly 2184e50ce1 [formerly 71da2985f7] [formerly b486e5f2fe] [formerly 554b43807e [formerly b486e5f2fe [formerly c9138bb9d844ed7c38df420734c2723321ad450b]]]]
Former-commit-id: 554b43807e
Former-commit-id: 288442cc56 [formerly 7887201ebf] [formerly f2fb463c4b87ba9647cb7461559ab4814fb6d249 [formerly eaa3e47877]]
Former-commit-id: 1cbb92b6fbbf26251035f705e4326db36916114d [formerly 6987235067]
Former-commit-id: 2fed4b0da0
This commit is contained in:
Dustin Johnson 2013-06-20 15:35:32 -05:00
parent c168ee49ef
commit 147ef5ce3e
4 changed files with 25 additions and 29 deletions

View file

@ -371,25 +371,6 @@ public class GriddedSubsetManagerDlg
return null;
}
subscription.setUrl(getSubscriptionUrl());
Time time = sub.getTime();
List<String> fcstHours = time.getFcstHours();
// Set the gridded specific data on the time object
String[] selectedItems = this.timingTabControls.getSelectedFcstHours();
List<Integer> fcstIndices = new ArrayList<Integer>();
for (String hr : selectedItems) {
fcstIndices.add(fcstHours.indexOf(hr));
}
time.setSelectedTimeIndices(fcstIndices);
subscription.setTime(time);
if (ensembleTab != null) {
ensembleTab.populateSubscription(subscription);
}
return subscription;
}
@ -641,8 +622,25 @@ public class GriddedSubsetManagerDlg
setCoverage(sub, cov);
sub.setUrl(getSubscriptionUrl());
List<String> fcstHours = newTime.getFcstHours();
// Set the gridded specific data on the time object
String[] selectedItems = this.timingTabControls.getSelectedFcstHours();
List<Integer> fcstIndices = new ArrayList<Integer>();
for (String hr : selectedItems) {
fcstIndices.add(fcstHours.indexOf(hr));
}
newTime.setSelectedTimeIndices(fcstIndices);
if (ensembleTab != null) {
ensembleTab.populateSubscription(sub);
}
// Pass a fully populated subscription in to get the size
if (dataSize == null) {
if (dataSize != null) {
sub.setDataSetSize(dataSize.getDataSetSizeInKb(sub));
}

View file

@ -201,9 +201,6 @@ public class PointSubsetManagerDlg extends
newTime.setStartDate(new Date());
newTime.setEndDate(new Date());
sub.setTime(newTime);
// Setting arbitrary size until mpduff and dhladky figure out their data
// size estimates
sub.setDataSetSize(50);
Coverage cov = new Coverage();
cov.setEnvelope(dataSet.getCoverage().getEnvelope());

View file

@ -25,6 +25,7 @@ import java.util.Map;
import org.geotools.geometry.jts.ReferencedEnvelope;
import com.raytheon.uf.common.datadelivery.registry.Coverage;
import com.raytheon.uf.common.datadelivery.registry.Ensemble;
import com.raytheon.uf.common.datadelivery.registry.GriddedCoverage;
import com.raytheon.uf.common.datadelivery.registry.GriddedDataSet;
import com.raytheon.uf.common.datadelivery.registry.Levels;
@ -172,10 +173,12 @@ public class GriddedDataSizeUtils extends DataSizeUtils<GriddedDataSet> {
*/
@Override
public long getDataSetSizeInBytes(Subscription subscription) {
final Ensemble ensemble = subscription.getEnsemble();
int numEnsemble = (ensemble == null) ? 1 : ensemble.getMemberCount();
return getDataSetSizeInBytes(subscription.getParameter(), subscription
.getTime().getSelectedTimeIndices().size(), subscription
.getEnsemble().getMemberCount(), subscription.getCoverage()
.getRequestEnvelope());
.getTime().getSelectedTimeIndices().size(), numEnsemble,
subscription.getCoverage().getRequestEnvelope());
}
/**

View file

@ -36,8 +36,6 @@ import org.eclipse.jetty.servlets.ProxyServlet;
import org.eclipse.jetty.util.security.Constraint;
import org.eclipse.jetty.util.security.Credential;
import com.raytheon.uf.common.comm.HttpProxyTestConstants;
/**
* This class sets up a Jetty Server that can serve up Proxied HttpServlets in
* either http or https mode.
@ -64,7 +62,7 @@ public class ProxiedJettyServer {
private int httpport = 8085;
/** The realm string **/
private String realm;
private final String realm;
/** Jetty server instance */
private Server server;