public abstract class Aggregation extends Object
public Array read(Variable mainv); public Array read(Variable mainv, Section section);
Modifier and Type | Class and Description |
---|---|
class |
Aggregation.Dataset
Encapsolates a NetcdfFile that is a component of the aggregation.
|
protected class |
Aggregation.DatasetProxyReader |
protected static class |
Aggregation.Type |
protected static class |
Aggregation.TypicalDataset |
Modifier and Type | Field and Description |
---|---|
protected boolean |
cacheDirty |
protected thredds.inventory.MFileCollectionManager |
datasetManager |
protected List<Aggregation.Dataset> |
datasets |
protected String |
dateFormatMark |
protected DateFormatter |
dateFormatter |
protected static boolean |
debug |
protected static boolean |
debugConvert |
protected static boolean |
debugDateParse |
protected static boolean |
debugOpenFile |
protected static boolean |
debugProxy |
protected static boolean |
debugRead |
protected static boolean |
debugSyncDetail |
protected String |
dimName |
protected static DiskCache2 |
diskCache2 |
protected static Executor |
executor |
protected List<Aggregation.Dataset> |
explicitDatasets |
protected boolean |
isDate |
protected static org.slf4j.Logger |
logger |
protected NetcdfDataset |
ncDataset |
protected Object |
spiObject |
protected Aggregation.Type |
type |
protected static Aggregation.TypicalDataset |
typicalDatasetMode |
Modifier | Constructor and Description |
---|---|
protected |
Aggregation(NetcdfDataset ncd,
String dimName,
Aggregation.Type type,
String recheckS)
Create an Aggregation for the given NetcdfDataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addCollection(String spec,
String olderThan) |
void |
addDataset(Aggregation.Dataset nested) |
void |
addDatasetScan(org.jdom2.Element crawlableDatasetElement,
String dirName,
String suffix,
String regexpPatternString,
String dateFormatMark,
Set<NetcdfDataset.Enhance> enhanceMode,
String subdirs,
String olderThan)
Add a dataset scan
|
void |
addExplicitDataset(String cacheName,
String location,
String id,
String ncoordS,
String coordValueS,
String sectionSpec,
ucar.nc2.util.cache.FileFactory reader)
Add a nested dataset, specified by an explicit netcdf element.
|
protected abstract void |
buildNetcdfDataset(CancelTask cancelTask)
Call this to build the dataset objects in the NetcdfDataset
|
void |
close() |
protected Variable |
findVariable(NetcdfFile ncfile,
Variable mainV) |
void |
finish(CancelTask cancelTask) |
List<Aggregation.Dataset> |
getDatasets() |
void |
getDetailInfo(Formatter f) |
String |
getDimensionName()
Get dimension name to join on
|
String |
getFileTypeDescription() |
String |
getFileTypeId() |
long |
getLastModified() |
protected String |
getLocation() |
Aggregation.Type |
getType()
Get type of aggregation
|
protected Aggregation.Dataset |
getTypicalDataset()
Open one of the nested datasets as a template for the aggregation dataset.
|
protected Aggregation.Dataset |
makeDataset(thredds.inventory.MFile dset) |
protected Aggregation.Dataset |
makeDataset(String cacheName,
String location,
String id,
String ncoordS,
String coordValueS,
String sectionSpec,
EnumSet<NetcdfDataset.Enhance> enhance,
ucar.nc2.util.cache.FileFactory reader)
Dataset factory, so subclasses can override
|
protected void |
makeDatasets(CancelTask cancelTask)
Make the list of Datasets, from explicit and scans.
|
protected void |
persistRead()
read info from the persistent XML file, if it exists; overridden in AggregationExisting
|
void |
persistWrite()
Allow information to be make persistent.
|
protected abstract void |
rebuildDataset()
Call this when rescan has found changed datasets
|
protected void |
setDatasetAcquireProxy(Aggregation.Dataset typicalDataset,
NetcdfDataset newds)
All non-agg variables use a proxy to acquire the file before reading.
|
protected void |
setDatasetAcquireProxy(Aggregation.DatasetProxyReader proxy,
Group g) |
static void |
setExecutor(Executor exec) |
void |
setModifications(org.jdom2.Element ncmlMods) |
static void |
setPersistenceCache(DiskCache2 dc) |
static void |
setTypicalDatasetMode(String mode) |
boolean |
syncExtend()
Check to see if its time to rescan directory, and if so, rescan and extend dataset if needed.
|
protected static Aggregation.TypicalDataset typicalDatasetMode
protected static org.slf4j.Logger logger
protected static DiskCache2 diskCache2
protected static Executor executor
protected static boolean debug
protected static boolean debugOpenFile
protected static boolean debugSyncDetail
protected static boolean debugProxy
protected static boolean debugRead
protected static boolean debugDateParse
protected static boolean debugConvert
protected NetcdfDataset ncDataset
protected Aggregation.Type type
protected Object spiObject
protected List<Aggregation.Dataset> explicitDatasets
protected List<Aggregation.Dataset> datasets
protected thredds.inventory.MFileCollectionManager datasetManager
protected boolean cacheDirty
protected String dimName
protected String dateFormatMark
protected boolean isDate
protected DateFormatter dateFormatter
protected Aggregation(NetcdfDataset ncd, String dimName, Aggregation.Type type, String recheckS)
ncd
- Aggregation belongs to this NetcdfDatasetdimName
- the aggregation dimension nametype
- the Aggregation.TyperecheckS
- how often to check if files have changespublic static void setPersistenceCache(DiskCache2 dc)
public static void setExecutor(Executor exec)
public static void setTypicalDatasetMode(String mode)
public void addExplicitDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, ucar.nc2.util.cache.FileFactory reader)
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 datasetpublic void addDataset(Aggregation.Dataset nested)
public void addDatasetScan(org.jdom2.Element crawlableDatasetElement, String dirName, String suffix, String regexpPatternString, String dateFormatMark, Set<NetcdfDataset.Enhance> enhanceMode, String subdirs, String olderThan)
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 bullpublic void addCollection(String spec, String olderThan) throws IOException
IOException
public void setModifications(org.jdom2.Element ncmlMods)
public Aggregation.Type getType()
public String getDimensionName()
protected String getLocation()
public void close() throws IOException
IOException
public boolean syncExtend() throws IOException
IOException
- on io errorpublic long getLastModified()
public String getFileTypeId()
public String getFileTypeDescription()
protected abstract void buildNetcdfDataset(CancelTask cancelTask) throws IOException
cancelTask
- maybe cancelIOException
- on read errorprotected abstract void rebuildDataset() throws IOException
IOException
- on read errorpublic void persistWrite() throws IOException
IOException
- on errorprotected void persistRead()
public void getDetailInfo(Formatter f)
public void finish(CancelTask cancelTask) throws IOException
IOException
public List<Aggregation.Dataset> getDatasets()
protected void makeDatasets(CancelTask cancelTask) throws IOException
cancelTask
- user can cancelIOException
- on i/o errorprotected Aggregation.Dataset getTypicalDataset() throws IOException
IOException
- if there are no datasetsprotected Aggregation.Dataset makeDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, EnumSet<NetcdfDataset.Enhance> enhance, ucar.nc2.util.cache.FileFactory reader)
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 datasetprotected Aggregation.Dataset makeDataset(thredds.inventory.MFile dset)
protected void setDatasetAcquireProxy(Aggregation.Dataset typicalDataset, NetcdfDataset newds) throws IOException
typicalDataset
- read from a "typical dataset"newds
- containing datasetIOException
- on i/o errorprotected void setDatasetAcquireProxy(Aggregation.DatasetProxyReader proxy, Group g) throws IOException
IOException
protected Variable findVariable(NetcdfFile ncfile, Variable mainV)