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
|
||||
) throws IOException
|
||||
{
|
||||
if (segments.isEmpty()) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
verifySegmentsToCommit(segments);
|
||||
|
||||
if ((startMetadata == null && endMetadata != null) || (startMetadata != null && endMetadata == null)) {
|
||||
throw new IllegalArgumentException("start/end metadata pair must be either null or non-null");
|
||||
|
|
Loading…
Reference in New Issue