|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.nc2.ncml.Aggregation
public abstract class Aggregation
Implement NcML Aggregation.
| Nested Class Summary | |
|---|---|
class |
Aggregation.Dataset
Encapsolates a NetcdfFile that is a component of the aggregation. |
protected class |
Aggregation.DatasetProxyReader
|
protected class |
Aggregation.DirectoryScan
Encapsolate a "scan" or "scan2" element: a directory that we want to scan. |
protected class |
Aggregation.MyFile
Encapsolate a file that was scanned. |
protected class |
Aggregation.MyReplaceVariableCheck
|
static class |
Aggregation.Type
|
| Field Summary | |
|---|---|
protected boolean |
debug
|
protected boolean |
debugCacheDetail
|
protected boolean |
debugOpenFile
|
protected boolean |
debugProxy
|
protected boolean |
debugRead
|
protected boolean |
debugScan
|
protected boolean |
debugSyncDetail
|
protected java.lang.String |
dimName
|
protected static DiskCache2 |
diskCache2
|
protected java.util.ArrayList |
explicitDatasets
|
protected DateFormatter |
formatter
|
protected boolean |
isDate
|
protected long |
lastChecked
|
protected static org.slf4j.Logger |
logger
|
protected NetcdfDataset |
ncDataset
|
protected java.util.ArrayList |
nestedDatasets
|
protected TimeUnit |
recheck
|
protected java.util.ArrayList |
scanList
|
protected java.lang.Object |
spiObject
|
protected Aggregation.Type |
type
|
protected static int |
TYPICAL_DATASET_LATEST
|
protected static int |
TYPICAL_DATASET_PENULTIMATE
|
protected static int |
TYPICAL_DATASET_RANDOM
|
protected static int |
typicalDatasetMode
|
protected boolean |
wasChanged
|
| Constructor Summary | |
|---|---|
protected |
Aggregation(NetcdfDataset ncd,
java.lang.String dimName,
Aggregation.Type type,
java.lang.String recheckS)
Create an Aggregation for the given NetcdfDataset. |
| Method Summary | |
|---|---|
void |
addDataset(Aggregation.Dataset nested)
|
void |
addDirectoryScan(java.lang.String dirName,
java.lang.String suffix,
java.lang.String regexpPatternString,
java.lang.String dateFormatMark,
java.lang.String enhance,
java.lang.String subdirs,
java.lang.String olderThan)
Add a scan elemnt |
void |
addExplicitDataset(java.lang.String cacheName,
java.lang.String location,
java.lang.String ncoordS,
java.lang.String coordValueS,
NetcdfFileFactory reader,
CancelTask cancelTask)
Add a nested dataset (other than a union), specified by an explicit netcdf element. |
void |
addVariable(java.lang.String varName)
Add a name from a variableAgg element |
protected void |
buildCoords(CancelTask cancelTask)
|
protected abstract void |
buildDataset(boolean isNew,
CancelTask cancelTask)
|
void |
close()
Release all resources associated with the aggregation |
void |
finish(CancelTask cancelTask)
|
DataType |
getCoordinateType()
What is the data type of the aggregation coordinate ? |
java.lang.String |
getDimensionName()
|
java.util.List |
getNestedDatasets()
|
int |
getTotalCoords()
|
Aggregation.Type |
getType()
|
protected Aggregation.Dataset |
getTypicalDataset()
Open one of the nested datasets as a template for the aggregation dataset. |
java.util.List |
getVariables()
Get the list of aggregation variables: variables whose data spans multiple files. |
boolean |
isDate()
|
protected Aggregation.Dataset |
makeDataset(java.lang.String cacheName,
java.lang.String location,
java.lang.String ncoordS,
java.lang.String coordValueS,
boolean enhance,
NetcdfFileFactory reader)
Dataset factory, so subclasses can override |
protected void |
makeProxies(Aggregation.Dataset typicalDataset,
NetcdfDataset newds)
|
void |
persist()
Overriden in AggregationExisting |
protected void |
persistRead()
|
Array |
read(Variable mainv,
CancelTask cancelTask)
Read an aggregation variable: A variable whose data spans multiple files. |
Array |
read(Variable mainv,
CancelTask cancelTask,
java.util.List section)
Read a section of an aggregation variable. |
protected Array |
readAggCoord(Variable aggCoord,
CancelTask cancelTask)
|
protected Array |
readAggCoord(Variable aggCoord,
CancelTask cancelTask,
java.util.List section)
|
protected void |
scan(java.util.List result,
CancelTask cancelTask)
Scan the directory(ies) and create nested Aggregation.Dataset objects. |
static void |
setPersistenceCache(DiskCache2 dc)
|
static void |
setTypicalDatasetMode(java.lang.String mode)
|
boolean |
sync()
|
protected void |
syncDataset(CancelTask cancelTask)
|
boolean |
syncExtend(boolean force)
Check to see if its time to rescan directory, and if so, rescan and extend dataset if needed. |
protected boolean |
timeToRescan()
Rescan if recheckEvery time has passed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static int TYPICAL_DATASET_RANDOM
protected static int TYPICAL_DATASET_LATEST
protected static int TYPICAL_DATASET_PENULTIMATE
protected static int typicalDatasetMode
protected static org.slf4j.Logger logger
protected static DiskCache2 diskCache2
protected NetcdfDataset ncDataset
protected java.lang.String dimName
protected Aggregation.Type type
protected java.util.ArrayList nestedDatasets
protected java.lang.Object spiObject
protected java.util.ArrayList explicitDatasets
protected java.util.ArrayList scanList
protected TimeUnit recheck
protected long lastChecked
protected boolean wasChanged
protected boolean isDate
protected DateFormatter formatter
protected boolean debug
protected boolean debugOpenFile
protected boolean debugCacheDetail
protected boolean debugSyncDetail
protected boolean debugProxy
protected boolean debugScan
protected boolean debugRead
| Constructor Detail |
|---|
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 changes| Method Detail |
|---|
public static void setPersistenceCache(DiskCache2 dc)
public static void setTypicalDatasetMode(java.lang.String mode)
public void addExplicitDataset(java.lang.String cacheName,
java.lang.String location,
java.lang.String ncoordS,
java.lang.String coordValueS,
NetcdfFileFactory reader,
CancelTask cancelTask)
cacheName - a unique name to use for cachinglocation - attribute "location" on the netcdf elementncoordS - attribute "ncoords" on the netcdf elementcoordValueS - attribute "coordValue" on the netcdf elementreader - factory for reading this netcdf datasetcancelTask - user may cancel, may be nullpublic void addDataset(Aggregation.Dataset nested)
public void addDirectoryScan(java.lang.String dirName,
java.lang.String suffix,
java.lang.String regexpPatternString,
java.lang.String dateFormatMark,
java.lang.String enhance,
java.lang.String subdirs,
java.lang.String olderThan)
throws java.io.IOException
dirName - 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)enhance - should files bne enhanced?olderThan - files must be older than this time (now - lastModified >= olderThan); must be a time unit, may ne bull
java.io.IOExceptionpublic void addVariable(java.lang.String varName)
varName - public java.lang.String getDimensionName()
public int getTotalCoords()
public java.util.List getNestedDatasets()
public Aggregation.Type getType()
public boolean isDate()
public java.util.List getVariables()
public DataType getCoordinateType()
public void close()
throws java.io.IOException
java.io.IOException
public void persist()
throws java.io.IOException
java.io.IOExceptionprotected void persistRead()
public void finish(CancelTask cancelTask)
throws java.io.IOException
java.io.IOException
protected abstract void buildDataset(boolean isNew,
CancelTask cancelTask)
throws java.io.IOException
java.io.IOException
protected void buildCoords(CancelTask cancelTask)
throws java.io.IOException
java.io.IOException
public boolean syncExtend(boolean force)
throws java.io.IOException
force - if true, always rescan even if time not expired
java.io.IOException
protected void syncDataset(CancelTask cancelTask)
throws java.io.IOException
java.io.IOException
public boolean sync()
throws java.io.IOException
java.io.IOExceptionprotected boolean timeToRescan()
java.io.IOException
protected Aggregation.Dataset getTypicalDataset()
throws java.io.IOException
java.io.FileNotFoundException - if there are no datasets
java.io.IOException
protected void makeProxies(Aggregation.Dataset typicalDataset,
NetcdfDataset newds)
throws java.io.IOException
java.io.IOException
public Array read(Variable mainv,
CancelTask cancelTask)
throws java.io.IOException
read in interface ProxyReadermainv - the aggregation variablecancelTask - allow the user to cancel
java.io.IOException
protected Array readAggCoord(Variable aggCoord,
CancelTask cancelTask)
throws java.io.IOException
java.io.IOException
public Array read(Variable mainv,
CancelTask cancelTask,
java.util.List section)
throws java.io.IOException,
InvalidRangeException
read in interface ProxyReadermainv - the aggregation variablecancelTask - allow the user to cancelsection - read just this section of the data, array of Range
java.io.IOException
InvalidRangeException - if section is incorrect rank or shape.
protected Array readAggCoord(Variable aggCoord,
CancelTask cancelTask,
java.util.List section)
throws java.io.IOException,
InvalidRangeException
java.io.IOException
InvalidRangeException
protected void scan(java.util.List result,
CancelTask cancelTask)
throws java.io.IOException
result - add to this List objects of type Aggregation.DatasetcancelTask - allow user to cancel
java.io.IOException
protected Aggregation.Dataset makeDataset(java.lang.String cacheName,
java.lang.String location,
java.lang.String ncoordS,
java.lang.String coordValueS,
boolean enhance,
NetcdfFileFactory reader)
cacheName - a unique name to use for cachinglocation - attribute "location" on the netcdf elementncoordS - attribute "ncoords" on the netcdf elementcoordValueS - attribute "coordValue" on the netcdf elementenhance - open dataset in enhance modereader - factory for reading this netcdf dataset
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||