Package ucar.nc2.iosp.zarr
Class ZarrIosp
- java.lang.Object
-
- ucar.nc2.iosp.AbstractIOServiceProvider
-
- ucar.nc2.iosp.zarr.ZarrIosp
-
- All Implemented Interfaces:
Comparable<IOServiceProvider>
,IOServiceProvider
public class ZarrIosp extends AbstractIOServiceProvider
IOSP for reading/writing Zarr/NCZarr formats
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ucar.nc2.iosp.IOServiceProvider
IOServiceProvider.SortGroup
-
-
Field Summary
-
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
location, ncfile, raf, rafOrder
-
-
Constructor Summary
Constructors Constructor Description ZarrIosp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
build(RandomAccessFile raf, Group.Builder rootGroup, CancelTask cancelTask)
Open existing file, and populate it.void
buildFinish(NetcdfFile ncfile)
Sometimes the builder needs access to the finished objects.String
getFileTypeDescription()
Get a human-readable description for this file type.String
getFileTypeId()
Get a unique id for this file type.long
getLastModified()
Returns the time that the underlying file(s) were last modified.IOServiceProvider.SortGroup
getSortGroup()
Set the SortGroup to GROUP_1 so this IOSP will be checked first, since `isValidFile()` is a quick checkboolean
isBuilder()
If this iosp implements build().boolean
isValidFile(RandomAccessFile raf)
Check if this is a valid file for this IOServiceProvider.Array
readData(Variable v2, Section section)
Read data from a top level Variable and return a memory resident Array.-
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
close, getDetailInfo, getFileTypeVersion, getStructureIterator, open, reacquire, readSection, readToByteChannel, readToOutputStream, release, sendIospMessage, setNetcdfFile, streamToByteChannel, syncExtend, toStringDebug
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.iosp.IOServiceProvider
compareTo
-
-
-
-
Method Detail
-
isValidFile
public boolean isValidFile(RandomAccessFile raf)
Description copied from interface:IOServiceProvider
Check if this is a valid file for this IOServiceProvider. You must make this method thread safe, ie dont keep any state.- Parameters:
raf
- RandomAccessFile- Returns:
- true if valid.
-
getSortGroup
public IOServiceProvider.SortGroup getSortGroup()
Set the SortGroup to GROUP_1 so this IOSP will be checked first, since `isValidFile()` is a quick check- Returns:
- SortGroup.GROUP_1
-
getFileTypeId
public String getFileTypeId()
Description copied from interface:IOServiceProvider
Get a unique id for this file type.- Returns:
- registered id of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
getFileTypeDescription
public String getFileTypeDescription()
Description copied from interface:IOServiceProvider
Get a human-readable description for this file type.- Returns:
- description of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
isBuilder
public boolean isBuilder()
Description copied from interface:IOServiceProvider
If this iosp implements build().- Specified by:
isBuilder
in interfaceIOServiceProvider
- Overrides:
isBuilder
in classAbstractIOServiceProvider
-
build
public void build(RandomAccessFile raf, Group.Builder rootGroup, CancelTask cancelTask) throws IOException
Description copied from interface:IOServiceProvider
Open existing file, and populate it. Note that you cannot reference the NetcdfFile within this routine. This is the bridge to immutable objects that will be used exclusively in version 6.- Specified by:
build
in interfaceIOServiceProvider
- Overrides:
build
in classAbstractIOServiceProvider
- Parameters:
raf
- the file to work on, it has already passed the isValidFile() test.rootGroup
- add objects to the root group.cancelTask
- used to monitor user cancellation; may be null.- Throws:
IOException
- if read error
-
buildFinish
public void buildFinish(NetcdfFile ncfile)
Description copied from interface:IOServiceProvider
Sometimes the builder needs access to the finished objects. This is called after ncfile.build()- Specified by:
buildFinish
in interfaceIOServiceProvider
- Overrides:
buildFinish
in classAbstractIOServiceProvider
-
readData
public Array readData(Variable v2, Section section)
Description copied from interface:IOServiceProvider
Read data from a top level Variable and return a memory resident Array. This Array has the same element type as the Variable, and the requested shape.- Parameters:
v2
- a top-level Variablesection
- the section of data to read. There must be a Range for each Dimension in the variable, in order. Note: no nulls allowed. IOSP may not modify.- Returns:
- the requested data in a memory-resident Array
- See Also:
Range
-
getLastModified
public long getLastModified()
Description copied from class:AbstractIOServiceProvider
Returns the time that the underlying file(s) were last modified. If they've changed since they were stored in the cache, they will be closed and reopened withFileFactory
.- Overrides:
getLastModified
in classAbstractIOServiceProvider
- Returns:
- a
long
value representing the time the file(s) were last modified or0L
if the last-modified time couldn't be determined for any reason.
-
-