public abstract class Aggregation
extends java.lang.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 MFileCollectionManager |
datasetManager |
protected java.util.List<Aggregation.Dataset> |
datasets |
protected java.lang.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 java.lang.String |
dimName |
protected static DiskCache2 |
diskCache2 |
protected static java.util.concurrent.Executor |
executor |
protected java.util.List<Aggregation.Dataset> |
explicitDatasets |
protected boolean |
isDate |
protected static org.slf4j.Logger |
logger |
protected NetcdfDataset |
ncDataset |
protected java.lang.Object |
spiObject |
protected Aggregation.Type |
type |
protected static Aggregation.TypicalDataset |
typicalDatasetMode |
Modifier | Constructor and Description |
---|---|
protected |
Aggregation(NetcdfDataset ncd,
java.lang.String dimName,
Aggregation.Type type,
java.lang.String recheckS)
Create an Aggregation for the given NetcdfDataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addCollection(java.lang.String spec,
java.lang.String olderThan) |
void |
addDataset(Aggregation.Dataset nested) |
void |
addDatasetScan(org.jdom2.Element crawlableDatasetElement,
java.lang.String dirName,
java.lang.String suffix,
java.lang.String regexpPatternString,
java.lang.String dateFormatMark,
java.util.Set<NetcdfDataset.Enhance> enhanceMode,
java.lang.String subdirs,
java.lang.String olderThan)
Add a dataset scan
|
void |
addExplicitDataset(java.lang.String cacheName,
java.lang.String location,
java.lang.String id,
java.lang.String ncoordS,
java.lang.String coordValueS,
java.lang.String sectionSpec,
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) |
java.util.List<Aggregation.Dataset> |
getDatasets() |
void |
getDetailInfo(java.util.Formatter f) |
java.lang.String |
getDimensionName()
Get dimension name to join on
|
java.lang.String |
getFileTypeDescription() |
java.lang.String |
getFileTypeId() |
long |
getLastModified() |
protected java.lang.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(MFile dset) |
protected Aggregation.Dataset |
makeDataset(java.lang.String cacheName,
java.lang.String location,
java.lang.String id,
java.lang.String ncoordS,
java.lang.String coordValueS,
java.lang.String sectionSpec,
java.util.EnumSet<NetcdfDataset.Enhance> enhance,
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(java.util.concurrent.Executor exec) |
void |
setModifications(org.jdom2.Element ncmlMods) |
static void |
setPersistenceCache(DiskCache2 dc) |
static void |
setTypicalDatasetMode(java.lang.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 java.util.concurrent.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 java.lang.Object spiObject
protected java.util.List<Aggregation.Dataset> explicitDatasets
protected java.util.List<Aggregation.Dataset> datasets
protected MFileCollectionManager datasetManager
protected boolean cacheDirty
protected java.lang.String dimName
protected java.lang.String dateFormatMark
protected boolean isDate
protected DateFormatter dateFormatter
protected Aggregation(NetcdfDataset ncd, java.lang.String dimName, Aggregation.Type type, java.lang.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(java.util.concurrent.Executor exec)
public static void setTypicalDatasetMode(java.lang.String mode)
public void addExplicitDataset(java.lang.String cacheName, java.lang.String location, java.lang.String id, java.lang.String ncoordS, java.lang.String coordValueS, java.lang.String sectionSpec, 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, java.lang.String dirName, java.lang.String suffix, java.lang.String regexpPatternString, java.lang.String dateFormatMark, java.util.Set<NetcdfDataset.Enhance> enhanceMode, java.lang.String subdirs, java.lang.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(java.lang.String spec, java.lang.String olderThan) throws java.io.IOException
java.io.IOException
public void setModifications(org.jdom2.Element ncmlMods)
public Aggregation.Type getType()
public java.lang.String getDimensionName()
protected java.lang.String getLocation()
public void close() throws java.io.IOException
java.io.IOException
public boolean syncExtend() throws java.io.IOException
java.io.IOException
- on io errorpublic long getLastModified()
public java.lang.String getFileTypeId()
public java.lang.String getFileTypeDescription()
protected abstract void buildNetcdfDataset(CancelTask cancelTask) throws java.io.IOException
cancelTask
- maybe canceljava.io.IOException
- on read errorprotected abstract void rebuildDataset() throws java.io.IOException
java.io.IOException
- on read errorpublic void persistWrite() throws java.io.IOException
java.io.IOException
- on errorprotected void persistRead()
public void getDetailInfo(java.util.Formatter f)
public void finish(CancelTask cancelTask) throws java.io.IOException
java.io.IOException
public java.util.List<Aggregation.Dataset> getDatasets()
protected void makeDatasets(CancelTask cancelTask) throws java.io.IOException
cancelTask
- user can canceljava.io.IOException
- on i/o errorprotected Aggregation.Dataset getTypicalDataset() throws java.io.IOException
java.io.IOException
- if there are no datasetsprotected Aggregation.Dataset makeDataset(java.lang.String cacheName, java.lang.String location, java.lang.String id, java.lang.String ncoordS, java.lang.String coordValueS, java.lang.String sectionSpec, java.util.EnumSet<NetcdfDataset.Enhance> enhance, 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(MFile dset)
protected void setDatasetAcquireProxy(Aggregation.Dataset typicalDataset, NetcdfDataset newds) throws java.io.IOException
typicalDataset
- read from a "typical dataset"newds
- containing datasetjava.io.IOException
- on i/o errorprotected void setDatasetAcquireProxy(Aggregation.DatasetProxyReader proxy, Group g) throws java.io.IOException
java.io.IOException
protected Variable findVariable(NetcdfFile ncfile, Variable mainV)