public class DirectoryPartition extends CollectionAbstract implements PartitionManager
CollectionAbstract.DateSorter, CollectionAbstract.MyStreamFilter
auxInfo, CATALOG, collectionName, dateExtractor, DIR, FILE, GLOB, lastModified, LIST, logger, NCX_SUFFIX, protoChoice, root, sfilter, startCollection
Constructor and Description |
---|
DirectoryPartition(FeatureCollectionConfig config,
Path collectionDir,
boolean isTop,
IndexReader indexReader,
org.slf4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close and release any resources.
|
CloseableIterator<MFile> |
getFileIterator()
Get the current collection of MFile, no guaranteed order.
|
Iterable<MFile> |
getFilesSorted()
Get the current collection of MFile.
|
String |
getIndexFilename() |
String |
getRoot()
Get common root directory of all MFiles in the collection - may be null
|
Iterable<MCollection> |
makePartitions(CollectionUpdateType forceCollection) |
void |
removePartition(MCollection partition) |
cleanName, extractDate, getAuxInfo, getCollectionName, getFilenames, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, hasDateExtractor, makeFileListSorted, open, parseOlderThanString, putAuxInfo, setDateExtractor, setRoot, setStreamFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
extractDate, getAuxInfo, getCollectionName, getFilenames, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, hasDateExtractor, putAuxInfo
public DirectoryPartition(FeatureCollectionConfig config, Path collectionDir, boolean isTop, IndexReader indexReader, org.slf4j.Logger logger)
public String getIndexFilename()
getIndexFilename
in interface MCollection
getIndexFilename
in class CollectionAbstract
public Iterable<MCollection> makePartitions(CollectionUpdateType forceCollection) throws IOException
makePartitions
in interface PartitionManager
IOException
public String getRoot()
MCollection
getRoot
in interface MCollection
getRoot
in class CollectionAbstract
public Iterable<MFile> getFilesSorted() throws IOException
MCollection
getFilesSorted
in interface MCollection
IOException
public CloseableIterator<MFile> getFileIterator() throws IOException
MCollection
try (CloseableIteratoriter = getFileIterator()) { while (iter.hasNext()) { MFile file = iter.next(); } }
getFileIterator
in interface MCollection
IOException
public void close()
MCollection
close
in interface AutoCloseable
close
in interface MCollection
public void removePartition(MCollection partition)
removePartition
in interface PartitionManager
Copyright © 1999–2018 UCAR/Unidata. All rights reserved.