Constructor and Description |
---|
MapKeyLoader(String mapName,
OperationService opService,
IPartitionService ps,
ClusterService clusterService,
ExecutionService execService,
IFunction<Object,Data> serialize) |
Modifier and Type | Method and Description |
---|---|
boolean |
isKeyLoadFinished()
Returns
true if there is no ongoing key loading and dispatching
task on this map key loader. |
void |
promoteToLoadedOnMigration()
Advances the state of the map key loader to
State#LOADED |
void |
setHasBackup(boolean hasBackup)
Sets if this map is configured with at least one backup.
|
void |
setMapOperationProvider(MapOperationProvider operationProvider) |
void |
setMaxBatch(int maxBatch)
Sets the maximum size of a batch of loaded keys sent
to the partition owner for value loading.
|
void |
setMaxSize(int maxSize)
Sets the configured maximum entry count per node.
|
boolean |
shouldDoInitialLoad()
Returns
true if the keys are not loaded yet, promoting this key
loader and resetting the loading state if necessary in the process. |
Future |
startInitialLoad(MapStoreContext mapStoreContext,
int partitionId)
Triggers key loading on the map key loader with the
Role#SENDER
role. |
Future<?> |
startLoading(MapStoreContext mapStoreContext,
boolean replaceExistingValues)
Triggers key and value loading if there is no ongoing or completed
key loading task, otherwise does nothing.
|
void |
trackLoading(boolean lastBatch,
Throwable exception)
Advances the state of this map key loader and sets the
keyLoadFinished
result if the lastBatch is true . |
void |
triggerLoadingWithDelay()
Triggers key loading on SENDER if it hadn't started.
|
public MapKeyLoader(String mapName, OperationService opService, IPartitionService ps, ClusterService clusterService, ExecutionService execService, IFunction<Object,Data> serialize)
public Future startInitialLoad(MapStoreContext mapStoreContext, int partitionId)
Role#SENDER
role.mapStoreContext
- the map store context for this mappartitionId
- the partition ID of this map key loaderpublic Future<?> startLoading(MapStoreContext mapStoreContext, boolean replaceExistingValues)
mapStoreContext
- the map store context for this mapreplaceExistingValues
- if the existing entries for the loaded keys should be replacedpublic void trackLoading(boolean lastBatch, Throwable exception)
keyLoadFinished
result if the lastBatch
is true
.
If there was an exception during key loading, you may pass it as the
exception
paramter and it will be set as the result of the future.
lastBatch
- if the last key batch was sentexception
- an exception that occurred during key loadingpublic void triggerLoadingWithDelay()
public boolean shouldDoInitialLoad()
true
if the keys are not loaded yet, promoting this key
loader and resetting the loading state if necessary in the process.
If this gets invoked on SENDER BACKUP it means the SENDER died and
SENDER BACKUP takes over.public void setMaxBatch(int maxBatch)
maxBatch
- the maximum size for a key batchpublic void setMaxSize(int maxSize)
maxSize
- the maximum entry count per nodeMaxSizeConfig
public void setHasBackup(boolean hasBackup)
hasBackup
- if this map is configured with at least one backuppublic void setMapOperationProvider(MapOperationProvider operationProvider)
public boolean isKeyLoadFinished()
true
if there is no ongoing key loading and dispatching
task on this map key loader.public void promoteToLoadedOnMigration()
State#LOADED
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.