mirror of https://github.com/apache/druid.git
Need more synchronizing in DruidDataSource.
This commit is contained in:
parent
290982433b
commit
c58a316437
|
@ -114,19 +114,23 @@ public class DruidDataSource
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "DruidDataSource{" +
|
||||
"properties=" + properties +
|
||||
", partitions=" + segmentsHolder.toString() +
|
||||
'}';
|
||||
synchronized (lock) {
|
||||
return "DruidDataSource{" +
|
||||
"properties=" + properties +
|
||||
", partitions=" + segmentsHolder.toString() +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public ImmutableDruidDataSource toImmutableDruidDataSource()
|
||||
{
|
||||
return new ImmutableDruidDataSource(
|
||||
name,
|
||||
ImmutableMap.copyOf(properties),
|
||||
ImmutableMap.copyOf(partitionNames),
|
||||
ImmutableSet.copyOf(segmentsHolder)
|
||||
);
|
||||
synchronized (lock) {
|
||||
return new ImmutableDruidDataSource(
|
||||
name,
|
||||
ImmutableMap.copyOf(properties),
|
||||
ImmutableMap.copyOf(partitionNames),
|
||||
ImmutableSet.copyOf(segmentsHolder)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue