diff --git a/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java b/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java index a4b2ef4359..149c0bff73 100644 --- a/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java +++ b/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java @@ -42,7 +42,6 @@ import com.raytheon.uf.common.pointdata.PointDataDescription.Type; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.catalog.DirectDbQuery; import com.raytheon.uf.viz.core.catalog.LayerProperty; import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter; @@ -99,7 +98,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { ffgDescription.parameters[6] = new ParameterDescription("stationId", Type.STRING); ffgDescription.parameters[7] = new ParameterDescription("id", Type.INT); - ffgDescription.parameters[8] = new ParameterDescription("dataURI", Type.STRING); + ffgDescription.parameters[8] = new ParameterDescription("dataURI", + Type.STRING); rtpDescription.parameters = new ParameterDescription[7]; rtpDescription.parameters[0] = new ParameterDescription("time", @@ -113,7 +113,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { rtpDescription.parameters[4] = new ParameterDescription("stationId", Type.STRING); rtpDescription.parameters[5] = new ParameterDescription("id", Type.INT); - rtpDescription.parameters[6] = new ParameterDescription("dataURI", Type.STRING); + rtpDescription.parameters[6] = new ParameterDescription("dataURI", + Type.STRING); } @@ -128,7 +129,6 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { List> results = new ArrayList>( requests.size()); for (TimeQueryRequest request : requests) { - request.setSimDate(SimulatedTime.getSystemTime().getTime()); DataTime[] result = timeQuery(request.getQueryTerms(), request.isMaxQuery(), request.getBinOffset()); if (result != null) { @@ -243,7 +243,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { pdv.setFloat("3hr", Float.valueOf(parts[1])); pdv.setFloat("6hr", Float.valueOf(parts[2])); pdv.setString("stationId", station); - pdv.setString("dataURI", "/textPoints/" + station + "/" + time); + pdv.setString("dataURI", "/textPoints/" + station + "/" + + time); // TODO this id is not really guaranteed to be unique pdv.setInt("id", ((int) time) + station.hashCode()); } @@ -321,7 +322,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { pdv.setFloat("latitude", (float) coord.latlon.y); pdv.setFloat("precip", precip); pdv.setString("stationId", station); - pdv.setString("dataURI", "/textPoints/" + station + "/" + time); + pdv.setString("dataURI", "/textPoints/" + station + "/" + + time); // TODO this id is not really guaranteed to be unique pdv.setInt("id", ((int) time) + station.hashCode()); } diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/catalog/CatalogQuery.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/catalog/CatalogQuery.java index 0d9280036e..270ad77984 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/catalog/CatalogQuery.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/catalog/CatalogQuery.java @@ -36,7 +36,6 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.comm.Connector; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; @@ -233,7 +232,6 @@ public class CatalogQuery { req.setMaxQuery(max); req.setPluginName(pluginName); req.setBinOffset(binOffset); - req.setSimDate(SimulatedTime.getSystemTime().getTime()); req.setQueryTerms(constraintMap); return req; diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DefaultDataCubeAdapter.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DefaultDataCubeAdapter.java index 57097a15e3..c98b3b970f 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DefaultDataCubeAdapter.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DefaultDataCubeAdapter.java @@ -31,7 +31,6 @@ import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.catalog.LayerProperty; import com.raytheon.uf.viz.core.catalog.ScriptCreator; import com.raytheon.uf.viz.core.comm.Loader; @@ -88,11 +87,7 @@ public class DefaultDataCubeAdapter implements IDataCubeAdapter { throws VizException { TimeQueryRequestSet set = new TimeQueryRequestSet(); set.setRequests(requests.toArray(new TimeQueryRequest[0])); - // boundary for time queries - for (TimeQueryRequest req: set.getRequests()) { - req.setSimDate(SimulatedTime.getSystemTime().getTime()); - } - + @SuppressWarnings("unchecked") List> result = (List>) ThriftClient .sendRequest(set); diff --git a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/AbstractDataCubeAdapter.java b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/AbstractDataCubeAdapter.java index ce44406d41..aa292d8c95 100644 --- a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/AbstractDataCubeAdapter.java +++ b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/AbstractDataCubeAdapter.java @@ -43,7 +43,6 @@ import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.catalog.LayerProperty; import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter; import com.raytheon.uf.viz.core.datastructure.VizDataCubeException; @@ -109,7 +108,6 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter { for (TimeQueryRequest request : requests) { List requestNodes = evaluateRequestConstraints(request .getQueryTerms()); - request.setSimDate(SimulatedTime.getSystemTime().getTime()); // pull out time queries and bulk submit for (AbstractRequestableLevelNode requestNode : requestNodes) { getTimeQuery(request, requestNode, false, queries, cache, null); @@ -178,8 +176,6 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter { TimeQueryRequest myQ = req.getTimeQuery(originalRequest, latestOnly, cache, latestOnlyCache); if (myQ != null) { - // Make sure simulated time gets set - myQ.setSimDate(originalRequest.getSimDate()); queries.put(req, myQ); } } else { diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientURICatalog.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientURICatalog.java index 941fea86a4..69d9961b26 100644 --- a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientURICatalog.java +++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientURICatalog.java @@ -35,7 +35,6 @@ import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.URICatalog; @@ -123,7 +122,6 @@ public class ThinClientURICatalog extends URICatalog implements TimeQueryRequest request = new TimeQueryRequest(); request.setPluginName(pluginName); request.setMaxQuery(true); - request.setSimDate(SimulatedTime.getSystemTime().getTime()); request.setQueryTerms(map); List requestList = requests.get(pluginName); if (requestList == null) { diff --git a/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/AutoUpdater.java b/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/AutoUpdater.java index 47034c06cd..99a3d35e0d 100644 --- a/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/AutoUpdater.java +++ b/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/AutoUpdater.java @@ -107,109 +107,110 @@ public class AutoUpdater implements IAlertObserver { public AutoUpdater() { } - @Override - public void alertArrived(Collection alertMessages) { - Set displayList = new HashSet(); - Map> pdoSendMap = new IdentityHashMap>(); - int errors = 0; + @Override + public void alertArrived(Collection alertMessages) { + Set displayList = new HashSet(); + Map> pdoSendMap = new IdentityHashMap>(); + int errors = 0; - for (AlertMessage message : alertMessages) { - Map attribs = message.decodedAlert; - DataTime dataTime = (DataTime) attribs.get("dataTime"); - if (dataTime.getRefTime().before( - SimulatedTime.getSystemTime().getTime())) { - try { - // System.out.println("extract took: " + (tZ1 - tZ0)); - java.util.List> rscList = DataUpdateTree - .getInstance().searchTree(attribs); - // System.out.println("AutoUpdater found: " + rscList); + for (AlertMessage message : alertMessages) { + Map attribs = message.decodedAlert; + DataTime dataTime = (DataTime) attribs.get("dataTime"); + if (dataTime.getRefTime().before( + SimulatedTime.getSystemTime().getTime())) { + try { + // System.out.println("extract took: " + (tZ1 - tZ0)); + java.util.List> rscList = DataUpdateTree + .getInstance().searchTree(attribs); + // System.out.println("AutoUpdater found: " + rscList); - if (rscList != null && rscList.size() > 0) { + if (rscList != null && rscList.size() > 0) { - for (AbstractVizResource r1 : rscList) { - IDescriptor md = r1.getDescriptor(); - AbstractResourceData resourceData = r1 - .getResourceData(); - if (!(resourceData instanceof AbstractRequestableResourceData) - || resourceData.isFrozen()) - continue; + for (AbstractVizResource r1 : rscList) { + IDescriptor md = r1.getDescriptor(); + AbstractResourceData resourceData = r1 + .getResourceData(); + if (!(resourceData instanceof AbstractRequestableResourceData) + || resourceData.isFrozen()) + continue; - AbstractRequestableResourceData reqResourceData = (AbstractRequestableResourceData) resourceData; - AbstractAlertMessageParser parserToUse = null; - if ((parserToUse = reqResourceData.getAlertParser()) == null) { - parserToUse = defaultParser; - } - Object objectToSend = parserToUse - .parseAlertMessage(message, reqResourceData); + AbstractRequestableResourceData reqResourceData = (AbstractRequestableResourceData) resourceData; + AbstractAlertMessageParser parserToUse = null; + if ((parserToUse = reqResourceData.getAlertParser()) == null) { + parserToUse = defaultParser; + } + Object objectToSend = parserToUse + .parseAlertMessage(message, reqResourceData); - if (objectToSend != null) { - if (md.getTimeMatcher() != null) { - md.getTimeMatcher().redoTimeMatching(r1); - } - displayList.add(md); + if (objectToSend != null) { + if (md.getTimeMatcher() != null) { + md.getTimeMatcher().redoTimeMatching(r1); + } + displayList.add(md); - List list = pdoSendMap - .get(reqResourceData); - if (list == null) { - list = new ArrayList(); - pdoSendMap.put(reqResourceData, list); - } - list.add(objectToSend); + List list = pdoSendMap + .get(reqResourceData); + if (list == null) { + list = new ArrayList(); + pdoSendMap.put(reqResourceData, list); + } + list.add(objectToSend); - if (list.size() > 100) { - // update with objects - Class componentType = list.get(0) - .getClass(); - reqResourceData.update(list - .toArray((Object[]) Array - .newInstance(componentType, - list.size()))); - list.clear(); - } - } + if (list.size() > 100) { + // update with objects + Class componentType = list.get(0) + .getClass(); + reqResourceData.update(list + .toArray((Object[]) Array + .newInstance(componentType, + list.size()))); + list.clear(); + } + } - } + } - } + } - } catch (final Throwable e) { - if (errors < MAX_ERRORS) { - statusHandler.handle(Priority.PROBLEM, - "Error performing autoupdate", e); - } - errors++; - } - } + } catch (final Throwable e) { + if (errors < MAX_ERRORS) { + statusHandler.handle(Priority.PROBLEM, + "Error performing autoupdate", e); + } + errors++; + } + } + } - for (AbstractRequestableResourceData arrd : pdoSendMap.keySet()) { - List pdos = pdoSendMap.get(arrd); - if (pdos == null || pdos.size() < 1) { - continue; - } - Class componentType = pdos.get(0).getClass(); - arrd.update(pdos.toArray((Object[]) Array.newInstance( - componentType, pdos.size()))); - } + for (AbstractRequestableResourceData arrd : pdoSendMap.keySet()) { + List pdos = pdoSendMap.get(arrd); + if (pdos == null || pdos.size() < 1) { + continue; + } + Class componentType = pdos.get(0).getClass(); + arrd.update(pdos.toArray((Object[]) Array.newInstance( + componentType, pdos.size()))); + } - List refreshedDescriptors = new ArrayList(); - // Now do redo time matching, and refresh displays - for (IDescriptor disp : displayList) { - if (disp != null && disp.getRenderableDisplay() != null) { - IDisplayPaneContainer container = disp - .getRenderableDisplay().getContainer(); + List refreshedDescriptors = new ArrayList(); + // Now do redo time matching, and refresh displays + for (IDescriptor disp : displayList) { + if (disp != null && disp.getRenderableDisplay() != null) { + IDisplayPaneContainer container = disp.getRenderableDisplay() + .getContainer(); if (container == null) { continue; } - for (IDisplayPane pane : container.getDisplayPanes()) { - IDescriptor desc = pane.getDescriptor(); + for (IDisplayPane pane : container.getDisplayPanes()) { + IDescriptor desc = pane.getDescriptor(); - if (refreshedDescriptors.contains(desc)) { - continue; - } - TimeMatchingJob.scheduleTimeMatch(desc); - } - } - } - } - } + if (refreshedDescriptors.contains(desc)) { + continue; + } + TimeMatchingJob.scheduleTimeMatch(desc); + } + } + } + + } } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/GLStats.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/GLStats.java new file mode 100644 index 0000000000..ab1d3e1aa5 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/GLStats.java @@ -0,0 +1,287 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.core.gl; + +import java.nio.IntBuffer; +import java.util.Date; + +import javax.media.opengl.GL; + +import com.raytheon.viz.core.gl.internal.cache.ImageCache; +import com.raytheon.viz.core.gl.internal.cache.ImageCache.CacheType; + +/** + * + * Provides method for tracking graphics memory useage and logging if it becomes + * low. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2012            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ +public class GLStats { + + // how many seconds to wait before checking for high memory usage. + private static final int CHECK_FREQ_SECONDS = 15; + + // How many seconds to wait between printings + private static final int PRINT_FREQ_SECONDS = 600; + + // The minimum percentage of memory that must be used before printing. + private static final int MEM_PRINT_THRESHOLD_PERCENT = 90; + + // NVidia extension constants. + // http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt + private static final String NVX_EXT_ID = "GL_NVX_gpu_memory_info"; + + private static final int GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; + + private static final int GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; + + private static final int GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; + + private static final int GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; + + private static final int GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; + + // ATI extension constants + // http://www.opengl.org/registry/specs/ATI/meminfo.txt + private static final String ATI_EXT_ID = "GL_ATI_meminfo"; + + private static final int VBO_FREE_MEMORY_ATI = 0x87FB; + + private static final int TEXTURE_FREE_MEMORY_ATI = 0x87FC; + + private static final int RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; + + private static long lastPrintTime; + + private static long lastCheckTime; + + private static int lastNvxEvictionCount = 0; + + public static void printStats(GL gl) { + // test both check freq and print freq, the check freq should be fairly + // low so as soon as low memory conditions are reached we will + // report it so if it is a precursor to a crash it will be in the logs, + // the print time will be significantly higher to avoid + // spamming the logs if the user is operating normally with high memory + // useage. + long curTime = System.currentTimeMillis(); + if (curTime - lastCheckTime < CHECK_FREQ_SECONDS * 1000) { + // don't check if it hasn't been very long + return; + } + lastCheckTime = curTime; + if (curTime - lastPrintTime < PRINT_FREQ_SECONDS * 1000) { + // don't check if we printed to recently + return; + } + boolean lowMem = false; + StringBuilder output = new StringBuilder(1024); + output.append("-High Graphics Memory usage has been detected.\n"); + output.append("-Here are some statisitics that might help with that.\n"); + lowMem |= getSystemStats(output); + lowMem |= getImageCacheStats(output); + lowMem |= getNvidiaStats(gl, output); + // The ATI version is untested, only enable if it has been tested. + // lowMem |= getAtiStats(gl, output); + + if (lowMem) { + lastPrintTime = curTime; + System.out.println(output.toString()); + System.out.println(); + } + } + + protected static boolean getSystemStats(StringBuilder output) { + output.append(String.format(" * Current time = %s\n", + new Date().toString())); + Runtime runtime = Runtime.getRuntime(); + output.append(String.format(" * JVM max memory = %dMB\n", + runtime.maxMemory() / 1024 / 1024)); + output.append(String.format(" * JVM total memory = %dMB\n", + runtime.totalMemory() / 1024 / 1024)); + output.append(String.format(" * JVM free memory = %dMB\n", + runtime.freeMemory() / 1024 / 1024)); + return false; + } + + protected static boolean getImageCacheStats(StringBuilder output) { + ImageCache memCache = ImageCache.getInstance(CacheType.MEMORY); + ImageCache texCache = ImageCache.getInstance(CacheType.TEXTURE); + + long memTotal = memCache.maxSize(); + long memUsed = memCache.size(); + long memPercent = memUsed * 100 / memTotal; + + long texTotal = texCache.maxSize(); + long texUsed = texCache.size(); + long texPercent = texUsed * 100 / texTotal; + + output.append(String.format(" * Memory Image Cache size = %dMB\n", + memTotal / 1024 / 1024)); + output.append(String.format(" * Memory Image Cache used = %dMB\n", + memUsed / 1024 / 1024)); + output.append(String.format(" * Memory Image Cache percent = %d%%\n", + memPercent)); + output.append(String.format(" * Texture Image Cache size = %dMB\n", + texTotal / 1024 / 1024)); + output.append(String.format(" * Texture Image Cache used = %dMB\n", + texUsed / 1024 / 1024)); + output.append(String.format(" * Texture Image Cache percent = %d%%\n", + texPercent)); + + return texPercent > MEM_PRINT_THRESHOLD_PERCENT; + } + + protected static boolean getNvidiaStats(GL gl, StringBuilder output) { + if (gl.isExtensionAvailable(NVX_EXT_ID)) { + IntBuffer tmp = IntBuffer.allocate(1); + + tmp.rewind(); + gl.glGetIntegerv(GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, tmp); + tmp.rewind(); + int nvxTotalAvailableMem = tmp.get(); + + tmp.rewind(); + gl.glGetIntegerv(GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, tmp); + tmp.rewind(); + int nvxCurrentAvailableMem = tmp.get(); + + tmp.rewind(); + gl.glGetIntegerv(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, tmp); + tmp.rewind(); + int nvxDedicatedMem = tmp.get(); + + tmp.rewind(); + gl.glGetIntegerv(GPU_MEMORY_INFO_EVICTION_COUNT_NVX, tmp); + tmp.rewind(); + int nvxEvictionCount = tmp.get(); + + tmp.rewind(); + gl.glGetIntegerv(GPU_MEMORY_INFO_EVICTED_MEMORY_NVX, tmp); + tmp.rewind(); + int nvxEvictionMem = tmp.get(); + + int nvxPercent = (nvxTotalAvailableMem - nvxCurrentAvailableMem) + * 100 / nvxTotalAvailableMem; + + output.append(String.format( + " * GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = %dMB\n", + nvxDedicatedMem / 1024)); + output.append(String.format( + " * GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = %dMB\n", + nvxTotalAvailableMem / 1024)); + output.append(String.format( + " * GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = %dMB\n", + nvxCurrentAvailableMem / 1024)); + output.append(String.format( + " * GPU_MEMORY_INFO_EVICTION_COUNT_NVX = %d\n", + nvxEvictionCount)); + output.append(String.format( + " * GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = %dMB\n", + nvxEvictionMem / 1024)); + output.append(String.format(" * NVX percent = %d%%\n", nvxPercent)); + + int evictions = nvxEvictionCount - lastNvxEvictionCount; + lastNvxEvictionCount = nvxEvictionCount; + return nvxPercent > MEM_PRINT_THRESHOLD_PERCENT || evictions > 0; + } + return false; + } + + // The ATI version is untested as I don't have an ATI GPU. + protected static boolean getAtiStats(GL gl, StringBuilder output) { + if (gl.isExtensionAvailable(ATI_EXT_ID)) { + IntBuffer tmp = IntBuffer.allocate(4); + gl.glGetIntegerv(VBO_FREE_MEMORY_ATI, tmp); + tmp.rewind(); + int vboTotal = tmp.get(); + int vboLargest = tmp.get(); + int vboTotalAux = tmp.get(); + int vboLargestAux = tmp.get(); + + tmp.rewind(); + gl.glGetIntegerv(TEXTURE_FREE_MEMORY_ATI, tmp); + tmp.rewind(); + int texTotal = tmp.get(); + int texLargest = tmp.get(); + int texTotalAux = tmp.get(); + int texLargestAux = tmp.get(); + + tmp.rewind(); + gl.glGetIntegerv(RENDERBUFFER_FREE_MEMORY_ATI, tmp); + tmp.rewind(); + int rbTotal = tmp.get(); + int rbLargest = tmp.get(); + int rbTotalAux = tmp.get(); + int rbLargestAux = tmp.get(); + + output.append(String.format(" * VBO_FREE_MEMORY total: %dMB\n", + vboTotal / 1024)); + output.append(String.format(" * VBO_FREE_MEMORY largest: %dMB\n", + vboLargest / 1024)); + output.append(String.format(" * VBO_FREE_MEMORY total aux: %dMB\n", + vboTotalAux / 1024)); + output.append(String.format( + " * VBO_FREE_MEMORY largest aux: %dMB\n", + vboLargestAux / 1024)); + output.append(String.format(" * TEXTURE_FREE_MEMORY total: %dMB\n", + texTotal / 1024)); + output.append(String + .format(" * TEXTURE_FREE_MEMORY largest: %dMB\n", + texLargest / 1024)); + output.append(String.format( + " * TEXTURE_FREE_MEMORY total aux: %dMB\n", + texTotalAux / 1024)); + output.append(String.format( + " * TEXTURE_FREE_MEMORY largest aux: %dMB\n", + texLargestAux / 1024)); + output.append(String + .format(" * RENDERBUFFER_FREE_MEMORY total: %dMB\n", + rbTotal / 1024)); + output.append(String.format( + " * RENDERBUFFER_FREE_MEMORY largest: %dMB\n", + rbLargest / 1024)); + output.append(String.format( + " * RENDERBUFFER_FREE_MEMORY total aux: %dMB\n", + rbTotalAux / 1024)); + output.append(String.format( + " * RENDERBUFFER_FREE_MEMORY largest aux: %dMB\n", + rbLargestAux / 1024)); + + // I think this will print output if we have less that 10MB free for + // any chunk of memory + return vboTotal < 10240 || texTotal < 10240 || rbTotal < 10240; + } + return false; + } + +} diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLDelegateImage.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLDelegateImage.java index dfd6a56c41..36948913b1 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLDelegateImage.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLDelegateImage.java @@ -173,4 +173,10 @@ public class GLDelegateImage extends AbstractGLImage image.usaAsFrameBuffer(); } + @Override + public void dispose() { + super.dispose(); + image.dispose(); + } + } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLImage.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLImage.java index 28d71155c4..56be9e488d 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLImage.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLImage.java @@ -71,7 +71,8 @@ public class GLImage extends AbstractGLImage implements IImageCacheable { protected int size; - public GLImage(IRenderedImageCallback preparer, Class extensionClass) { + public GLImage(IRenderedImageCallback preparer, + Class extensionClass) { super(extensionClass); theTexture = null; this.imagePreparer = preparer; @@ -198,8 +199,7 @@ public class GLImage extends AbstractGLImage implements IImageCacheable { fromRenderedToBuffered(rendImg), false); } - this.size = rendImg.getHeight() * rendImg.getWidth() * 4 - * rendImg.getColorModel().getNumColorComponents(); + this.size = rendImg.getHeight() * rendImg.getWidth() * 4; return true; } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java index df9dc5e765..4e00c74406 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java @@ -81,6 +81,7 @@ import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.preferences.PreferenceConstants; import com.raytheon.viz.core.gl.GLContextBridge; import com.raytheon.viz.core.gl.GLDisposalManager; +import com.raytheon.viz.core.gl.GLStats; import com.raytheon.viz.core.gl.IGLFont; import com.raytheon.viz.core.gl.IGLTarget; import com.raytheon.viz.core.gl.glsl.GLSLFactory; @@ -1079,6 +1080,8 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { GLDisposalManager.performDispose(GLU.getCurrentGL()); + GLStats.printStats(gl); + GLContextBridge.releaseMasterContext(); releaseContext(); } @@ -1378,7 +1381,7 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { } if (needsRelease) { - releaseContext(); + releaseContext(); } return bi; } @@ -2307,96 +2310,6 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { } } - protected void printMemoryInformation() { - if (gl.isExtensionAvailable("GL_NVX_gpu_memory_info")) { - int GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; - int GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; - int GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; - int GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; - int GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; - - System.out - .println("----------------NVIDIA GPU memory info -----------------"); - IntBuffer tmp = IntBuffer.allocate(1); - gl.glGetIntegerv(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, tmp); - tmp.rewind(); - int totalMem = tmp.get(); - System.out.println("DEDICATED_VIDMEM: " + totalMem + "KB"); - tmp.rewind(); - gl.glGetIntegerv(GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, tmp); - tmp.rewind(); - int totAvailMem = tmp.get(); - System.out.println("TOTAL_AVAILABLE_MEMORY: " + totAvailMem + "KB"); - tmp.rewind(); - gl.glGetIntegerv(GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, tmp); - tmp.rewind(); - int curAvailMem = tmp.get(); - System.out.println("CURRENT_AVAILABLE_VIDMEM: " + curAvailMem - + "KB"); - tmp.rewind(); - gl.glGetIntegerv(GPU_MEMORY_INFO_EVICTION_COUNT_NVX, tmp); - tmp.rewind(); - int evictCount = tmp.get(); - System.out.println("INFO_EVICTION_COUNT: " + evictCount); - tmp.rewind(); - gl.glGetIntegerv(GPU_MEMORY_INFO_EVICTED_MEMORY_NVX, tmp); - tmp.rewind(); - int evictMem = tmp.get(); - System.out.println("INFO_EVICTED_MEMORY: " + evictMem + "KB"); - } else if (false && gl.isExtensionAvailable("GL_ATI_meminfo")) { - // TODO this is untested, I have no ATI gpu - int VBO_FREE_MEMORY_ATI = 0x87FB; - int TEXTURE_FREE_MEMORY_ATI = 0x87FC; - int RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; - - System.out - .println("----------------ATI GPU memory info -----------------"); - IntBuffer tmp = IntBuffer.allocate(4); - gl.glGetIntegerv(VBO_FREE_MEMORY_ATI, tmp); - tmp.rewind(); - int vboTotal = tmp.get(); - int vboLargest = tmp.get(); - int vboTotalAux = tmp.get(); - int vboLargestAux = tmp.get(); - System.out.println("VBO_FREE_MEMORY total: " + vboTotal + "KB"); - System.out.println("VBO_FREE_MEMORY largest: " + vboLargest + "KB"); - System.out.println("VBO_FREE_MEMORY total aux: " + vboTotalAux - + "KB"); - System.out.println("VBO_FREE_MEMORY largest auc: " + vboLargestAux - + "KB"); - tmp.rewind(); - gl.glGetIntegerv(TEXTURE_FREE_MEMORY_ATI, tmp); - tmp.rewind(); - int texTotal = tmp.get(); - int texLargest = tmp.get(); - int texTotalAux = tmp.get(); - int texLargestAux = tmp.get(); - System.out.println("TEXTURE_FREE_MEMORY total: " + texTotal + "KB"); - System.out.println("TEXTURE_FREE_MEMORY largest: " + texLargest - + "KB"); - System.out.println("TEXTURE_FREE_MEMORY total aux: " + texTotalAux - + "KB"); - System.out.println("TEXTURE_FREE_MEMORY largest auc: " - + texLargestAux + "KB"); - tmp.rewind(); - gl.glGetIntegerv(RENDERBUFFER_FREE_MEMORY_ATI, tmp); - tmp.rewind(); - int rbTotal = tmp.get(); - int rbLargest = tmp.get(); - int rbTotalAux = tmp.get(); - int rbLargestAux = tmp.get(); - System.out.println("RENDERBUFFER_FREE_MEMORY total: " + rbTotal - + "KB"); - System.out.println("RENDERBUFFER_FREE_MEMORY largest: " + rbLargest - + "KB"); - System.out.println("RENDERBUFFER_FREE_MEMORY total aux: " - + rbTotalAux + "KB"); - System.out.println("RENDERBUFFER_FREE_MEMORY largest auc: " - + rbLargestAux + "KB"); - - } - } - @Override public final T getExtension( Class extensionClass) throws VizException { diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java index 74a0b82adc..b2eea71758 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/rsc/hdf5/AbstractTileSet.java @@ -584,7 +584,9 @@ public abstract class AbstractTileSet implements IRenderable, IMeshCallback { } } if (tileSet != null) { - tileSet.dispose(); + synchronized (tileSet) { + tileSet.dispose(); + } } imageMap.clear(); for (CreateTileJob job : jobMap.values()) { @@ -678,7 +680,9 @@ public abstract class AbstractTileSet implements IRenderable, IMeshCallback { } if (tileSet != null) { - tileSet.dispose(); + synchronized (tileSet) { + tileSet.dispose(); + } } tileSet = new ImageTileList(); synchronized (tileSet) { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/AbstractParmManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/AbstractParmManager.java index 570ebe08a1..5028cb0c88 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/AbstractParmManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/AbstractParmManager.java @@ -21,6 +21,7 @@ package com.raytheon.viz.gfe.core.internal; import java.io.File; import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -31,6 +32,7 @@ import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Set; +import java.util.TimeZone; import org.eclipse.core.runtime.ListenerList; @@ -104,6 +106,13 @@ public abstract class AbstractParmManager implements IParmManager { private static final int NOTIFICATION_THREADS = 4; + private static final SimpleDateFormat dateFormat = new SimpleDateFormat( + DatabaseID.MODEL_TIME_FORMAT); + + static { + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + } + protected class ParmIDVis { private ParmID pid; @@ -469,8 +478,8 @@ public abstract class AbstractParmManager implements IParmManager { if (string.length() - pos == 14) { try { dtg = string.substring(pos + 1); - synchronized (DatabaseID.dateFormat) { - DatabaseID.dateFormat.parse(dtg); + synchronized (dateFormat) { + dateFormat.parse(dtg); } } catch (ParseException e) { return null; diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java index ddcdb38307..e737cff453 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java @@ -364,6 +364,10 @@ public class GFEColorbarResource extends if (container != null) { container.registerMouseHandler(handler, InputPriority.PERSPECTIVE); } + + if (currentParm != null) { + currentParm.getListeners().addPickupValueChangedListener(this); + } } /* diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/AbstractMapVectorResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/AbstractMapVectorResource.java index bcafc835ae..796c51a53d 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/AbstractMapVectorResource.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/AbstractMapVectorResource.java @@ -22,6 +22,7 @@ package com.raytheon.viz.grid.rsc; import java.io.FileNotFoundException; import java.nio.FloatBuffer; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -129,7 +130,7 @@ public abstract class AbstractMapVectorResource extends protected boolean retrievedAllData = false; - private Map dataObjectMap; + protected Map dataObjectMap; protected String uuid; @@ -330,7 +331,7 @@ public abstract class AbstractMapVectorResource extends this.vcrManagerJob = new VectorContourRenderableManagerJob(); this.gdManagerJob = new GriddedDisplayManagerJob(); - setDataObjectMap(new HashMap()); + dataObjectMap = new HashMap(); uuid = UUID.randomUUID().toString(); resourceData.addChangeListener(new IResourceDataChanged() { @Override @@ -841,8 +842,9 @@ public abstract class AbstractMapVectorResource extends this.gdManagerJob.shutdown(); this.gdManagerJob.disposeInternal(); } - - getDataObjectMap().clear(); + synchronized (dataObjectMap) { + dataObjectMap.clear(); + } retrievedAllData = false; } @@ -984,7 +986,9 @@ public abstract class AbstractMapVectorResource extends */ @Override public void remove(DataTime dataTime) { - this.getDataObjectMap().remove(dataTime); + synchronized (dataObjectMap) { + dataObjectMap.remove(dataTime); + } this.vcrManagerJob.removeDataTime(dataTime); this.gdManagerJob.removeDataTime(dataTime); recreateDataTimes(); @@ -994,8 +998,8 @@ public abstract class AbstractMapVectorResource extends * Recreate all the datatimes from the objects */ protected void recreateDataTimes() { - this.dataTimes = new ArrayList(getDataObjectMap().size()); - dataTimes.addAll(this.getDataObjectMap().keySet()); + this.dataTimes = new ArrayList(this.getDataObjectMap() + .keySet()); } public void addRecord(PluginDataObject record) throws VizException { @@ -1008,7 +1012,9 @@ public abstract class AbstractMapVectorResource extends + record.getClass().getName()); } DataTime dt = record.getDataTime(); - getDataObjectMap().put(dt, record); + synchronized (dataObjectMap) { + dataObjectMap.put(dt, record); + } if (this.retrievedAllData) { this.addJobRequest(dt); @@ -1062,17 +1068,20 @@ public abstract class AbstractMapVectorResource extends this.styleRule = styleRule; } - public synchronized Map getDataObjectMap() { - return dataObjectMap; - } - /** - * @param dataObjectMap - * the dataObjectMap to set + * Get a copy of dataObjectMap, this copy is safe to use without + * synchronizing, if you need to modify the dataObjectMap, use the field + * directly and synchronize on it. + * + * @return */ - protected synchronized void setDataObjectMap( - Map dataObjectMap) { - this.dataObjectMap = dataObjectMap; + protected Map getDataObjectMap() { + if (dataObjectMap == null) { + return Collections.emptyMap(); + } + synchronized (dataObjectMap) { + return new HashMap(dataObjectMap); + } } public synchronized DataTime getDisplayedDataTime() { diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java index 91cf3c97ca..a2018fce3e 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java @@ -23,7 +23,6 @@ import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -199,6 +198,14 @@ public class GridResource extends private StyleRule styleRule; + /** + * The great protector of all things related to dataTimes, do not modify or + * iterate over pdosToParse, dataTimes, or tileSet unless you sync on this + * or else... + * + */ + protected Object timeLock = new Object(); + /** * Extends the MemoryBasedTileSet class so that we can have direct access to * the loadedData @@ -585,12 +592,14 @@ public class GridResource extends GribRecord[] records = resourceData.getRecords(); GribRecord emptyRecord = new GribRecord(); - for (int i = 0; i < records.length; i++) { - if (emptyRecord.equals(records[i])) { - // Don't add empty records - continue; + synchronized (timeLock) { + for (int i = 0; i < records.length; i++) { + if (emptyRecord.equals(records[i])) { + // Don't add empty records + continue; + } + pdosToParse.add(records[i]); } - pdosToParse.add(records[i]); } if (resourceData.getNameGenerator() == null) { @@ -660,14 +669,16 @@ public class GridResource extends mbts = createTileSet(record, lvlSet, levelConverter); mbts.setMapDescriptor(descriptor); - Set dateSet = tileSet.keySet(); - dataTimes.clear(); - Iterator dateIterator = dateSet.iterator(); - while (dateIterator.hasNext()) { - dataTimes.add(dateIterator.next()); - } + synchronized (timeLock) { + Set dateSet = tileSet.keySet(); + dataTimes.clear(); + Iterator dateIterator = dateSet.iterator(); + while (dateIterator.hasNext()) { + dataTimes.add(dateIterator.next()); + } - Collections.sort(dataTimes); + Collections.sort(dataTimes); + } levels = new SingleLevel[lvlSet.size()]; Iterator lvlIterator = lvlSet.iterator(); @@ -685,12 +696,14 @@ public class GridResource extends Set lvlSet, UnitConverter levelConverter) throws VizException { DataTime dataTime = record.getDataTime(); - Map tilemap = tileSet.get(dataTime); - if (tilemap == null) { - tilemap = new HashMap(); - tileSet.put(dataTime, tilemap); + Map tilemap = null; + synchronized (timeLock) { + tilemap = tileSet.get(dataTime); + if (tilemap == null) { + tilemap = new HashMap(); + tileSet.put(dataTime, tilemap); + } } - float convertedLevel = (float) levelConverter.convert(record .getModelInfo().getLevelOneValue()); @@ -776,116 +789,109 @@ public class GridResource extends */ @Override protected void disposeInternal() { - - for (Map.Entry> set : tileSet - .entrySet()) { - for (Map.Entry tile : set.getValue() + synchronized (timeLock) { + for (Map.Entry> set : tileSet .entrySet()) { - tile.getValue().dispose(); + for (Map.Entry tile : set + .getValue().entrySet()) { + tile.getValue().dispose(); + } } } } @Override protected void initInternal(IGraphicsTarget target) throws VizException { - this.target = target; + synchronized (timeLock) { + this.target = target; - synchronized (pdosToParse) { if (pdosToParse.size() > 0) { for (PluginDataObject pdo : pdosToParse) { createTile(pdo); } pdosToParse.clear(); } - } - boolean combineResources = combineOperation != CombineOperation.NONE; + boolean combineResources = combineOperation != CombineOperation.NONE; - viewType = target.getViewType(); - Map> combinedSet = new HashMap>(); - for (Map.Entry baseTileEntry : baseTiles - .entrySet()) { - GridMemoryBasedTileSet baseTile = baseTileEntry.getValue(); - baseTile.setMapDescriptor(descriptor); - baseTile.init(target); - if (combineResources && !baseTile.isCombined()) { - Entry tileSetRef = null; - // Need to find the reference in order to update the object when - // it comes back as a new combined object - for (Map.Entry> set : tileSet - .entrySet()) { - for (Map.Entry tile : set - .getValue().entrySet()) { - if (tile.getValue().getDataTime() - .equals(baseTile.getDataTime())) { - tileSetRef = tile; + viewType = target.getViewType(); + Map> combinedSet = new HashMap>(); + for (Map.Entry baseTileEntry : baseTiles + .entrySet()) { + GridMemoryBasedTileSet baseTile = baseTileEntry.getValue(); + baseTile.setMapDescriptor(descriptor); + baseTile.init(target); + if (combineResources && !baseTile.isCombined()) { + Entry tileSetRef = null; + // Need to find the reference in order to update the object + // when + // it comes back as a new combined object + for (Map.Entry> set : tileSet + .entrySet()) { + for (Map.Entry tile : set + .getValue().entrySet()) { + if (tile.getValue().getDataTime() + .equals(baseTile.getDataTime())) { + tileSetRef = tile; + break; + } + } + if (tileSetRef != null) { break; } } + + GridMemoryBasedTileSet combinedResourceData = combineResourceData(baseTile); if (tileSetRef != null) { - break; + tileSetRef.setValue(combinedResourceData); } - } - GridMemoryBasedTileSet combinedResourceData = combineResourceData(baseTile); - if (tileSetRef != null) { - tileSetRef.setValue(combinedResourceData); + baseTileEntry.setValue(combinedResourceData); } - - baseTileEntry.setValue(combinedResourceData); } - } - DataTime[] primaryDataTimes = descriptor.getTimeMatchingMap().get(this); - for (int i = 0; i < primaryDataTimes.length; i++) { - Map map = tileSet - .get(primaryDataTimes[i]); - if (map != null) { - for (Map.Entry tile : map - .entrySet()) { - if (baseTiles.values().contains(tile.getValue())) { - if (combineResources) { + DataTime[] primaryDataTimes = descriptor.getTimeMatchingMap().get( + this); + for (int i = 0; i < primaryDataTimes.length; i++) { + Map map = tileSet + .get(primaryDataTimes[i]); + if (map != null) { + for (Map.Entry tile : map + .entrySet()) { + if (baseTiles.values().contains(tile.getValue())) { + if (combineResources) { + Map map2 = new HashMap(); + map2.put(tile.getKey(), tile.getValue()); + combinedSet.put(primaryDataTimes[i], map2); + } + continue; + } + + tile.getValue().init(target); + + if (!tile.getValue().isCombined()) { + GridMemoryBasedTileSet combinedResourceData = combineResourceData(tile + .getValue()); Map map2 = new HashMap(); - map2.put(tile.getKey(), tile.getValue()); + map2.put(tile.getKey(), combinedResourceData); combinedSet.put(primaryDataTimes[i], map2); } - continue; - } - - tile.getValue().init(target); - - if (!tile.getValue().isCombined()) { - GridMemoryBasedTileSet combinedResourceData = combineResourceData(tile - .getValue()); - Map map2 = new HashMap(); - map2.put(tile.getKey(), combinedResourceData); - combinedSet.put(primaryDataTimes[i], map2); } } } - } - if (!combinedSet.isEmpty()) { - tileSet = combinedSet; - List newDataTimes = new ArrayList(); + if (!combinedSet.isEmpty()) { + tileSet = combinedSet; + List newDataTimes = new ArrayList(); - for (Entry> entry : combinedSet - .entrySet()) { - newDataTimes.add(entry.getKey()); + for (Entry> entry : combinedSet + .entrySet()) { + newDataTimes.add(entry.getKey()); + } + Collections.sort(newDataTimes); + dataTimes = newDataTimes; } - Collections.sort(newDataTimes, dataTime); - dataTimes = newDataTimes; } } - /** - * DataTime Comparator - */ - private static Comparator dataTime = new Comparator() { - @Override - public int compare(DataTime arg0, DataTime arg1) { - return arg0.compareTo(arg1); - } - }; - /** * Combine the given tiles sets * @@ -1227,11 +1233,13 @@ public class GridResource extends @Override public void setDescriptor(MapDescriptor descriptor) { this.descriptor = descriptor; - for (Map.Entry> set : tileSet - .entrySet()) { - for (Map.Entry tile : set.getValue() + synchronized (timeLock) { + for (Map.Entry> set : tileSet .entrySet()) { - tile.getValue().setMapDescriptor(this.descriptor); + for (Map.Entry tile : set + .getValue().entrySet()) { + tile.getValue().setMapDescriptor(this.descriptor); + } } } } @@ -1248,22 +1256,24 @@ public class GridResource extends } } if (reproject) { - // If we are reprojecting to screen space, clear all tiles - for (Map.Entry> set : tileSet - .entrySet()) { - for (Map.Entry tile : set - .getValue().entrySet()) { - tile.getValue().dispose(); - pdosToParse.add(tile.getValue().getPluginDataObject()); + synchronized (timeLock) { + // If we are reprojecting to screen space, clear all tiles + for (Map.Entry> set : tileSet + .entrySet()) { + for (Map.Entry tile : set + .getValue().entrySet()) { + tile.getValue().dispose(); + pdosToParse.add(tile.getValue().getPluginDataObject()); + } } - } - tileSet.clear(); - baseTiles.clear(); - if (pdosToParse.size() > 0) { - for (PluginDataObject pdo : pdosToParse) { - createTile(pdo); + tileSet.clear(); + baseTiles.clear(); + if (pdosToParse.size() > 0) { + for (PluginDataObject pdo : pdosToParse) { + createTile(pdo); + } + pdosToParse.clear(); } - pdosToParse.clear(); } } else { for (GridMemoryBasedTileSet tile : baseTiles.values()) { @@ -1463,41 +1473,44 @@ public class GridResource extends @Override public void remove(DataTime dataTime) { - Map ts = tileSet.remove(dataTime); - if (ts == null) { - return; - } + synchronized (timeLock) { + Map ts = tileSet.remove(dataTime); + if (ts == null) { + return; + } - for (Map.Entry tile : ts.entrySet()) { - tile.getValue().dispose(); - } - Set dateSet = tileSet.keySet(); - dataTimes.clear(); - Iterator dateIterator = dateSet.iterator(); - while (dateIterator.hasNext()) { - dataTimes.add(dateIterator.next()); - } - - Collections.sort(dataTimes); + for (Map.Entry tile : ts.entrySet()) { + tile.getValue().dispose(); + } + Set dateSet = tileSet.keySet(); + dataTimes.clear(); + Iterator dateIterator = dateSet.iterator(); + while (dateIterator.hasNext()) { + dataTimes.add(dateIterator.next()); + } + Collections.sort(dataTimes); + } } @Override public void resourceChanged(ChangeType type, Object object) { if (type.equals(ChangeType.DATA_UPDATE)) { PluginDataObject[] pdos = (PluginDataObject[]) object; + synchronized (timeLock) { + for (PluginDataObject pdo : pdos) { - for (PluginDataObject pdo : pdos) { - - if (pdo != null) { - if (CombineOperation.DIFFERENCE.equals(combineOperation) - && !(pdo instanceof CombinedGribRecord)) { - // Do nothing, timematcher will take care of it. - } else { - if (target != null) { - createTile(pdo); + if (pdo != null) { + if (CombineOperation.DIFFERENCE + .equals(combineOperation) + && !(pdo instanceof CombinedGribRecord)) { + // Do nothing, timematcher will take care of it. } else { - pdosToParse.add(pdo); + if (target != null) { + createTile(pdo); + } else { + pdosToParse.add(pdo); + } } } } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java index e1dfd8b3cf..26fcd0bbf3 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java @@ -41,7 +41,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.RecordFactory; import com.raytheon.uf.viz.core.catalog.LayerProperty; import com.raytheon.uf.viz.core.catalog.ScriptCreator; @@ -370,10 +369,7 @@ public class PointDataCubeAdapter implements IDataCubeAdapter { throws VizException { TimeQueryRequestSet set = new TimeQueryRequestSet(); set.setRequests(requests.toArray(new TimeQueryRequest[0])); - // boundary for time queries - for (TimeQueryRequest req: set.getRequests()) { - req.setSimDate(SimulatedTime.getSystemTime().getTime()); - } + @SuppressWarnings("unchecked") List> result = (List>) ThriftClient .sendRequest(set); diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarDataCubeAdapter.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarDataCubeAdapter.java index 56498ad09d..b3cc9cd596 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarDataCubeAdapter.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarDataCubeAdapter.java @@ -121,24 +121,25 @@ public class RadarDataCubeAdapter extends PointDataCubeAdapter { DbQueryResponse response, boolean latestOnly, BinOffset binOffset) { String dataTimefield = DATA_TIME_FIELD; if (latestOnly) { - dataTimefield = LATEST_DATA_TIME_FIELD; - } - Collection results = new HashSet(); - int i = 0; - for (Map map : response.getResults()) { - DataTime time = null; - if (latestOnly) { - time = new DataTime((Date) map.get(dataTimefield), 0); - } else { - time = (DataTime) map.get(dataTimefield); - time.setLevelValue((Double) map.get(LEVEL_FIELD)); - } - // Best res requests need this because they span a time period - if (time.getRefTime().before(SimulatedTime.getSystemTime().getTime())) { - results.add(time); - ++i; - } - } + dataTimefield = LATEST_DATA_TIME_FIELD; + } + Collection results = new HashSet(); + int i = 0; + for (Map map : response.getResults()) { + DataTime time = null; + if (latestOnly) { + time = new DataTime((Date) map.get(dataTimefield), 0); + } else { + time = (DataTime) map.get(dataTimefield); + time.setLevelValue((Double) map.get(LEVEL_FIELD)); + } + // Best res requests need this because they span a time period + if (time.getRefTime().before( + SimulatedTime.getSystemTime().getTime())) { + results.add(time); + ++i; + } + } if (binOffset != null) { Set scaledDates = new TreeSet(); @@ -173,7 +174,6 @@ public class RadarDataCubeAdapter extends PointDataCubeAdapter { List dbRequests = new ArrayList( requests.size()); for (TimeQueryRequest request : requests) { - request.setSimDate(SimulatedTime.getSystemTime().getTime()); dbRequests.add(getTimeQueryRequest(request.getQueryTerms(), request.isMaxQuery())); } @@ -188,9 +188,7 @@ public class RadarDataCubeAdapter extends PointDataCubeAdapter { TimeQueryRequest request = requests.get(i); Collection times = processTimeQueryResponse(response, request.isMaxQuery(), request.getBinOffset()); - - - + result.add(new ArrayList(times)); } return result; diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/SatelliteDataCubeAdapter.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/SatelliteDataCubeAdapter.java index 914da912a7..6ce7ea4017 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/SatelliteDataCubeAdapter.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/SatelliteDataCubeAdapter.java @@ -58,7 +58,6 @@ import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.HDF5Util; import com.raytheon.uf.viz.core.catalog.CatalogQuery; import com.raytheon.uf.viz.core.catalog.LayerProperty; @@ -465,7 +464,6 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter { List baseRequests = new ArrayList( requests.size()); for (TimeQueryRequest request : requests) { - request.setSimDate(SimulatedTime.getSystemTime().getTime()); if (!request.getQueryTerms().containsKey("DERIVED")) { baseRequests.add(request); } else { @@ -543,7 +541,6 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter { DerivParamField field = (DerivParamField) ifield; TimeQueryRequest newRequest = new TimeQueryRequest(); newRequest.setBinOffset(binOffset); - newRequest.setSimDate(SimulatedTime.getSystemTime().getTime()); newRequest.setMaxQuery(false); newRequest.setQueryTerms(modifyQuery(queryParams, field)); newRequest.setPluginName("satellite"); diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java index 9e2cd51240..8af95b2dbf 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java @@ -917,11 +917,8 @@ public class GFEDao extends DefaultPluginDao { for (int i = 0; i < result.getResultCount(); i++) { DatabaseID dbId = null; - synchronized (DatabaseID.dateFormat) { - dbId = new DatabaseID(siteID, DataType.GRID, "D2D", gfeModel, - DatabaseID.dateFormat.format(result.getRowColumnValue( - i, 0))); - } + dbId = new DatabaseID(siteID, DataType.GRID, "D2D", gfeModel, + (Date) result.getRowColumnValue(i, 0)); if (!dbInventory.contains(dbId)) { dbInventory.add(dbId); } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/GfeIngestNotificationFilter.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/GfeIngestNotificationFilter.java index 290660fd8a..c3f112a45f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/GfeIngestNotificationFilter.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/GfeIngestNotificationFilter.java @@ -113,8 +113,7 @@ public class GfeIngestNotificationFilter { // ignore if no mapping if (gfeModel != null && gfeModel.length() > 0) { DatabaseID dbId = new DatabaseID(site, DataType.GRID, - "D2D", gfeModel, DatabaseID.dateFormat.format(grib - .getDataTime().getRefTime())); + "D2D", gfeModel, grib.getDataTime().getRefTime()); if ((!D2DParmIdCache.getInstance().getDatabaseIDs() .contains(dbId)) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/InitModules.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/InitModules.java index b7705f3230..b9749fd078 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/InitModules.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/InitModules.java @@ -19,7 +19,6 @@ **/ package com.raytheon.edex.plugin.gfe.smartinit; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -55,9 +54,6 @@ public class InitModules { private static final Log logger = LogFactory.getLog(InitModules.class); - public static final SimpleDateFormat dateFormat = (SimpleDateFormat) DatabaseID.dateFormat - .clone(); - // Counter used to simply force one full model run to complete a smart init // before another when many inits started at once private static long manualOffset = 0; diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/SmartInitRecordPK.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/SmartInitRecordPK.java index cb0faafe0b..0fa5d4ad37 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/SmartInitRecordPK.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/SmartInitRecordPK.java @@ -20,7 +20,9 @@ package com.raytheon.edex.plugin.gfe.smartinit; import java.io.Serializable; +import java.text.SimpleDateFormat; import java.util.Date; +import java.util.TimeZone; import javax.persistence.Column; import javax.persistence.Embeddable; @@ -28,6 +30,7 @@ import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Transient; +import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -56,6 +59,13 @@ public class SmartInitRecordPK implements ISerializableObject, Serializable, private static final long serialVersionUID = 1L; + private static final SimpleDateFormat dateFormat = new SimpleDateFormat( + DatabaseID.MODEL_TIME_FORMAT); + + static { + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + } + public enum State { PENDING, RUNNING }; @@ -139,28 +149,37 @@ public class SmartInitRecordPK implements ISerializableObject, Serializable, @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } SmartInitRecordPK other = (SmartInitRecordPK) obj; if (initName == null) { - if (other.initName != null) + if (other.initName != null) { return false; - } else if (!initName.equals(other.initName)) + } + } else if (!initName.equals(other.initName)) { return false; + } if (state == null) { - if (other.state != null) + if (other.state != null) { return false; - } else if (!state.equals(other.state)) + } + } else if (!state.equals(other.state)) { return false; + } if (validTime == null) { - if (other.validTime != null) + if (other.validTime != null) { return false; - } else if (!validTime.equals(other.validTime)) + } + } else if (!validTime.equals(other.validTime)) { return false; + } return true; } @@ -170,8 +189,8 @@ public class SmartInitRecordPK implements ISerializableObject, Serializable, tmp.append(initName); tmp.append(" ValidTime: "); if (validTime != null) { - synchronized (InitModules.dateFormat) { - tmp.append(InitModules.dateFormat.format(validTime)); + synchronized (dateFormat) { + tmp.append(dateFormat.format(validTime)); } } else { tmp.append("null"); diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscExtract.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscExtract.py index 4c9aa8138c..6f93d4ec32 100755 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscExtract.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscExtract.py @@ -36,12 +36,10 @@ from java.util import ArrayList from com.raytheon.edex.plugin.gfe.config import IFPServerConfig from com.raytheon.edex.plugin.gfe.config import IFPServerConfigManager from com.raytheon.edex.plugin.gfe.util import CartDomain2D -from com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID from com.raytheon.uf.common.dataplugin.gfe.db.objects import GridLocation from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType -from com.raytheon.uf.common.dataplugin.gfe.util import GfeUtil from com.vividsolutions.jts.geom import Coordinate diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.java index ffe9888f79..6232a5fcac 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.java @@ -74,7 +74,7 @@ public class DatabaseID implements Serializable, Comparable, public static final String MODEL_TIME_FORMAT = "yyyyMMdd_HHmm"; - public static final SimpleDateFormat dateFormat = new SimpleDateFormat( + private static final SimpleDateFormat dateFormat = new SimpleDateFormat( MODEL_TIME_FORMAT); static { @@ -150,7 +150,14 @@ public class DatabaseID implements Serializable, Comparable, */ public DatabaseID(String siteId, DataType format, String dbType, String modelName, Date modelTime) { - this(siteId, format, dbType, modelName, dateFormat.format(modelTime)); + this.siteId = siteId; + this.format = format; + this.dbType = dbType; + this.modelName = modelName; + synchronized (dateFormat) { + this.modelTime = dateFormat.format(modelTime); + } + encodeIdentifier(); } /** @@ -345,10 +352,15 @@ public class DatabaseID implements Serializable, Comparable, } private boolean decodeDtg(String dtgString) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmm"); + if (dtgString == null + || dtgString.length() != MODEL_TIME_FORMAT.length()) { + return false; + } try { - Date date = sdf.parse(dtgString); - modelTime = sdf.format(date); + synchronized (dateFormat) { + dateFormat.parse(dtgString); + } + modelTime = dtgString; } catch (ParseException e) { return false; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/util/GfeUtil.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/util/GfeUtil.java index c03d5b320a..c4bb99d6ec 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/util/GfeUtil.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/util/GfeUtil.java @@ -209,21 +209,6 @@ public class GfeUtil { return new File(hdf5DirPath); } - /** - * Converts a calendar to a model time used by DatabaseID - * - * @param refTime - * The model time as a calendar - * @return The string representation of the model time for use with - * DatabaseID - */ - public static String modelTimeToString(Calendar refTime) { - Date time = refTime.getTime(); - synchronized (DatabaseID.dateFormat) { - return DatabaseID.dateFormat.format(time); - } - } - /** * Puts a specified data into GMT * diff --git a/edexOsgi/com.raytheon.uf.common.dataquery/src/com/raytheon/uf/common/dataquery/requests/TimeQueryRequest.java b/edexOsgi/com.raytheon.uf.common.dataquery/src/com/raytheon/uf/common/dataquery/requests/TimeQueryRequest.java index 0cf4c83020..71d8f8c070 100644 --- a/edexOsgi/com.raytheon.uf.common.dataquery/src/com/raytheon/uf/common/dataquery/requests/TimeQueryRequest.java +++ b/edexOsgi/com.raytheon.uf.common.dataquery/src/com/raytheon/uf/common/dataquery/requests/TimeQueryRequest.java @@ -26,6 +26,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.comm.IServerRequest; import com.raytheon.uf.common.time.BinOffset; +import com.raytheon.uf.common.time.SimulatedTime; /** * Request to query available times. A bin offset can be included and will be @@ -48,6 +49,10 @@ import com.raytheon.uf.common.time.BinOffset; @DynamicSerialize public class TimeQueryRequest implements IServerRequest { + public TimeQueryRequest() { + this.simDate = SimulatedTime.getSystemTime().getTime(); + } + @DynamicSerializeElement private String pluginName; diff --git a/rpms/awips2.cave/setup/scripts/prepare_dist.sh b/rpms/awips2.cave/setup/scripts/prepare_dist.sh index 1f975fa651..529ef06f78 100644 --- a/rpms/awips2.cave/setup/scripts/prepare_dist.sh +++ b/rpms/awips2.cave/setup/scripts/prepare_dist.sh @@ -33,7 +33,7 @@ fi # Execute the CAVE PDE Build. # The Sun JDK Build. -time ./build.sh -eclipse=/opt/uframe-eclipse +time /bin/bash build.sh -eclipse=/opt/uframe-eclipse RC=$? if [ ${RC} -ne 0 ]; then diff --git a/rpms/awips2.edex/Installer.edex-shapefiles/component.spec b/rpms/awips2.edex/Installer.edex-shapefiles/component.spec index 56bafac73c..01ea8de934 100644 --- a/rpms/awips2.edex/Installer.edex-shapefiles/component.spec +++ b/rpms/awips2.edex/Installer.edex-shapefiles/component.spec @@ -3,8 +3,8 @@ # Name: awips2-edex-shapefiles Summary: AWIPS II Edex -Version: 1.7.1 -Release: 1 +Version: %{_component_version} +Release: %{_component_release} Group: AWIPSII BuildRoot: %{_build_root} BuildArch: noarch diff --git a/rpms/build/common/rpms.sh b/rpms/build/common/rpms.sh index ac94fc9447..955803b0fd 100644 --- a/rpms/build/common/rpms.sh +++ b/rpms/build/common/rpms.sh @@ -5,6 +5,8 @@ function buildQPID() # Arguments: # ${1} == optionally -ade + pushd . > /dev/null 2>&1 + cd ${WORKSPACE}/rpms/awips2.qpid/deploy.builder if [ $? -ne 0 ]; then echo "ERROR: Failed to build the qpid rpms." @@ -69,6 +71,8 @@ function buildQPID() fi fi + popd > /dev/null 2>&1 + return 0 }