Merge "Omaha #2866 Calculate subgrid size to limit response sizes" into omaha_15.1.1

Former-commit-id: b0d2d462299007a623a70fe5cc75d1afed7af71a
This commit is contained in:
Nate Jensen 2015-02-11 14:13:12 -06:00 committed by Gerrit Code Review
commit 6fb8e5b0f8

View file

@ -74,6 +74,7 @@ import com.raytheon.uf.common.util.StringUtil;
* Oct 31, 2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
* Feb 04, 2014 2672 bsteffen Enable requesting subgrids.
* Jul 30, 2014 3184 njensen Renamed valid identifiers to optional
* Feb 10, 2015 2866 nabowle Overwrite subgrid size estimation.
*
* </pre>
*
@ -204,6 +205,22 @@ public class GFEGridFactory extends AbstractGridDataPluginFactory implements
return constraints;
}
/**
* Estimates the subgrid memory size using the grid geometry's size because
* {@link #getDataSource(PluginDataObject, SubGridGeometryCalculator)} uses
* an {@link OffsetDataSource} that holds the full grid data in memory.
*
* @param gridGeom
* @param subGrid
* @return
*/
protected long estimateSubgridSize(GridGeometry2D gridGeom,
SubGridGeometryCalculator subGrid) {
long size = gridGeom.getGridRange().getSpan(0)
* gridGeom.getGridRange().getSpan(1);
return size;
}
@Override
protected DataSource getDataSource(PluginDataObject pdo,
SubGridGeometryCalculator subGrid) {