public abstract class Aggregation extends Object implements AggregationIF
public Array read(Variable mainv); public Array read(Variable mainv, Section section);
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Aggregation.Type |
protected static class |
Aggregation.TypicalDataset |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cacheDirty |
protected MFileCollectionManager |
datasetManager |
protected List<ucar.nc2.internal.ncml.AggDataset> |
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<ucar.nc2.internal.ncml.AggDataset> |
explicitDatasets |
protected boolean |
isDate |
protected static org.slf4j.Logger |
logger |
protected NetcdfDataset.Builder |
ncDataset |
protected Object |
spiObject |
protected Aggregation.Type |
type |
protected static Aggregation.TypicalDataset |
typicalDatasetMode |
| Modifier | Constructor and Description |
|---|---|
protected |
Aggregation(NetcdfDataset.Builder 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(ucar.nc2.internal.ncml.AggDataset 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,
FileFactory reader)
Add a nested dataset, specified by an explicit netcdf element.
|
void |
build(CancelTask cancelTask) |
protected abstract void |
buildNetcdfDataset(CancelTask cancelTask)
Call this to build the dataset objects in the NetcdfDataset
|
void |
close() |
List<ucar.nc2.internal.ncml.AggDataset> |
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 ucar.nc2.internal.ncml.AggDataset |
getTypicalDataset()
Open one of the nested datasets as a template for the aggregation dataset.
|
protected ucar.nc2.internal.ncml.AggDataset |
makeDataset(MFile dset) |
protected ucar.nc2.internal.ncml.AggDataset |
makeDataset(String cacheName,
String location,
String id,
String ncoordS,
String coordValueS,
String sectionSpec,
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 made persistent.
|
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.Builder ncDataset
protected Aggregation.Type type
protected Object spiObject
protected List<ucar.nc2.internal.ncml.AggDataset> explicitDatasets
protected List<ucar.nc2.internal.ncml.AggDataset> datasets
protected MFileCollectionManager datasetManager
protected boolean cacheDirty
protected String dimName
protected String dateFormatMark
protected boolean isDate
protected DateFormatter dateFormatter
protected Aggregation(NetcdfDataset.Builder 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, 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(ucar.nc2.internal.ncml.AggDataset 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 setModifications(org.jdom2.Element ncmlMods)
public Aggregation.Type getType()
public String getDimensionName()
protected String getLocation()
public void close()
throws IOException
close in interface AggregationIFIOExceptionpublic boolean syncExtend()
throws IOException
syncExtend in interface AggregationIFIOException - on io errorpublic long getLastModified()
getLastModified in interface AggregationIFpublic String getFileTypeId()
getFileTypeId in interface AggregationIFpublic String getFileTypeDescription()
getFileTypeDescription in interface AggregationIFprotected abstract void buildNetcdfDataset(CancelTask cancelTask) throws IOException
cancelTask - maybe cancelIOException - on read errorpublic void persistWrite()
throws IOException
persistWrite in interface AggregationIFIOException - on errorprotected void persistRead()
public void getDetailInfo(Formatter f)
getDetailInfo in interface AggregationIFpublic void build(CancelTask cancelTask) throws IOException
IOExceptionpublic List<ucar.nc2.internal.ncml.AggDataset> getDatasets()
protected void makeDatasets(CancelTask cancelTask) throws IOException
cancelTask - user can cancelIOException - on i/o errorprotected ucar.nc2.internal.ncml.AggDataset getTypicalDataset()
throws IOException
IOException - if there are no datasetsprotected ucar.nc2.internal.ncml.AggDataset makeDataset(String cacheName, String location, String id, String ncoordS, String coordValueS, String sectionSpec, 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 ucar.nc2.internal.ncml.AggDataset makeDataset(MFile dset)