Skip to content
Open

remove #2807

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,15 @@ package com.pingcap.tispark.listener

import com.pingcap.tikv.event.CacheInvalidateEvent
import com.pingcap.tikv.region.RegionManager
import com.pingcap.tispark.accumulator.CacheInvalidateAccumulator
import com.pingcap.tispark.handler.CacheInvalidateEventHandler
import org.apache.spark.SparkContext
import org.slf4j.LoggerFactory

class CacheInvalidateListener()
extends Serializable
with java.util.function.Function[CacheInvalidateEvent, Void] {
final val CACHE_ACCUMULATOR_NAME = "CacheInvalidateAccumulator"
final val CACHE_INVALIDATE_ACCUMULATOR = new CacheInvalidateAccumulator

override def apply(t: CacheInvalidateEvent): Void = {
// this operation shall be executed in executor nodes
CACHE_INVALIDATE_ACCUMULATOR.add(t)
null
}
}
Expand Down Expand Up @@ -71,12 +66,5 @@ object CacheInvalidateListener {
def init(
sc: SparkContext,
regionManager: RegionManager,
manager: CacheInvalidateListener): Unit =
if (sc != null && regionManager != null) {
sc.register(manager.CACHE_INVALIDATE_ACCUMULATOR, manager.CACHE_ACCUMULATOR_NAME)
sc.addSparkListener(
new PDCacheInvalidateListener(
manager.CACHE_INVALIDATE_ACCUMULATOR,
CacheInvalidateEventHandler(regionManager)))
}
manager: CacheInvalidateListener): Unit = {}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ private List<RangeSplitter.RegionTask> handleCopResponse(
// we need to invalidate cache when region not find
if (regionError.hasRegionNotFound()) {
logger.info("invalidateRange when Re-splitting region task because of region not find.");
this.regionManager.invalidateRange(region.getStartKey(),region.getEndKey());
this.regionManager.invalidateRange(region.getStartKey(), region.getEndKey());
}
// Split ranges
return RangeSplitter.newSplitter(this.regionManager).splitRangeByRegion(ranges, storeType);
Expand Down