public interface CollectionManager
NetcdfDataset.open(MFile.getPath, ...);should work.
A CollectionManager implements the A collection element defines the collection of datasets. wherecollection element
<collection spec="/data/ldm/pub/native/satellite/3.9/WEST-CONUS_4km/WEST-CONUS_4km_3.9_#yyyyMMdd_HHmm#.gini$"
name="WEST-CONUS_4km" olderThan="1 min" olderThan="15 min" />
The XML Schema:
<xsd:complexType name="collectionType">
1) <xsd:attribute name="spec" type="xsd:string" use="required"/>
2) <xsd:attribute name="name" type="xsd:token"/>
3) <xsd:attribute name="olderThan" type="xsd:string" />
5) <xsd:attribute name="dateFormatMark" type="xsd:string"/>
6) <xsd:attribute name="timePartition" type="xsd:string"/>
</xsd:complexType>
Modifier and Type | Interface and Description |
---|---|
static interface |
CollectionManager.ChangeChecker |
static class |
CollectionManager.Force |
static class |
CollectionManager.TriggerEvent |
static interface |
CollectionManager.TriggerListener
A TriggerEvent.proto is sent if protoDataset.change = "cron" has been specified
A TriggerEvent.update is sent if a scan has happened and a change in the list of MFiles has occurred,
or an MFile has been updated
|
static class |
CollectionManager.TriggerType |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(CollectionManager.TriggerListener l)
Register to get Trigger events
|
void |
close()
Close and release any resources.
|
CalendarDate |
extractRunDate(MFile mfile)
Use the date extractor to extract the date from the filename.
|
Object |
getAuxInfo(String key) |
String |
getCollectionName()
The name of the collection
|
List<String> |
getFilenames() |
Iterable<MFile> |
getFiles()
Get the current collection of MFile.
|
long |
getLastScanned()
Get the last time scanned
|
MFile |
getLatestFile() |
long |
getOlderThanFilterInMSecs()
The "olderThan" amount in seconds.
|
int |
getProtoIndex(int n)
Choose Proto dataset as index from [0..n-1], based on configuration.
|
TimeDuration |
getRecheck()
Get how often to rescan
|
String |
getRoot()
Get common root directory of all MFiles in the collection - may be null
|
CalendarDate |
getStartCollection()
The starting date of the collection.
|
boolean |
hasDateExtractor()
Does this CollectionManager have the ability to extract a date from the MFile ?
|
boolean |
isScanNeeded()
Compute whether rescan is needed, based on getRecheck(), and the LastScanned value.
|
boolean |
isStatic()
static means doesnt need to be monitored for changes; can be externally triggered, or read in at startup.
|
void |
putAuxInfo(String key,
Object value) |
void |
removeEventListener(CollectionManager.TriggerListener l) |
void |
resetProto()
Called by external program to tell the manager its time to switch the proto dataset.
|
boolean |
scan(boolean sendEvent)
Scan the collection.
|
boolean |
scanIfNeeded()
If isScanNeeded(), do a scan.
|
void |
setChangeChecker(CollectionManager.ChangeChecker strategy) |
void |
setFiles(Iterable<MFile> files)
dcm must be updated when index is read in
|
void |
updateNocheck()
send event TriggerType.updateNocheck, which calls
call InvDatasetFeatureCollection.update(CollectionManager.Force.nocheck)
|
String getCollectionName()
String getRoot()
boolean isStatic()
long getLastScanned()
TimeDuration getRecheck()
boolean isScanNeeded()
boolean scanIfNeeded() throws IOException
IOException
- on io errorboolean scan(boolean sendEvent) throws IOException
IOException
- on I/O errorvoid updateNocheck() throws IOException
IOException
Iterable<MFile> getFiles()
CalendarDate extractRunDate(MFile mfile)
mfile
- extract from hereboolean hasDateExtractor()
CalendarDate getStartCollection()
void close()
int getProtoIndex(int n)
n
- size to choose fromlong getOlderThanFilterInMSecs()
MFile getLatestFile()
void setChangeChecker(CollectionManager.ChangeChecker strategy)
void resetProto()
void addEventListener(CollectionManager.TriggerListener l)
l
- listenervoid removeEventListener(CollectionManager.TriggerListener l)
Copyright © 1999–2014 UCAR/Unidata. All rights reserved.