public class FileSystemConfiguration extends Object
IGFS
configuration. More than one file system can be configured within grid.
IGFS
configuration is provided via IgniteConfiguration.getFileSystemConfiguration()
method.Modifier and Type | Field and Description |
---|---|
static int |
DFLT_BLOCK_SIZE
Default file's data block size (bytes).
|
static int |
DFLT_BUF_SIZE
Default read/write buffers size (bytes).
|
static int |
DFLT_FRAGMENTIZER_CONCURRENT_FILES
Default fragmentizer concurrent files.
|
static boolean |
DFLT_FRAGMENTIZER_ENABLED
Fragmentizer enabled property.
|
static float |
DFLT_FRAGMENTIZER_LOCAL_WRITES_RATIO
Default fragmentizer local writes ratio.
|
static long |
DFLT_FRAGMENTIZER_THROTTLING_BLOCK_LENGTH
Default fragmentizer throttling block length.
|
static long |
DFLT_FRAGMENTIZER_THROTTLING_DELAY
Default fragmentizer throttling delay.
|
static int |
DFLT_IGFS_LOG_BATCH_SIZE
Default batch size for logging.
|
static String |
DFLT_IGFS_LOG_DIR
Default
IGFS log directory. |
static boolean |
DFLT_IPC_ENDPOINT_ENABLED
Default IPC endpoint enabled flag.
|
static int |
DFLT_MGMT_PORT
Default management port.
|
static IgfsMode |
DFLT_MODE
Default IGFS mode.
|
static int |
DFLT_PER_NODE_BATCH_SIZE
Default per node buffer size.
|
static int |
DFLT_PER_NODE_PARALLEL_BATCH_CNT
Default number of per node parallel operations.
|
static long |
DFLT_TRASH_PURGE_TIMEOUT
Default trash directory purge await timeout in case data cache oversize is detected.
|
static String |
DFLT_USER_NAME
Default file system user name.
|
Constructor and Description |
---|
FileSystemConfiguration()
Constructs default configuration.
|
FileSystemConfiguration(FileSystemConfiguration cfg)
Constructs the copy of the configuration.
|
Modifier and Type | Method and Description |
---|---|
int |
getBlockSize()
Get file's data block size.
|
String |
getDataCacheName()
Cache name to store IGFS data.
|
IgfsMode |
getDefaultMode()
Gets mode to specify how
IGFS interacts with Hadoop file system, like HDFS . |
long |
getDualModeMaxPendingPutsSize()
Get maximum amount of pending data read from the secondary file system and waiting to be written to data
cache.
|
ExecutorService |
getDualModePutExecutorService()
Get DUAL mode put operation executor service.
|
boolean |
getDualModePutExecutorServiceShutdown()
Get DUAL mode put operation executor service shutdown flag.
|
int |
getFragmentizerConcurrentFiles()
Gets number of files that can be processed by fragmentizer concurrently.
|
float |
getFragmentizerLocalWritesRatio()
Deprecated.
Parameter is no longer used.
|
long |
getFragmentizerThrottlingBlockLength()
Gets the length of file chunk to send before delaying the fragmentizer.
|
long |
getFragmentizerThrottlingDelay()
Gets throttle delay for fragmentizer.
|
IgfsIpcEndpointConfiguration |
getIpcEndpointConfiguration()
Gets IPC endpoint configuration.
|
int |
getManagementPort()
Gets port number for management endpoint.
|
long |
getMaximumTaskRangeLength()
Get maximum default range size of a file being split during IGFS task execution.
|
long |
getMaxSpaceSize()
Get maximum space available for data cache to store file system entries.
|
String |
getMetaCacheName()
Cache name to store IGFS meta information.
|
String |
getName()
Gets IGFS instance name.
|
Map<String,IgfsMode> |
getPathModes()
Gets map of path prefixes to
IGFS modes used for them. |
int |
getPerNodeBatchSize()
Gets number of file blocks buffered on local node before sending batch to remote node.
|
int |
getPerNodeParallelBatchCount()
Gets number of batches that can be concurrently sent to remote node.
|
int |
getPrefetchBlocks()
Get number of pre-fetched blocks if specific file's chunk is requested.
|
IgfsSecondaryFileSystem |
getSecondaryFileSystem()
Gets the secondary file system.
|
int |
getSequentialReadsBeforePrefetch()
Get amount of sequential block reads before prefetch is triggered.
|
int |
getStreamBufferSize()
Get read/write buffer size for
IGFS stream operations in bytes. |
long |
getTrashPurgeTimeout()
Gets maximum timeout awaiting for trash purging in case data cache oversize is detected.
|
boolean |
isFragmentizerEnabled()
Gets flag indicating whether IGFS fragmentizer is enabled.
|
boolean |
isIpcEndpointEnabled()
Get IPC endpoint enabled flag.
|
void |
setBlockSize(int blockSize)
Sets file's data block size.
|
void |
setDataCacheName(String dataCacheName)
Sets cache name to store IGFS data.
|
void |
setDefaultMode(IgfsMode dfltMode)
Sets
IGFS mode to specify how it should interact with secondary
Hadoop file system, like HDFS . |
void |
setDualModeMaxPendingPutsSize(long dualModeMaxPendingPutsSize)
Set maximum amount of data in pending put operations.
|
void |
setDualModePutExecutorService(ExecutorService dualModePutExec)
Set DUAL mode put operations executor service.
|
void |
setDualModePutExecutorServiceShutdown(boolean dualModePutExecShutdown)
Set DUAL mode put operations executor service shutdown flag.
|
void |
setFragmentizerConcurrentFiles(int fragmentizerConcurrentFiles)
Sets number of files to process concurrently by fragmentizer.
|
void |
setFragmentizerEnabled(boolean fragmentizerEnabled)
Sets property indicating whether fragmentizer is enabled.
|
void |
setFragmentizerLocalWritesRatio(float fragmentizerLocWritesRatio)
Deprecated.
Parameter is no longer used.
|
void |
setFragmentizerThrottlingBlockLength(long fragmentizerThrottlingBlockLen)
Sets length of file chunk to transmit before throttling is delayed.
|
void |
setFragmentizerThrottlingDelay(long fragmentizerThrottlingDelay)
Sets delay in milliseconds for which fragmentizer is paused.
|
void |
setIpcEndpointConfiguration(IgfsIpcEndpointConfiguration ipcEndpointCfg)
Sets IPC endpoint configuration.
|
void |
setIpcEndpointEnabled(boolean ipcEndpointEnabled)
Set IPC endpoint enabled flag.
|
void |
setManagementPort(int mgmtPort)
Sets management endpoint port.
|
void |
setMaximumTaskRangeLength(long maxTaskRangeLen)
Set maximum default range size of a file being split during IGFS task execution.
|
void |
setMaxSpaceSize(long maxSpace)
Set maximum space in bytes available in data cache.
|
void |
setMetaCacheName(String metaCacheName)
Sets cache name to store IGFS meta information.
|
void |
setName(String name)
Sets IGFS instance name.
|
void |
setPathModes(Map<String,IgfsMode> pathModes)
Sets map of path prefixes to
IGFS modes used for them. |
void |
setPerNodeBatchSize(int perNodeBatchSize)
Sets number of file blocks collected on local node before sending batch to remote node.
|
void |
setPerNodeParallelBatchCount(int perNodeParallelBatchCnt)
Sets number of file block batches that can be concurrently sent to remote node.
|
void |
setPrefetchBlocks(int prefetchBlocks)
Sets the number of pre-fetched blocks if specific file's chunk is requested.
|
void |
setSecondaryFileSystem(IgfsSecondaryFileSystem fileSystem)
Sets the secondary file system.
|
void |
setSequentialReadsBeforePrefetch(int seqReadsBeforePrefetch)
Sets amount of sequential block reads before prefetch is triggered.
|
void |
setStreamBufferSize(int bufSize)
Sets read/write buffers size for
IGFS stream operations (bytes). |
void |
setTrashPurgeTimeout(long trashPurgeTimeout)
Sets maximum timeout awaiting for trash purging in case data cache oversize is detected.
|
String |
toString() |
public static final String DFLT_USER_NAME
public static final long DFLT_FRAGMENTIZER_THROTTLING_BLOCK_LENGTH
public static final long DFLT_FRAGMENTIZER_THROTTLING_DELAY
public static final int DFLT_FRAGMENTIZER_CONCURRENT_FILES
public static final float DFLT_FRAGMENTIZER_LOCAL_WRITES_RATIO
public static final boolean DFLT_FRAGMENTIZER_ENABLED
public static final int DFLT_IGFS_LOG_BATCH_SIZE
public static final String DFLT_IGFS_LOG_DIR
IGFS
log directory.public static final int DFLT_PER_NODE_BATCH_SIZE
public static final int DFLT_PER_NODE_PARALLEL_BATCH_CNT
public static final IgfsMode DFLT_MODE
public static final int DFLT_BLOCK_SIZE
public static final int DFLT_BUF_SIZE
public static final long DFLT_TRASH_PURGE_TIMEOUT
public static final int DFLT_MGMT_PORT
public static final boolean DFLT_IPC_ENDPOINT_ENABLED
public FileSystemConfiguration()
public FileSystemConfiguration(FileSystemConfiguration cfg)
cfg
- Configuration to copy.@Nullable public String getName()
null
, then instance with default
name will be used.public void setName(String name)
name
- IGFS instance name.@Nullable public String getMetaCacheName()
null
, then instance
with default meta-cache name will be used.public void setMetaCacheName(String metaCacheName)
metaCacheName
- Cache name to store IGFS meta information.@Nullable public String getDataCacheName()
public void setDataCacheName(String dataCacheName)
dataCacheName
- Cache name to store IGFS data.public int getBlockSize()
public void setBlockSize(int blockSize)
blockSize
- File's data block size (bytes) or 0
to reset default value.public int getPrefetchBlocks()
public void setPrefetchBlocks(int prefetchBlocks)
prefetchBlocks
- New number of pre-fetched blocks.public int getSequentialReadsBeforePrefetch()
Default is 0
which means that pre-fetching will start right away.
fs.igfs.[name].open.sequential_reads_before_prefetch
configuration property directly to Hadoop
MapReduce task.
NOTE: Integration with Hadoop is available only in In-Memory Accelerator For Hadoop
edition.
public void setSequentialReadsBeforePrefetch(int seqReadsBeforePrefetch)
Default is 0
which means that pre-fetching will start right away.
fs.igfs.[name].open.sequential_reads_before_prefetch
configuration property directly to Hadoop
MapReduce task.
NOTE: Integration with Hadoop is available only in In-Memory Accelerator For Hadoop
edition.
seqReadsBeforePrefetch
- Amount of sequential block reads before prefetch is triggered.public int getStreamBufferSize()
IGFS
stream operations in bytes.public void setStreamBufferSize(int bufSize)
IGFS
stream operations (bytes).bufSize
- Read/write buffers size for stream operations (bytes) or 0
to reset default value.public int getPerNodeBatchSize()
public void setPerNodeBatchSize(int perNodeBatchSize)
perNodeBatchSize
- Per node buffer size.public int getPerNodeParallelBatchCount()
public void setPerNodeParallelBatchCount(int perNodeParallelBatchCnt)
perNodeParallelBatchCnt
- Per node parallel load operations.@Nullable public IgfsIpcEndpointConfiguration getIpcEndpointConfiguration()
Endpoint is needed for communication between IGFS and IgniteHadoopFileSystem
shipped with Ignite
Hadoop Accelerator.
public void setIpcEndpointConfiguration(@Nullable IgfsIpcEndpointConfiguration ipcEndpointCfg)
Endpoint is needed for communication between IGFS and IgniteHadoopFileSystem
shipped with Ignite
Hadoop Accelerator.
ipcEndpointCfg
- IPC endpoint configuration.public boolean isIpcEndpointEnabled()
true
endpoint will be created and bound to specific
port. Otherwise endpoint will not be created. Default value is DFLT_IPC_ENDPOINT_ENABLED
.
Endpoint is needed for communication between IGFS and IgniteHadoopFileSystem
shipped with Ignite
Hadoop Accelerator.
True
in case endpoint is enabled.public void setIpcEndpointEnabled(boolean ipcEndpointEnabled)
isIpcEndpointEnabled()
.
Endpoint is needed for communication between IGFS and IgniteHadoopFileSystem
shipped with Ignite
Hadoop Accelerator.
ipcEndpointEnabled
- IPC endpoint enabled flag.public int getManagementPort()
Default value is DFLT_MGMT_PORT
-1
if management endpoint should be disabled.public void setManagementPort(int mgmtPort)
mgmtPort
- port number or -1
to disable management endpoint.public IgfsMode getDefaultMode()
IGFS
interacts with Hadoop file system, like HDFS
.
Secondary Hadoop file system is provided for pass-through, write-through, and read-through
purposes.
Default mode is IgfsMode.DUAL_ASYNC
. If secondary Hadoop file system is
not configured, this mode will work just like IgfsMode.PRIMARY
mode.
public void setDefaultMode(IgfsMode dfltMode)
IGFS
mode to specify how it should interact with secondary
Hadoop file system, like HDFS
. Secondary Hadoop file system is provided
for pass-through, write-through, and read-through purposes.dfltMode
- IGFS
mode.public IgfsSecondaryFileSystem getSecondaryFileSystem()
public void setSecondaryFileSystem(IgfsSecondaryFileSystem fileSystem)
fileSystem
- @Nullable public Map<String,IgfsMode> getPathModes()
IGFS
modes used for them.
If path doesn't correspond to any specified prefix or mappings are not provided, then
getDefaultMode()
is used.
Several folders under '/apache/ignite'
folder have predefined mappings which cannot be overridden.
/apache/ignite/primary
and all it's sub-folders will always work in PRIMARY
mode.And in case secondary file system URI is provided:
/apache/ignite/proxy
and all it's sub-folders will always work in PROXY
mode./apache/ignite/sync
and all it's sub-folders will always work in DUAL_SYNC
mode./apache/ignite/async
and all it's sub-folders will always work in DUAL_ASYNC
mode.IGFS
modes.public void setPathModes(Map<String,IgfsMode> pathModes)
IGFS
modes used for them.
If path doesn't correspond to any specified prefix or mappings are not provided, then
getDefaultMode()
is used.
pathModes
- Map of paths to IGFS
modes.public long getFragmentizerThrottlingBlockLength()
public void setFragmentizerThrottlingBlockLength(long fragmentizerThrottlingBlockLen)
fragmentizerThrottlingBlockLen
- Block length in bytes.public long getFragmentizerThrottlingDelay()
public void setFragmentizerThrottlingDelay(long fragmentizerThrottlingDelay)
fragmentizerThrottlingDelay
- Delay in milliseconds.public int getFragmentizerConcurrentFiles()
public void setFragmentizerConcurrentFiles(int fragmentizerConcurrentFiles)
fragmentizerConcurrentFiles
- Number of files to process concurrently.@Deprecated public float getFragmentizerLocalWritesRatio()
If current IGFS space size is less than fragmentizerLocalWritesRatio * maxSpaceSize
,
then file blocks will be written to the local node first and then asynchronously distributed
among cluster nodes (fragmentized).
Default value is DFLT_FRAGMENTIZER_LOCAL_WRITES_RATIO
.
@Deprecated public void setFragmentizerLocalWritesRatio(float fragmentizerLocWritesRatio)
fragmentizerLocWritesRatio
- Ratio for local file writes.getFragmentizerLocalWritesRatio()
public boolean isFragmentizerEnabled()
public void setFragmentizerEnabled(boolean fragmentizerEnabled)
fragmentizerEnabled
- True
if fragmentizer is enabled.public long getMaxSpaceSize()
public void setMaxSpaceSize(long maxSpace)
maxSpace
- Maximum space available in data cache.public long getTrashPurgeTimeout()
public void setTrashPurgeTimeout(long trashPurgeTimeout)
trashPurgeTimeout
- Maximum timeout awaiting for trash purging in case data cache oversize is detected.@Nullable public ExecutorService getDualModePutExecutorService()
public void setDualModePutExecutorService(ExecutorService dualModePutExec)
dualModePutExec
- Dual mode put operations executor service.public boolean getDualModePutExecutorServiceShutdown()
public void setDualModePutExecutorServiceShutdown(boolean dualModePutExecShutdown)
dualModePutExecShutdown
- Dual mode put operations executor service shutdown flag.public long getDualModeMaxPendingPutsSize()
0
or negative value stands for unlimited size.
By default this value is set to 0
. It is recommended to set positive value in case your
application performs frequent reads of large amount of data from the secondary file system in order to
avoid issues with increasing GC pauses or out-of-memory error.
public void setDualModeMaxPendingPutsSize(long dualModeMaxPendingPutsSize)
dualModeMaxPendingPutsSize
- Maximum amount of data in pending put operations.public long getMaximumTaskRangeLength()
IgfsFileRange
which
has length. In case this parameter is set to positive value, then IGFS will split single file range into smaller
ranges with length not greater that this parameter. The only exception to this case is when maximum task range
length is smaller than file block size. In this case maximum task range size will be overridden and set to file
block size.
Note that this parameter is applied when task is split into jobs before IgfsRecordResolver
is
applied. Therefore, final file ranges being assigned to particular jobs could be greater than value of this
parameter depending on file data layout and selected resolver type.
Setting this parameter might be useful when file is highly colocated and have very long consequent data chunks so that task execution suffers from insufficient parallelism. E.g., in case you have one IGFS node in topology and want to process 1Gb file, then only single range of length 1Gb will be returned. This will result in a single job which will be processed in one thread. But in case you provide this configuration parameter and set maximum range length to 16Mb, then 64 ranges will be returned resulting in 64 jobs which could be executed in parallel.
Note that some IgniteFs.execute()
methods can override value of this parameter.
In case value of this parameter is set to 0
or negative value, it is simply ignored. Default value is
0
.
public void setMaximumTaskRangeLength(long maxTaskRangeLen)
getMaximumTaskRangeLength()
for more details.maxTaskRangeLen
- Set maximum default range size of a file being split during IGFS task execution.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.0.final Release Date : December 29 2015