Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid excessive garbage in map#clear() for TS [HZ-3620] #26127

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.hazelcast.map.impl.operation.steps.ClearOpSteps;
import com.hazelcast.map.impl.operation.steps.engine.State;
import com.hazelcast.map.impl.operation.steps.engine.Step;
import com.hazelcast.map.impl.recordstore.DefaultRecordStore;
import com.hazelcast.spi.impl.operationservice.BackupAwareOperation;
import com.hazelcast.spi.impl.operationservice.MutatingOperation;
import com.hazelcast.spi.impl.operationservice.Operation;
Expand Down Expand Up @@ -55,7 +56,11 @@ protected void runInternal() {

@Override
public Step getStartingStep() {
return ClearOpSteps.CLEAR_MEMORY;
if (recordStore == null) {
return ClearOpSteps.CLEAR_MEMORY;
}

return ((DefaultRecordStore) recordStore).getClearOpStartingStep();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
public interface IMapOpStep extends Step<State> {

int BATCH_SIZE = 1000;

/**
* Decides when to offload based on configured map-store type.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
import com.hazelcast.map.impl.mapstore.writebehind.WriteBehindStore;
import com.hazelcast.map.impl.mapstore.writebehind.entry.DelayedEntry;
import com.hazelcast.map.impl.operation.MapOperation;
import com.hazelcast.map.impl.operation.steps.ClearOpSteps;
import com.hazelcast.map.impl.operation.steps.engine.Step;
import com.hazelcast.map.impl.querycache.QueryCacheContext;
import com.hazelcast.map.impl.querycache.publisher.MapPublisherRegistry;
import com.hazelcast.map.impl.querycache.publisher.PublisherContext;
Expand Down Expand Up @@ -112,6 +114,12 @@ public class DefaultRecordStore extends AbstractEvictableRecordStore {
*/
protected final Collection<Future<?>> loadingFutures = new ConcurrentLinkedQueue<>();

/**
* Defined by {@link com.hazelcast.spi.properties.ClusterProperty#WAN_REPLICATE_IMAP_EVICTIONS},
* if set to true then eviction operations by this RecordStore will be WAN replicated
*/
protected boolean wanReplicateEvictions;

/**
* A reference to the Json Metadata store. It is initialized lazily only if the
* store is needed.
Expand All @@ -131,11 +139,6 @@ public class DefaultRecordStore extends AbstractEvictableRecordStore {
* key loading.
*/
private boolean loadedOnPreMigration;
/**
* Defined by {@link com.hazelcast.spi.properties.ClusterProperty#WAN_REPLICATE_IMAP_EVICTIONS},
* if set to true then eviction operations by this RecordStore will be WAN replicated
*/
private boolean wanReplicateEvictions;

private final IPartitionService partitionService;
private final InterceptorRegistry interceptorRegistry;
Expand Down Expand Up @@ -1642,4 +1645,8 @@ public Set<MapOperation> getOffloadedOperations() {
public boolean isTieredStorageEnabled() {
return mapContainer.getMapConfig().getTieredStoreConfig().isEnabled();
}

public Step getClearOpStartingStep() {
return ClearOpSteps.CLEAR_MEMORY;
}
}