Issue #1257: Update pypies group referencing and enable compression for radar and vil
Change-Id: Ib75b9fec9293f858b638f5eb61140da575909a34 Former-commit-id:f58dbfeb65
[formerlyd40f52a0bc
] [formerlyf2ac3dc537
] [formerlyf58dbfeb65
[formerlyd40f52a0bc
] [formerlyf2ac3dc537
] [formerlyc2a46e0b35
[formerlyf2ac3dc537
[formerly bbca9f1eb7b3bc568ab3cabc9ad83510afd7317f]]]] Former-commit-id:c2a46e0b35
Former-commit-id:89c1a1add4
[formerly67da3874f4
] [formerly 894b23d3d92172d9e3d25a741714f67203a14c5f [formerlybb723dc404
]] Former-commit-id: c3d53c2b7bb046c65afcbdc7567fb0ef69f1a737 [formerlybc589fbdb3
] Former-commit-id:0b0d0d073f
This commit is contained in:
parent
9dda91e0aa
commit
b7712c2d77
4 changed files with 49 additions and 34 deletions
|
@ -14,6 +14,7 @@
|
|||
<property name="pathProvider">
|
||||
<ref bean="radarPathProvider" />
|
||||
</property>
|
||||
<property name="compression" value="LZF"/>
|
||||
</bean>
|
||||
|
||||
<bean id="radarRegistered" factory-bean="pluginRegistry"
|
||||
|
|
|
@ -29,8 +29,10 @@ import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
|||
import com.raytheon.uf.common.dataplugin.vil.VILRecord;
|
||||
import com.raytheon.uf.common.dataplugin.vil.VILRecord.DATA_TYPE;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.StorageProperties;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.edex.core.dataplugin.PluginRegistry;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginDao;
|
||||
|
||||
/**
|
||||
|
@ -49,41 +51,50 @@ import com.raytheon.uf.edex.database.plugin.PluginDao;
|
|||
*/
|
||||
public class VILDao extends PluginDao {
|
||||
|
||||
public VILDao(String pluginName) throws PluginException {
|
||||
public VILDao(final String pluginName) throws PluginException {
|
||||
super(pluginName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IDataStore populateDataStore(IDataStore dataStore,
|
||||
IPersistable obj) throws Exception {
|
||||
protected IDataStore populateDataStore(final IDataStore dataStore,
|
||||
final IPersistable obj) throws Exception {
|
||||
VILRecord VILRec = (VILRecord) obj;
|
||||
|
||||
if (VILRec.getDataArray() != null
|
||||
String compression = PluginRegistry.getInstance()
|
||||
.getRegisteredObject(pluginName).getCompression();
|
||||
StorageProperties sp = null;
|
||||
if (compression != null) {
|
||||
sp = new StorageProperties();
|
||||
sp.setCompression(StorageProperties.Compression
|
||||
.valueOf(compression));
|
||||
}
|
||||
|
||||
if ((VILRec.getDataArray() != null)
|
||||
&& VILRec.getFieldName().equals(DATA_TYPE.VILD.name())) {
|
||||
|
||||
IDataRecord rec = new FloatDataRecord("Data", VILRec.getDataURI(),
|
||||
VILRec.getDataArray(), 2, new long[] { VILRec.getNx(),
|
||||
VILRec.getNy() });
|
||||
rec.setCorrelationObject(VILRec);
|
||||
dataStore.addDataRecord(rec);
|
||||
dataStore.addDataRecord(rec, sp);
|
||||
}
|
||||
|
||||
if (VILRec.getDataArray() != null
|
||||
if ((VILRec.getDataArray() != null)
|
||||
&& VILRec.getFieldName().equals(DATA_TYPE.DVILD.name())) {
|
||||
IDataRecord rec = new FloatDataRecord("Data", VILRec.getDataURI(),
|
||||
VILRec.getDataArray(), 2, new long[] { VILRec.getNx(),
|
||||
VILRec.getNy() });
|
||||
rec.setCorrelationObject(VILRec);
|
||||
dataStore.addDataRecord(rec);
|
||||
dataStore.addDataRecord(rec, sp);
|
||||
}
|
||||
|
||||
if (VILRec.getDataArray() != null
|
||||
if ((VILRec.getDataArray() != null)
|
||||
&& VILRec.getFieldName().equals(DATA_TYPE.EDVILD.name())) {
|
||||
IDataRecord rec = new FloatDataRecord("Data", VILRec.getDataURI(),
|
||||
VILRec.getDataArray(), 2, new long[] { VILRec.getNx(),
|
||||
VILRec.getNy() });
|
||||
rec.setCorrelationObject(VILRec);
|
||||
dataStore.addDataRecord(rec);
|
||||
dataStore.addDataRecord(rec, sp);
|
||||
}
|
||||
|
||||
logger.debug("VILDao: writing " + VILRec.toString());
|
||||
|
@ -92,8 +103,9 @@ public class VILDao extends PluginDao {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<IDataRecord[]> getHDF5Data(List<PluginDataObject> objects,
|
||||
int tileSet) throws PluginException {
|
||||
public List<IDataRecord[]> getHDF5Data(
|
||||
final List<PluginDataObject> objects, final int tileSet)
|
||||
throws PluginException {
|
||||
List<IDataRecord[]> retVal = new ArrayList<IDataRecord[]>();
|
||||
|
||||
for (PluginDataObject obj : objects) {
|
||||
|
@ -114,4 +126,3 @@ public class VILDao extends PluginDao {
|
|||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<value>com.raytheon.uf.common.dataplugin.radar</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="compression" value="LZF"/>
|
||||
</bean>
|
||||
|
||||
<bean factory-bean="pluginRegistry" factory-method="register" depends-on="radarRegistered">
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/16/10 njensen Initial Creation.
|
||||
# 05/03/11 9134 njensen Optimized for pointdata
|
||||
# 10/09/12 rjpeter Optimized __getGroup for retrievals
|
||||
#
|
||||
#
|
||||
#
|
||||
|
@ -528,6 +529,7 @@ class H5pyDataStore(IDataStore.IDataStore):
|
|||
if chunks:
|
||||
plc.set_chunk(chunks)
|
||||
if compression == 'LZF':
|
||||
plc.set_shuffle()
|
||||
plc.set_filter(h5py.h5z.FILTER_LZF, h5py.h5z.FLAG_OPTIONAL)
|
||||
|
||||
szDims = tuple(szDims)
|
||||
|
@ -612,6 +614,7 @@ class H5pyDataStore(IDataStore.IDataStore):
|
|||
|
||||
def __getGroup(self, f, name, create=False):
|
||||
t0=time.time()
|
||||
if create:
|
||||
parts = name.split('/')
|
||||
grp = None
|
||||
for s in parts:
|
||||
|
@ -621,18 +624,17 @@ class H5pyDataStore(IDataStore.IDataStore):
|
|||
if s == '/' or s in f.keys():
|
||||
grp = f[s]
|
||||
else:
|
||||
if create:
|
||||
grp = f.create_group(s)
|
||||
else:
|
||||
raise StorageException("No group " + name + " found")
|
||||
else:
|
||||
if s:
|
||||
if s in grp.keys():
|
||||
grp = grp[s]
|
||||
else:
|
||||
if create:
|
||||
grp = grp.create_group(s)
|
||||
else:
|
||||
try:
|
||||
grp = f[name]
|
||||
except KeyError:
|
||||
raise StorageException("No group " + name + " found")
|
||||
|
||||
t1=time.time()
|
||||
|
|
Loading…
Add table
Reference in a new issue