Merge "Issue #1152 synchronize preload for MemoryBasedTileSet." into development
Former-commit-id:93c79d4ca0
[formerly 7840b62be0e38d4c2c0b51a5e80b20bf52c79c55] Former-commit-id:87dffbee1c
This commit is contained in:
commit
eaae1ce9fe
1 changed files with 21 additions and 16 deletions
|
@ -49,7 +49,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||||
*
|
*
|
||||||
* This memory-based tileset pulls a small raster from an hdf5 file and
|
* This memory-based tileset pulls a small raster from an hdf5 file and
|
||||||
* interpolates it to a larger size. The raster is then split once it is already
|
* interpolates it to a larger size. The raster is then split once it is already
|
||||||
* loaded in memory.
|
* loaded in memory.git pull
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -116,23 +116,28 @@ public class MemoryBasedTileSet extends AbstractTileSet {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void preloadDataObject(int level) throws StorageException {
|
protected void preloadDataObject(int level) throws StorageException {
|
||||||
IDataRecord rec = getDataRecord();
|
synchronized (isLoaded) {
|
||||||
|
if (isLoaded[level]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDataRecord rec = getDataRecord();
|
||||||
|
|
||||||
if (loadedData == null) {
|
if (loadedData == null) {
|
||||||
loadedData = new Object[levels];
|
loadedData = new Object[levels];
|
||||||
dims = new int[levels][];
|
dims = new int[levels][];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rec != null) {
|
||||||
|
|
||||||
|
loadedData[level] = rec.getDataObject();
|
||||||
|
|
||||||
|
long[] d = rec.getSizes();
|
||||||
|
dims[level] = new int[] { (int) d[0], (int) d[1] };
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
isLoaded[level] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec != null) {
|
|
||||||
|
|
||||||
loadedData[level] = rec.getDataObject();
|
|
||||||
|
|
||||||
long[] d = rec.getSizes();
|
|
||||||
dims[level] = new int[] { (int) d[0], (int) d[1] };
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoaded[level] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IDataRecord getDataRecord() throws StorageException {
|
protected IDataRecord getDataRecord() throws StorageException {
|
||||||
|
|
Loading…
Add table
Reference in a new issue