Package ucar.nc2.ncml
Class Aggregation
- java.lang.Object
-
- ucar.nc2.ncml.Aggregation
-
- All Implemented Interfaces:
AggregationIF
- Direct Known Subclasses:
AggregationOuterDimension,AggregationTiled,AggregationUnion
@Deprecated public abstract class Aggregation extends Object implements AggregationIF
Deprecated.Superclass for NcML Aggregation. An Aggregation acts as a ProxyReader for VariableDS. That, is it must implement:public Array read(Variable mainv); public Array read(Variable mainv, Section section);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAggregation.DatasetDeprecated.Encapsolates a NetcdfFile that is a component of the aggregation.protected classAggregation.DatasetProxyReaderDeprecated.protected static classAggregation.TypeDeprecated.protected static classAggregation.TypicalDatasetDeprecated.
-
Field Summary
Fields Modifier and Type Field Description protected booleancacheDirtyDeprecated.protected MFileCollectionManagerdatasetManagerDeprecated.protected List<Aggregation.Dataset>datasetsDeprecated.protected StringdateFormatMarkDeprecated.protected DateFormatterdateFormatterDeprecated.protected static booleandebugDeprecated.protected static booleandebugConvertDeprecated.protected static booleandebugDateParseDeprecated.protected static booleandebugOpenFileDeprecated.protected static booleandebugProxyDeprecated.protected static booleandebugReadDeprecated.protected static booleandebugSyncDetailDeprecated.protected StringdimNameDeprecated.protected static DiskCache2diskCache2Deprecated.protected static ExecutorexecutorDeprecated.protected List<Aggregation.Dataset>explicitDatasetsDeprecated.protected booleanisDateDeprecated.protected static org.slf4j.LoggerloggerDeprecated.protected NetcdfDatasetncDatasetDeprecated.protected ObjectspiObjectDeprecated.protected Aggregation.TypetypeDeprecated.protected static Aggregation.TypicalDatasettypicalDatasetModeDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAggregation(NetcdfDataset ncd, String dimName, Aggregation.Type type, String recheckS)Deprecated.Create an Aggregation for the given NetcdfDataset.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCollection(String spec, String olderThan)Deprecated.voidaddDataset(Aggregation.Dataset nested)Deprecated.voidaddDatasetScan(org.jdom2.Element crawlableDatasetElement, String dirName, String suffix, String regexpPatternString, String dateFormatMark, Set<NetcdfDataset.Enhance> enhanceMode, String subdirs, String olderThan)Deprecated.Add a dataset scanvoidaddExplicitDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, FileFactory reader)Deprecated.Add a nested dataset, specified by an explicit netcdf element.protected abstract voidbuildNetcdfDataset(CancelTask cancelTask)Deprecated.Call this to build the dataset objects in the NetcdfDatasetvoidclose()Deprecated.protected VariablefindVariable(NetcdfFile ncfile, Variable mainV)Deprecated.voidfinish(CancelTask cancelTask)Deprecated.List<Aggregation.Dataset>getDatasets()Deprecated.voidgetDetailInfo(Formatter f)Deprecated.StringgetDimensionName()Deprecated.Get dimension name to join onStringgetFileTypeDescription()Deprecated.StringgetFileTypeId()Deprecated.longgetLastModified()Deprecated.protected StringgetLocation()Deprecated.Aggregation.TypegetType()Deprecated.Get type of aggregationprotected Aggregation.DatasetgetTypicalDataset()Deprecated.Open one of the nested datasets as a template for the aggregation dataset.protected Aggregation.DatasetmakeDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)Deprecated.Dataset factory, so subclasses can overrideprotected Aggregation.DatasetmakeDataset(MFile dset)Deprecated.protected voidmakeDatasets(CancelTask cancelTask)Deprecated.Make the list of Datasets, from explicit and scans.protected voidpersistRead()Deprecated.read info from the persistent XML file, if it exists; overridden in AggregationExistingvoidpersistWrite()Deprecated.Allow information to be make persistent.protected abstract voidrebuildDataset()Deprecated.Call this when rescan has found changed datasetsprotected voidsetDatasetAcquireProxy(Aggregation.DatasetProxyReader proxy, Group g)Deprecated.protected voidsetDatasetAcquireProxy(Aggregation.Dataset typicalDataset, NetcdfDataset newds)Deprecated.All non-agg variables use a proxy to acquire the file before reading.static voidsetExecutor(Executor exec)Deprecated.voidsetModifications(org.jdom2.Element ncmlMods)Deprecated.static voidsetPersistenceCache(DiskCache2 dc)Deprecated.static voidsetTypicalDatasetMode(String mode)Deprecated.booleansyncExtend()Deprecated.Check to see if its time to rescan directory, and if so, rescan and extend dataset if needed.
-
-
-
Field Detail
-
typicalDatasetMode
protected static Aggregation.TypicalDataset typicalDatasetMode
Deprecated.
-
logger
protected static org.slf4j.Logger logger
Deprecated.
-
diskCache2
protected static DiskCache2 diskCache2
Deprecated.
-
executor
protected static Executor executor
Deprecated.
-
debug
protected static boolean debug
Deprecated.
-
debugOpenFile
protected static boolean debugOpenFile
Deprecated.
-
debugSyncDetail
protected static boolean debugSyncDetail
Deprecated.
-
debugProxy
protected static boolean debugProxy
Deprecated.
-
debugRead
protected static boolean debugRead
Deprecated.
-
debugDateParse
protected static boolean debugDateParse
Deprecated.
-
debugConvert
protected static boolean debugConvert
Deprecated.
-
ncDataset
protected NetcdfDataset ncDataset
Deprecated.
-
type
protected Aggregation.Type type
Deprecated.
-
spiObject
protected Object spiObject
Deprecated.
-
explicitDatasets
protected List<Aggregation.Dataset> explicitDatasets
Deprecated.
-
datasets
protected List<Aggregation.Dataset> datasets
Deprecated.
-
datasetManager
protected MFileCollectionManager datasetManager
Deprecated.
-
cacheDirty
protected boolean cacheDirty
Deprecated.
-
dimName
protected String dimName
Deprecated.
-
dateFormatMark
protected String dateFormatMark
Deprecated.
-
isDate
protected boolean isDate
Deprecated.
-
dateFormatter
protected DateFormatter dateFormatter
Deprecated.
-
-
Constructor Detail
-
Aggregation
protected Aggregation(NetcdfDataset ncd, String dimName, Aggregation.Type type, String recheckS)
Deprecated.Create an Aggregation for the given NetcdfDataset. The following addXXXX methods are called, then finish(), before the object is ready for use.- Parameters:
ncd- Aggregation belongs to this NetcdfDatasetdimName- the aggregation dimension nametype- the Aggregation.TyperecheckS- how often to check if files have changes
-
-
Method Detail
-
setPersistenceCache
public static void setPersistenceCache(DiskCache2 dc)
Deprecated.
-
setExecutor
public static void setExecutor(Executor exec)
Deprecated.
-
setTypicalDatasetMode
public static void setTypicalDatasetMode(String mode)
Deprecated.
-
addExplicitDataset
public void addExplicitDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, FileFactory reader)
Deprecated.Add a nested dataset, specified by an explicit netcdf element. enhance is handled by the reader, so its always false here.- Parameters:
cacheName- a unique name to use for cachinglocation- attribute "location" on the netcdf elementid- attribute "id" on the netcdf elementncoordS- attribute "ncoords" on the netcdf elementcoordValueS- attribute "coordValue" on the netcdf elementsectionSpec- attribute "section" on the netcdf elementreader- factory for reading this netcdf dataset
-
addDataset
public void addDataset(Aggregation.Dataset nested)
Deprecated.
-
addDatasetScan
public void addDatasetScan(org.jdom2.Element crawlableDatasetElement, String dirName, String suffix, String regexpPatternString, String dateFormatMark, Set<NetcdfDataset.Enhance> enhanceMode, String subdirs, String olderThan)Deprecated.Add a dataset scan- Parameters:
crawlableDatasetElement- defines a CrawlableDataset, or nulldirName- scan this directorysuffix- filter on this suffix (may be null)regexpPatternString- include if full name matches this regular expression (may be null)dateFormatMark- create dates from the filename (may be null)enhanceMode- how should files be enhancedsubdirs- equals "false" if should not descend into subdirectoriesolderThan- files must be older than this time (now - lastModified >= olderThan); must be a time unit, may ne bull
-
setModifications
public void setModifications(org.jdom2.Element ncmlMods)
Deprecated.
-
getType
public Aggregation.Type getType()
Deprecated.Get type of aggregation- Returns:
- type of aggregation
-
getDimensionName
public String getDimensionName()
Deprecated.Get dimension name to join on- Returns:
- dimension name or null if type union/tiled
-
getLocation
protected String getLocation()
Deprecated.
-
close
public void close() throws IOExceptionDeprecated.- Specified by:
closein interfaceAggregationIF- Throws:
IOException
-
syncExtend
public boolean syncExtend() throws IOExceptionDeprecated.Check to see if its time to rescan directory, and if so, rescan and extend dataset if needed. Note that this just calls sync(), so structural metadata may be modified (!!)- Specified by:
syncExtendin interfaceAggregationIF- Returns:
- true if directory was rescanned and dataset may have been updated
- Throws:
IOException- on io error
-
getLastModified
public long getLastModified()
Deprecated.- Specified by:
getLastModifiedin interfaceAggregationIF
-
getFileTypeId
public String getFileTypeId()
Deprecated.- Specified by:
getFileTypeIdin interfaceAggregationIF
-
getFileTypeDescription
public String getFileTypeDescription()
Deprecated.- Specified by:
getFileTypeDescriptionin interfaceAggregationIF
-
buildNetcdfDataset
protected abstract void buildNetcdfDataset(CancelTask cancelTask) throws IOException
Deprecated.Call this to build the dataset objects in the NetcdfDataset- Parameters:
cancelTask- maybe cancel- Throws:
IOException- on read error
-
rebuildDataset
protected abstract void rebuildDataset() throws IOExceptionDeprecated.Call this when rescan has found changed datasets- Throws:
IOException- on read error
-
persistWrite
public void persistWrite() throws IOExceptionDeprecated.Allow information to be make persistent. Overridden in AggregationExisting- Specified by:
persistWritein interfaceAggregationIF- Throws:
IOException- on error
-
persistRead
protected void persistRead()
Deprecated.read info from the persistent XML file, if it exists; overridden in AggregationExisting
-
getDetailInfo
public void getDetailInfo(Formatter f)
Deprecated.- Specified by:
getDetailInfoin interfaceAggregationIF
-
finish
public void finish(CancelTask cancelTask) throws IOException
Deprecated.- Throws:
IOException
-
getDatasets
public List<Aggregation.Dataset> getDatasets()
Deprecated.
-
makeDatasets
protected void makeDatasets(CancelTask cancelTask) throws IOException
Deprecated.Make the list of Datasets, from explicit and scans.- Parameters:
cancelTask- user can cancel- Throws:
IOException- on i/o error
-
getTypicalDataset
protected Aggregation.Dataset getTypicalDataset() throws IOException
Deprecated.Open one of the nested datasets as a template for the aggregation dataset.- Returns:
- a typical Dataset
- Throws:
IOException- if there are no datasets
-
makeDataset
protected Aggregation.Dataset makeDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)
Deprecated.Dataset factory, so subclasses can override- Parameters:
cacheName- a unique name to use for cachinglocation- attribute "location" on the netcdf elementid- attribute "id" on the netcdf elementncoordS- attribute "ncoords" on the netcdf elementcoordValueS- attribute "coordValue" on the netcdf elementsectionSpec- attribute "sectionSpec" on the netcdf elementenhance- open dataset in enhance mode NOT USEDreader- factory for reading this netcdf dataset- Returns:
- a Aggregation.Dataset
-
makeDataset
protected Aggregation.Dataset makeDataset(MFile dset)
Deprecated.
-
setDatasetAcquireProxy
protected void setDatasetAcquireProxy(Aggregation.Dataset typicalDataset, NetcdfDataset newds) throws IOException
Deprecated.All non-agg variables use a proxy to acquire the file before reading. If the variable is caching, read data into cache now. If not caching, VariableEnhanced.setProxyReader() is called.- Parameters:
typicalDataset- read from a "typical dataset"newds- containing dataset- Throws:
IOException- on i/o error
-
setDatasetAcquireProxy
protected void setDatasetAcquireProxy(Aggregation.DatasetProxyReader proxy, Group g) throws IOException
Deprecated.- Throws:
IOException
-
findVariable
protected Variable findVariable(NetcdfFile ncfile, Variable mainV)
Deprecated.
-
-