Package ucar.nc2.grib
Class GribIndex
- java.lang.Object
-
- ucar.nc2.grib.GribIndex
-
- Direct Known Subclasses:
Grib1Index
,Grib2Index
public abstract class GribIndex extends Object
Abstract superclass for Grib1Index and Grib2Index. Handles gbx9 index for grib. Static methods for creating gbx9 indices for a single file.- Since:
- 9/5/11
-
-
Constructor Summary
Constructors Constructor Description GribIndex()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CollectionManager.ChangeChecker
getChangeChecker()
abstract int
getNRecords()
The number of records in the index.abstract boolean
makeIndex(String location, RandomAccessFile dataRaf)
Make the gbx9 index file.static GribIndex
open(boolean isGrib1, MFile mfile)
abstract boolean
readIndex(String location, long dataModified, CollectionUpdateType force)
Read the gbx9 index file.static GribIndex
readOrCreateIndexFromSingleFile(boolean isGrib1, MFile mfile, CollectionUpdateType force, org.slf4j.Logger logger)
Create a gbx9 index from a single grib1 or grib2 file.
-
-
-
Field Detail
-
GBX9_IDX
public static final String GBX9_IDX
- See Also:
- Constant Field Values
-
debug
public static final boolean debug
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChangeChecker
public static CollectionManager.ChangeChecker getChangeChecker()
-
readOrCreateIndexFromSingleFile
public static GribIndex readOrCreateIndexFromSingleFile(boolean isGrib1, MFile mfile, CollectionUpdateType force, org.slf4j.Logger logger) throws IOException
Create a gbx9 index from a single grib1 or grib2 file. Use the existing index if it already exists.- Parameters:
isGrib1
- true if grib1mfile
- the grib fileforce
- force writing index- Returns:
- the resulting GribIndex
- Throws:
IOException
- on io error
-
readIndex
public abstract boolean readIndex(String location, long dataModified, CollectionUpdateType force)
Read the gbx9 index file.- Parameters:
location
- location of the data filedataModified
- last modified date of the data fileforce
- rewrite? always, test, nocheck, never- Returns:
- true if index was successfully read, false if index must be (re)created
-
makeIndex
public abstract boolean makeIndex(String location, RandomAccessFile dataRaf) throws IOException
Make the gbx9 index file.- Parameters:
location
- location of the data filedataRaf
- already opened data raf (leave open); if null, makeIndex opens and closes)- Returns:
- true
- Throws:
IOException
- on io error
-
getNRecords
public abstract int getNRecords()
The number of records in the index.- Returns:
- The number of records in the index.
-
-