public abstract class CollectionAbstract extends Object implements MCollection
where:
| Modifier and Type | Class and Description |
|---|---|
class |
CollectionAbstract.DateSorter |
class |
CollectionAbstract.MyStreamFilter |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
auxInfo |
static String |
CATALOG |
protected String |
collectionName |
protected DateExtractor |
dateExtractor |
static String |
DIR |
static String |
FILE |
static String |
GLOB |
protected long |
lastModified |
static String |
LIST |
protected org.slf4j.Logger |
logger |
protected FeatureCollectionConfig.ProtoChoice |
protoChoice |
protected String |
root |
protected DirectoryStream.Filter<Path> |
sfilter |
protected CalendarDate |
startCollection |
| Modifier | Constructor and Description |
|---|---|
protected |
CollectionAbstract(String collectionName,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
static String |
cleanName(String name) |
CalendarDate |
extractDate(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()
Sorted filename
|
String |
getIndexFilename(String suffix) |
long |
getLastModified()
last time this collection was modified
|
MFile |
getLatestFile()
The latest file in the collection.
|
CalendarDate |
getPartitionDate()
The date to partition on, usually the starting date of the collection.
|
int |
getProtoIndex(int n)
Choose Proto dataset as index from [0..n-1], based on configuration.
|
String |
getRoot()
Get common root directory of all MFiles in the collection - may be null
|
boolean |
hasDateExtractor()
Does this CollectionManager have the ability to extract a date from the MFile ?
|
protected List<MFile> |
makeFileListSorted() |
static MCollection |
open(String collectionName,
String collectionSpec,
String olderThan,
Formatter errlog) |
protected long |
parseOlderThanString(String olderThan)
parse the "olderThan" TimeDuration, meaning files must not have been modified since this amount of time
|
void |
putAuxInfo(String key,
Object value) |
void |
setDateExtractor(DateExtractor dateExtractor) |
protected void |
setRoot(String root) |
void |
setStreamFilter(DirectoryStream.Filter<Path> filter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getFileIterator, getFilesSortedpublic static final String CATALOG
public static final String DIR
public static final String FILE
public static final String LIST
public static final String GLOB
protected String collectionName
protected String root
protected final org.slf4j.Logger logger
protected FeatureCollectionConfig.ProtoChoice protoChoice
protected DateExtractor dateExtractor
protected CalendarDate startCollection
protected long lastModified
protected DirectoryStream.Filter<Path> sfilter
protected CollectionAbstract(String collectionName, org.slf4j.Logger logger)
public static MCollection open(String collectionName, String collectionSpec, String olderThan, Formatter errlog) throws IOException
IOExceptionpublic String getCollectionName()
MCollectiongetCollectionName in interface MCollectionpublic String getIndexFilename(String suffix)
getIndexFilename in interface MCollectionpublic void setStreamFilter(DirectoryStream.Filter<Path> filter)
public String getRoot()
MCollectiongetRoot in interface MCollectionprotected void setRoot(String root)
public long getLastModified()
MCollectiongetLastModified in interface MCollectionpublic MFile getLatestFile() throws IOException
MCollectiongetLatestFile in interface MCollectionIOExceptionpublic List<String> getFilenames() throws IOException
MCollectiongetFilenames in interface MCollectionIOExceptionpublic CalendarDate extractDate(MFile mfile)
MCollectionextractDate in interface MCollectionmfile - extract from herepublic boolean hasDateExtractor()
MCollectionhasDateExtractor in interface MCollectionpublic void setDateExtractor(DateExtractor dateExtractor)
public CalendarDate getPartitionDate()
MCollectiongetPartitionDate in interface MCollectionpublic Object getAuxInfo(String key)
getAuxInfo in interface MCollectionpublic void putAuxInfo(String key, Object value)
putAuxInfo in interface MCollectionpublic int getProtoIndex(int n)
MCollectiongetProtoIndex in interface MCollectionn - size to choose fromprotected List<MFile> makeFileListSorted() throws IOException
IOExceptionprotected long parseOlderThanString(String olderThan)
olderThan - TimeDuration string