Need more synchronizing in DruidDataSource.

This commit is contained in:
Gian Merlino 2014-08-05 13:32:40 -07:00
parent 290982433b
commit c58a316437
1 changed files with 14 additions and 10 deletions

View File

@ -114,19 +114,23 @@ public class DruidDataSource
@Override @Override
public String toString() public String toString()
{ {
return "DruidDataSource{" + synchronized (lock) {
"properties=" + properties + return "DruidDataSource{" +
", partitions=" + segmentsHolder.toString() + "properties=" + properties +
'}'; ", partitions=" + segmentsHolder.toString() +
'}';
}
} }
public ImmutableDruidDataSource toImmutableDruidDataSource() public ImmutableDruidDataSource toImmutableDruidDataSource()
{ {
return new ImmutableDruidDataSource( synchronized (lock) {
name, return new ImmutableDruidDataSource(
ImmutableMap.copyOf(properties), name,
ImmutableMap.copyOf(partitionNames), ImmutableMap.copyOf(properties),
ImmutableSet.copyOf(segmentsHolder) ImmutableMap.copyOf(partitionNames),
); ImmutableSet.copyOf(segmentsHolder)
);
}
} }
} }