@ThreadSafe public abstract class GribCollection extends Object implements FileCacheable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GribCollection.GcNetcdfFile |
class |
GribCollection.GroupHcs |
static class |
GribCollection.Record |
class |
GribCollection.VariableIndex |
| Modifier and Type | Field and Description |
|---|---|
int |
backProcessId |
int |
center |
protected File |
directory |
int |
genProcessId |
int |
genProcessType |
protected FeatureCollectionConfig.GribConfig |
gribConfig |
List<GribCollection.GroupHcs> |
groups |
protected RandomAccessFile |
indexRaf |
protected boolean |
isGrib1 |
int |
local |
int |
master |
static long |
MISSING_RECORD |
protected String |
name |
static String |
NCX_IDX |
protected FileCache |
objCache |
List<Parameter> |
params |
int |
subcenter |
int |
version |
| Modifier | Constructor and Description |
|---|---|
protected |
GribCollection(String name,
File directory,
FeatureCollectionConfig.GribConfig dcm,
boolean isGrib1) |
| Modifier and Type | Method and Description |
|---|---|
static int |
calcIndex(int timeIdx,
int ensIdx,
int vertIdx,
int flag,
EnsCoord ec,
VertCoord vc,
EnsCoord ecp,
VertCoord vcp)
Find index in partition dataset when vert and/or ens coordinates dont match with proto
|
static int |
calcIndex(int timeIdx,
int ensIdx,
int vertIdx,
int nens,
int nverts) |
void |
close() |
static GribCollection |
createFromIndex(boolean isGrib1,
String name,
File directory,
RandomAccessFile raf,
FeatureCollectionConfig.GribConfig config,
org.slf4j.Logger logger) |
static void |
disableDataRafCache() |
static GribCollection |
factory(boolean isGrib1,
CollectionManager dcm,
CollectionManager.Force force,
org.slf4j.Logger logger)
Create a GribCollection from a collection of grib files
|
GribCollection.GroupHcs |
findGroupById(String id) |
int |
findGroupIdxById(String id) |
MFile |
findMFileByName(String filename) |
int |
getBackProcessId() |
int |
getCenter() |
RandomAccessFile |
getDataRaf(int fileno) |
static FileCache |
getDataRafCache() |
File |
getDirectory() |
static DiskCache2 |
getDiskCache2() |
List<String> |
getFilenames() |
List<MFile> |
getFiles() |
int |
getGenProcessId() |
int |
getGenProcessType() |
abstract GridDataset |
getGridDataset(String groupName,
String filename,
FeatureCollectionConfig.GribConfig gribConfig,
org.slf4j.Logger logger) |
GribCollection.GroupHcs |
getGroup(int index) |
List<GribCollection.GroupHcs> |
getGroups() |
File |
getIndexFile()
get index file; may not exist
|
static File |
getIndexFile(CollectionManager dcm) |
static File |
getIndexFile(String path) |
long |
getLastModified() |
int |
getLocal() |
String |
getLocation() |
int |
getMaster() |
String |
getName() |
abstract NetcdfDataset |
getNetcdfDataset(String groupName,
String filename,
FeatureCollectionConfig.GribConfig gribConfig,
org.slf4j.Logger logger) |
List<Parameter> |
getParams() |
int |
getSubcenter() |
static void |
initDataRafCache(int minElementsInMemory,
int maxElementsInMemory,
int period) |
boolean |
isGrib1() |
GribCollection.GroupHcs |
makeGroup() |
File |
makeNewIndexFile(org.slf4j.Logger logger) |
GribCollection.VariableIndex |
makeVariableIndex(GribCollection.GroupHcs g,
int tableVersion,
int discipline,
int category,
int parameter,
int levelType,
boolean isLayer,
int intvType,
String intvName,
int ensDerivedType,
int probType,
String probabilityName,
int genProcessType,
int cdmHash,
int timeIdx,
int vertIdx,
int ensIdx,
long recordsPos,
int recordsLen) |
static void |
setDiskCache2(DiskCache2 dc) |
void |
setFileCache(FileCache fileCache) |
void |
setFiles(List<MFile> files) |
void |
setIndexRaf(RandomAccessFile indexRaf)
public by accident, do not use
|
void |
showIndex(Formatter f) |
String |
toString() |
static boolean |
update(boolean isGrib1,
CollectionManager dcm,
org.slf4j.Logger logger) |
public static final String NCX_IDX
public static final long MISSING_RECORD
protected final String name
protected final File directory
protected final FeatureCollectionConfig.GribConfig gribConfig
protected final boolean isGrib1
protected FileCache objCache
public int version
public int center
public int subcenter
public int master
public int local
public int genProcessType
public int genProcessId
public int backProcessId
public List<GribCollection.GroupHcs> groups
protected RandomAccessFile indexRaf
protected GribCollection(String name, File directory, FeatureCollectionConfig.GribConfig dcm, boolean isGrib1)
public static void initDataRafCache(int minElementsInMemory,
int maxElementsInMemory,
int period)
public static FileCache getDataRafCache()
public static void disableDataRafCache()
public static File getIndexFile(CollectionManager dcm)
public static void setDiskCache2(DiskCache2 dc)
public static DiskCache2 getDiskCache2()
public static int calcIndex(int timeIdx,
int ensIdx,
int vertIdx,
int nens,
int nverts)
public static int calcIndex(int timeIdx,
int ensIdx,
int vertIdx,
int flag,
EnsCoord ec,
VertCoord vc,
EnsCoord ecp,
VertCoord vcp)
timeIdx - time index in this partitionensIdx - ensemble index in proto datasetvertIdx - vert index in proto datasetflag - TimePartition.VERT_COORDS_DIFFER and/or TimePartition.ENS_COORDS_DIFFERec - ensemble coord in partition datasetvc - vert coord in partition datasetecp - ensemble coord in proto datasetvcp - vert coord in proto datasetpublic static GribCollection factory(boolean isGrib1, CollectionManager dcm, CollectionManager.Force force, org.slf4j.Logger logger) throws IOException
isGrib1 - true if files are grib1, else grib2dcm - the file collection : assume its been scannedforce - should index file be used or remade?IOException - on io errorpublic static GribCollection createFromIndex(boolean isGrib1, String name, File directory, RandomAccessFile raf, FeatureCollectionConfig.GribConfig config, org.slf4j.Logger logger) throws IOException
IOExceptionpublic static boolean update(boolean isGrib1,
CollectionManager dcm,
org.slf4j.Logger logger)
throws IOException
IOExceptionpublic String getName()
public void setIndexRaf(RandomAccessFile indexRaf)
indexRaf - the open raf of the index filepublic File getIndexFile()
public File makeNewIndexFile(org.slf4j.Logger logger)
public List<GribCollection.GroupHcs> getGroups()
public int getCenter()
public int getSubcenter()
public int getMaster()
public int getLocal()
public int getGenProcessType()
public int getGenProcessId()
public int getBackProcessId()
public boolean isGrib1()
public File getDirectory()
public abstract NetcdfDataset getNetcdfDataset(String groupName, String filename, FeatureCollectionConfig.GribConfig gribConfig, org.slf4j.Logger logger) throws IOException
IOExceptionpublic abstract GridDataset getGridDataset(String groupName, String filename, FeatureCollectionConfig.GribConfig gribConfig, org.slf4j.Logger logger) throws IOException
IOExceptionpublic GribCollection.GroupHcs getGroup(int index)
public GribCollection.GroupHcs findGroupById(String id)
public int findGroupIdxById(String id)
public RandomAccessFile getDataRaf(int fileno) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface FileCacheableIOExceptionpublic String getLocation()
getLocation in interface FileCacheablepublic long getLastModified()
getLastModified in interface FileCacheablepublic void setFileCache(FileCache fileCache)
setFileCache in interface FileCacheablepublic GribCollection.VariableIndex makeVariableIndex(GribCollection.GroupHcs g, int tableVersion, int discipline, int category, int parameter, int levelType, boolean isLayer, int intvType, String intvName, int ensDerivedType, int probType, String probabilityName, int genProcessType, int cdmHash, int timeIdx, int vertIdx, int ensIdx, long recordsPos, int recordsLen)
public void showIndex(Formatter f)
public GribCollection.GroupHcs makeGroup()
Copyright © 1999-2013 UCAR/Unidata. All Rights Reserved.