Package org.infinispan.io
Class GridFilesystem
java.lang.Object
org.infinispan.io.GridFilesystem
Deprecated, for removal: This API element is subject to removal in a future version.
since 10.0
Entry point for GridFile and GridInputStream / GridOutputStream
- Author:
- Bela Ban, Marko Luksa
-
Field Summary
Modifier and TypeFieldDescriptionDeprecated, for removal: This API element is subject to removal in a future version.protected final int
Deprecated, for removal: This API element is subject to removal in a future version.protected final Cache
<String, GridFile.Metadata> Deprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorDescriptionGridFilesystem
(Cache<String, byte[]> data, Cache<String, GridFile.Metadata> metadata) Deprecated, for removal: This API element is subject to removal in a future version.GridFilesystem
(Cache<String, byte[]> data, Cache<String, GridFile.Metadata> metadata, int defaultChunkSize) Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Returns the file denoted by pathname.Deprecated, for removal: This API element is subject to removal in a future version.Returns the file denoted by pathname.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Opens an InputStream for reading from the given file.Deprecated, for removal: This API element is subject to removal in a future version.Opens an InputStream for reading from the file denoted by pathname.Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the file denoted by pathname.Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the file denoted by pathname.Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the file denoted by pathname.Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the given file.getReadableChannel
(String pathname) Deprecated, for removal: This API element is subject to removal in a future version.Opens a ReadableGridFileChannel for reading from the file denoted by the given file path.getWritableChannel
(String pathname) Deprecated, for removal: This API element is subject to removal in a future version.Opens a WritableGridFileChannel for writing to the file denoted by pathname.getWritableChannel
(String pathname, boolean append) Deprecated, for removal: This API element is subject to removal in a future version.Opens a WritableGridFileChannel for writing to the file denoted by pathname.getWritableChannel
(String pathname, boolean append, int chunkSize) Deprecated, for removal: This API element is subject to removal in a future version.Opens a WritableGridFileChannel for writing to the file denoted by pathname.
-
Field Details
-
data
Deprecated, for removal: This API element is subject to removal in a future version. -
metadata
Deprecated, for removal: This API element is subject to removal in a future version. -
defaultChunkSize
protected final int defaultChunkSizeDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
GridFilesystem
public GridFilesystem(Cache<String, byte[]> data, Cache<String, GridFile.Metadata> metadata, int defaultChunkSize) Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance. The data and metadata caches should already have been setup and started- Parameters:
data
- the cache where the actual file contents are storedmetadata
- the cache where file meta-data is storeddefaultChunkSize
- the default size of the file chunks
-
GridFilesystem
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getFile
Deprecated, for removal: This API element is subject to removal in a future version.Returns the file denoted by pathname.- Parameters:
pathname
- the full path of the requested file- Returns:
- the File stored at pathname
-
getFile
Deprecated, for removal: This API element is subject to removal in a future version.Returns the file denoted by pathname. If the file does not yet exist, it is initialized with the given chunkSize. However, if the file at pathname already exists, the chunkSize parameter is ignored and the file's actual chunkSize is used.- Parameters:
pathname
- the full path of the requested filechunkSize
- the size of the file's chunks. This parameter is only used for non-existing files.- Returns:
- the File stored at pathname
-
getFile
Deprecated, for removal: This API element is subject to removal in a future version. -
getFile
Deprecated, for removal: This API element is subject to removal in a future version. -
getFile
Deprecated, for removal: This API element is subject to removal in a future version. -
getFile
Deprecated, for removal: This API element is subject to removal in a future version. -
getOutput
Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the file denoted by pathname. If a file at pathname already exists, writing to the returned OutputStream will overwrite the contents of the file.- Parameters:
pathname
- the path to write to- Returns:
- an OutputStream for writing to the file at pathname
- Throws:
IOException
- if an error occurs
-
getOutput
Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the file denoted by pathname. The OutputStream can either overwrite the existing file or append to it.- Parameters:
pathname
- the path to write toappend
- if true, the bytes written to the OutputStream will be appended to the end of the file. If false, the bytes will overwrite the original contents.- Returns:
- an OutputStream for writing to the file at pathname
- Throws:
IOException
- if an error occurs
-
getOutput
Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the file denoted by pathname.- Parameters:
pathname
- the file to write toappend
- if true, the bytes written to the OutputStream will be appended to the end of the filechunkSize
- the size of the file's chunks. This parameter is honored only when the file at pathname does not yet exist. If the file already exists, the file's own chunkSize has precedence.- Returns:
- the OutputStream for writing to the file
- Throws:
IOException
- if the file is a directory, cannot be created or some other error occurs
-
getOutput
Deprecated, for removal: This API element is subject to removal in a future version.Opens an OutputStream for writing to the given file.- Parameters:
file
- the file to write to- Returns:
- an OutputStream for writing to the file
- Throws:
IOException
- if an error occurs
-
getInput
Deprecated, for removal: This API element is subject to removal in a future version.Opens an InputStream for reading from the file denoted by pathname.- Parameters:
pathname
- the full path of the file to read from- Returns:
- an InputStream for reading from the file
- Throws:
FileNotFoundException
- if the file does not exist or is a directory
-
getInput
Deprecated, for removal: This API element is subject to removal in a future version.Opens an InputStream for reading from the given file.- Parameters:
file
- the file to open for reading- Returns:
- an InputStream for reading from the file
- Throws:
FileNotFoundException
- if the file does not exist or is a directory
-
getReadableChannel
Deprecated, for removal: This API element is subject to removal in a future version.Opens a ReadableGridFileChannel for reading from the file denoted by the given file path. One of the benefits of using a channel over an InputStream is the possibility to randomly seek to any position in the file (see #ReadableGridChannel.position()).- Parameters:
pathname
- path of the file to open for reading- Returns:
- a ReadableGridFileChannel for reading from the file
- Throws:
FileNotFoundException
- if the file does not exist or is a directory
-
getWritableChannel
Deprecated, for removal: This API element is subject to removal in a future version.Opens a WritableGridFileChannel for writing to the file denoted by pathname. If a file at pathname already exists, writing to the returned channel will overwrite the contents of the file.- Parameters:
pathname
- the path to write to- Returns:
- a WritableGridFileChannel for writing to the file at pathname
- Throws:
IOException
- if an error occurs
-
getWritableChannel
public WritableGridFileChannel getWritableChannel(String pathname, boolean append) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Opens a WritableGridFileChannel for writing to the file denoted by pathname. The channel can either overwrite the existing file or append to it.- Parameters:
pathname
- the path to write toappend
- if true, the bytes written to the WritableGridFileChannel will be appended to the end of the file. If false, the bytes will overwrite the original contents.- Returns:
- a WritableGridFileChannel for writing to the file at pathname
- Throws:
IOException
- if an error occurs
-
getWritableChannel
public WritableGridFileChannel getWritableChannel(String pathname, boolean append, int chunkSize) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Opens a WritableGridFileChannel for writing to the file denoted by pathname.- Parameters:
pathname
- the file to write toappend
- if true, the bytes written to the channel will be appended to the end of the filechunkSize
- the size of the file's chunks. This parameter is honored only when the file at pathname does not yet exist. If the file already exists, the file's own chunkSize has precedence.- Returns:
- a WritableGridFileChannel for writing to the file
- Throws:
IOException
- if the file is a directory, cannot be created or some other error occurs
-