@CacheLocalStore public class CacheFileLocalStore<K,V> extends Object implements org.apache.ignite.cache.store.CacheStore<K,org.apache.ignite.lang.IgniteBiTuple<V,?>>, org.apache.ignite.lifecycle.LifecycleAware
CacheStore implementation. Internally it uses compact offheap map for key hashes and
pointers to append-only update log files. When log file becomes too sparse (contains too many entries that have
already been removed) it will be compacted by a background process.
setWriteMode(CacheFileLocalStoreWriteMode)setWriteDelay(long)setWriteBufferSize(int)setFsyncDelay(long)setReadBufferSize(int)setCompactBufferSize(int)setMinCompactSize(long)setMaxSparsity(float)setSparsityCheckFrequency(long)setRootPath(String)setChecksum(boolean)setMapCapacity(int)setMapSegments(int)
...
GridCacheStore<String, GridTuple2<String, ?>> store = new CacheFileLocalStore<String, String>();
...
...
<bean id="cache.local.store"
class="CacheFileLocalStore">
</bean>
...
For information about Spring framework visit www.springframework.org
| Modifier and Type | Field and Description |
|---|---|
protected String |
cacheName |
static CacheFileLocalStoreWriteMode |
DFLT_COMMIT_MODE
Default write mode.
|
static int |
DFLT_COMPACT_BUFFER_SIZE
Default compact buffer size.
|
static int |
DFLT_FSYNC_DELAY
Default value for fsync delay in milliseconds.
|
static int |
DFLT_MAP_CAPACITY
Default map capacity.
|
static int |
DFLT_MAP_SEGMENTS
Default number of map segments.
|
static float |
DFLT_MAX_SPARSITY
Default maximum sparsity.
|
static long |
DFLT_MIN_COMPACT_SIZE
Default minimum compaction size.
|
static int |
DFLT_READ_BUFFER_SIZE
Default read buffer size.
|
static String |
DFLT_ROOT_PATH
Default root path for file storage.
|
static long |
DFLT_SPARSITY_CHECK_FREQUENCY
Default sparsity check frequency.
|
static boolean |
DFLT_USE_CONSISTENT_ID
Default use consistent ID for store path.
|
static int |
DFLT_WRITE_BUFFER_SIZE
Default write buffer size.
|
static int |
DFLT_WRITE_DELAY
Default value for write delay in microseconds.
|
protected org.apache.ignite.Ignite |
ignite |
protected org.apache.ignite.IgniteLogger |
log |
| Constructor and Description |
|---|
CacheFileLocalStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Object key) |
void |
deleteAll(Collection<?> keys) |
int |
getCompactBufferSize()
Gets compact buffer size.
|
long |
getFsyncDelay()
Gets maximum delay in milliseconds after which fsync will be issued after a write to a file.
|
int |
getMapCapacity()
Gets initial internal hash map capacity.
|
int |
getMapSegments()
Gets number of map segments.
|
float |
getMaxSparsity()
Gets maximum allowed file sparsity above which compaction has to start.
|
long |
getMinCompactSize()
Gets minimum file size for compaction.
|
int |
getReadBufferSize()
Gets read buffer size.
|
String |
getRootPath()
Gets root directory path for storage.
|
long |
getSparsityCheckFrequency()
Gets frequency to check sparsity of files for compaction.
|
boolean |
getUseConsistentId() |
int |
getWriteBufferSize()
Gets write buffer size in bytes.
|
long |
getWriteDelay()
Gets write delay after which write buffer can be flushed to the disk.
|
CacheFileLocalStoreWriteMode |
getWriteMode()
Gets write mode.
|
boolean |
isChecksum()
Gets whether checksum calculation is enabled.
|
@Nullable org.apache.ignite.lang.IgniteBiTuple<V,?> |
load(K key) |
Map<K,org.apache.ignite.lang.IgniteBiTuple<V,?>> |
loadAll(Iterable<? extends K> keys) |
void |
loadCache(org.apache.ignite.lang.IgniteBiInClosure<K,org.apache.ignite.lang.IgniteBiTuple<V,?>> clo,
Object... args) |
void |
sessionEnd(boolean commit) |
void |
setChecksum(boolean checksum)
Enables or disables checksum calculation for entries on disk.
|
void |
setCompactBufferSize(int compactBufSize)
Sets compact buffer size.
|
void |
setFsyncDelay(long fsyncDelay)
Sets maximum delay in milliseconds after which fsync will be issued after a write to a file.
|
void |
setMapCapacity(int mapCap)
Sets initial internal hash map capacity.
|
void |
setMapSegments(int mapSegments)
Sets number of map segments.
|
void |
setMaxSparsity(float maxSparsity)
Sets maximum allowed file sparsity above which compaction has to start.
|
void |
setMinCompactSize(long minCompactSize)
Sets minimum file size for compaction.
|
void |
setReadBufferSize(int readBufSize)
Sets read buffer size.
|
void |
setRootPath(String rootPath)
Sets root directory path for storage.
|
void |
setSparsityCheckFrequency(long sparsityCheckFreq)
Sets frequency to check sparsity of files for compaction.
|
void |
setUseConsistentId(Boolean useConsistentId)
Sets use consistent ID flag.
|
void |
setWriteBufferSize(int writeBufSize)
Sets write buffer size in bytes.
|
void |
setWriteDelay(long writeDelay)
Sets write delay after which write buffer can be flushed to the disk.
|
void |
setWriteMode(CacheFileLocalStoreWriteMode writeMode)
Sets write mode.
|
void |
start() |
void |
stop() |
String |
toString() |
void |
write(javax.cache.Cache.Entry<? extends K,? extends org.apache.ignite.lang.IgniteBiTuple<V,?>> entry) |
void |
writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends org.apache.ignite.lang.IgniteBiTuple<V,?>>> entries) |
public static final int DFLT_FSYNC_DELAY
public static final int DFLT_WRITE_DELAY
public static final CacheFileLocalStoreWriteMode DFLT_COMMIT_MODE
public static final int DFLT_WRITE_BUFFER_SIZE
public static final int DFLT_READ_BUFFER_SIZE
public static final long DFLT_SPARSITY_CHECK_FREQUENCY
public static final int DFLT_COMPACT_BUFFER_SIZE
public static final int DFLT_MAP_CAPACITY
public static final int DFLT_MAP_SEGMENTS
public static final float DFLT_MAX_SPARSITY
public static final long DFLT_MIN_COMPACT_SIZE
public static final boolean DFLT_USE_CONSISTENT_ID
public static final String DFLT_ROOT_PATH
IGNITE_HOME/work folder
if IGNITE_HOME system or environment variable specified, otherwise it is relative to
work folder under system java.io.tmpdir folder.IgniteConfiguration.getWorkDirectory(),
Constant Field Values@IgniteInstanceResource @GridToStringExclude protected org.apache.ignite.Ignite ignite
@CacheNameResource protected String cacheName
@LoggerResource protected org.apache.ignite.IgniteLogger log
public int getWriteBufferSize()
public void setWriteBufferSize(int writeBufSize)
writeBufSize - Buffer size.public int getReadBufferSize()
public void setReadBufferSize(int readBufSize)
readBufSize - Buffer size.public int getCompactBufferSize()
setWriteBufferSize(int) size.public void setCompactBufferSize(int compactBufSize)
setWriteBufferSize(int) size.compactBufSize - Buffer size.public long getSparsityCheckFrequency()
public void setSparsityCheckFrequency(long sparsityCheckFreq)
sparsityCheckFreq - Sparsity check frequency in milliseconds.setMaxSparsity(float)public long getFsyncDelay()
0 then fsync will be issued immediately.public void setFsyncDelay(long fsyncDelay)
0 then fsync will be issued immediately.fsyncDelay - Fsync delay in milliseconds.public long getWriteDelay()
CacheFileLocalStoreWriteMode.SYNC_BUFFERED and
CacheFileLocalStoreWriteMode.ASYNC_BUFFERED write modes.public void setWriteDelay(long writeDelay)
CacheFileLocalStoreWriteMode.SYNC_BUFFERED and
CacheFileLocalStoreWriteMode.ASYNC_BUFFERED write modes.writeDelay - Write delay in microseconds.public CacheFileLocalStoreWriteMode getWriteMode()
CacheFileLocalStoreWriteModepublic void setWriteMode(CacheFileLocalStoreWriteMode writeMode)
writeMode - Write mode.CacheFileLocalStoreWriteModepublic float getMaxSparsity()
0 and 1.public void setMaxSparsity(float maxSparsity)
0 and 1.maxSparsity - Maximum sparsity.public long getMinCompactSize()
public void setMinCompactSize(long minCompactSize)
minCompactSize - Minimum compact size.public boolean isChecksum()
public void setChecksum(boolean checksum)
checksum - Checksum flag.public int getMapCapacity()
public void setMapCapacity(int mapCap)
mapCap - Initial map capacity.public int getMapSegments()
public void setMapSegments(int mapSegments)
mapSegments - Number of map segments.public String getRootPath()
public void setRootPath(String rootPath)
rootPath - Root path.public void setUseConsistentId(Boolean useConsistentId)
ClusterNode.consistentId().useConsistentId - Use consistent ID flag.public boolean getUseConsistentId()
public void start()
start in interface org.apache.ignite.lifecycle.LifecycleAwarepublic void stop()
stop in interface org.apache.ignite.lifecycle.LifecycleAwarepublic void loadCache(org.apache.ignite.lang.IgniteBiInClosure<K,org.apache.ignite.lang.IgniteBiTuple<V,?>> clo, @Nullable Object... args)
public void write(javax.cache.Cache.Entry<? extends K,? extends org.apache.ignite.lang.IgniteBiTuple<V,?>> entry)
public void writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends org.apache.ignite.lang.IgniteBiTuple<V,?>>> entries)
public void delete(Object key)
public void deleteAll(Collection<?> keys)
public void sessionEnd(boolean commit)
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024