You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by fj...@apache.org on 2020/07/05 16:32:40 UTC
[druid] branch master updated: VersionedIntervalTimeline: Fix
thread-unsafe call to "lookup". (#10130)
This is an automated email from the ASF dual-hosted git repository.
fjy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new ddda2a4 VersionedIntervalTimeline: Fix thread-unsafe call to "lookup". (#10130)
ddda2a4 is described below
commit ddda2a4f18597257633b55536d8a54e1a3f61eb3
Author: Gian Merlino <gi...@gmail.com>
AuthorDate: Sun Jul 5 09:32:18 2020 -0700
VersionedIntervalTimeline: Fix thread-unsafe call to "lookup". (#10130)
---
.../apache/druid/timeline/VersionedIntervalTimeline.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java b/core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java
index 783bf8b..376a97f 100644
--- a/core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java
+++ b/core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java
@@ -164,8 +164,18 @@ public class VersionedIntervalTimeline<VersionType, ObjectType extends Overshado
*/
public Set<ObjectType> findNonOvershadowedObjectsInInterval(Interval interval, Partitions completeness)
{
+ final List<TimelineObjectHolder<VersionType, ObjectType>> holders;
+
+ lock.readLock().lock();
+ try {
+ holders = lookup(interval, completeness);
+ }
+ finally {
+ lock.readLock().unlock();
+ }
+
return FluentIterable
- .from(lookup(interval, completeness))
+ .from(holders)
.transformAndConcat(TimelineObjectHolder::getObject)
.transform(PartitionChunk::getObject)
.toSet();
@@ -273,7 +283,8 @@ public class VersionedIntervalTimeline<VersionType, ObjectType extends Overshado
}
@Override
- public @Nullable PartitionHolder<ObjectType> findEntry(Interval interval, VersionType version)
+ @Nullable
+ public PartitionHolder<ObjectType> findEntry(Interval interval, VersionType version)
{
lock.readLock().lock();
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org