public abstract class Aggregation extends Object
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 |
static int |
countCacheUse |
protected MFileCollectionManager |
datasetManager |
protected List<AggDataset> |
datasets |
protected String |
dateFormatMark |
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<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(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<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 AggDataset |
getTypicalDataset()
Open one of the nested datasets as a template for the aggregation dataset.
|
protected AggDataset |
makeDataset(MFile dset) |
protected 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
public static int countCacheUse
protected NetcdfDataset.Builder<?> ncDataset
protected Aggregation.Type type
protected Object spiObject
protected List<AggDataset> explicitDatasets
protected List<AggDataset> datasets
protected MFileCollectionManager datasetManager
protected boolean cacheDirty
protected String dimName
protected String dateFormatMark
protected boolean isDate
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(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
IOExceptionpublic boolean syncExtend()
public long getLastModified()
public String getFileTypeId()
public String getFileTypeDescription()
protected abstract void buildNetcdfDataset(CancelTask cancelTask) throws IOException
cancelTask - maybe cancelIOException - on read errorpublic void persistWrite()
throws IOException
IOException - on errorprotected void persistRead()
public void getDetailInfo(Formatter f)
public void build(CancelTask cancelTask) throws IOException
IOExceptionpublic List<AggDataset> getDatasets()
protected void makeDatasets(CancelTask cancelTask)
cancelTask - user can cancelprotected AggDataset getTypicalDataset() throws IOException
IOException - if there are no datasetsprotected 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 AggDataset makeDataset(MFile dset)