mirror of https://github.com/apache/druid.git
use common function.
This commit is contained in:
parent
c916cd6363
commit
82dd841f7b
|
@ -419,16 +419,7 @@ public class IndexerSQLMetadataStorageCoordinator implements IndexerMetadataStor
|
||||||
@Nullable final DataSourceMetadata endMetadata
|
@Nullable final DataSourceMetadata endMetadata
|
||||||
) throws IOException
|
) throws IOException
|
||||||
{
|
{
|
||||||
if (segments.isEmpty()) {
|
verifySegmentsToCommit(segments);
|
||||||
throw new IllegalArgumentException("segment set must not be empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
final String dataSource = segments.iterator().next().getDataSource();
|
|
||||||
for (DataSegment segment : segments) {
|
|
||||||
if (!dataSource.equals(segment.getDataSource())) {
|
|
||||||
throw new IllegalArgumentException("segments must all be from the same dataSource");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((startMetadata == null && endMetadata != null) || (startMetadata != null && endMetadata == null)) {
|
if ((startMetadata == null && endMetadata != null) || (startMetadata != null && endMetadata == null)) {
|
||||||
throw new IllegalArgumentException("start/end metadata pair must be either null or non-null");
|
throw new IllegalArgumentException("start/end metadata pair must be either null or non-null");
|
||||||
|
|
Loading…
Reference in New Issue