-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new test for handoff API (#16492)
* Add new test for handoff API * Add new method * fix test * Update test
- Loading branch information
1 parent
21f725f
commit f7013e0
Showing
5 changed files
with
265 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...rc/test/java/org/apache/druid/tests/indexer/ITKafkaIndexingServiceStopTasksEarlyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.druid.tests.indexer; | ||
|
||
import org.apache.druid.testing.guice.DruidTestModuleFactory; | ||
import org.apache.druid.tests.TestNGGroup; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Guice; | ||
import org.testng.annotations.Test; | ||
|
||
@Test(groups = TestNGGroup.KAFKA_INDEX) | ||
@Guice(moduleFactory = DruidTestModuleFactory.class) | ||
public class ITKafkaIndexingServiceStopTasksEarlyTest extends AbstractKafkaIndexingServiceTest | ||
{ | ||
@Override | ||
public String getTestNamePrefix() | ||
{ | ||
return "kafka_stop_tasks_early"; | ||
} | ||
|
||
@BeforeClass | ||
public void beforeClass() throws Exception | ||
{ | ||
doBeforeClass(); | ||
} | ||
|
||
|
||
// This test does not actually check whether the tasks stopped early since the API does | ||
// not make any guarantees about handoff. Instead it makes sure the handoff API can be called | ||
// and that the tasks will eventually catch up with new data. | ||
@Test | ||
public void testStopTasksEarly() throws Exception | ||
{ | ||
doTestIndexDataHandoffEarly(false); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
integration-tests/src/test/resources/stream/data/supervisor_with_long_duration.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"type": "%%STREAM_TYPE%%", | ||
"dataSchema": { | ||
"dataSource": "%%DATASOURCE%%", | ||
"parser": %%PARSER%%, | ||
"timestampSpec": { | ||
"column": "timestamp", | ||
"format": "auto" | ||
}, | ||
"dimensionsSpec": { | ||
"dimensions": %%DIMENSIONS%%, | ||
"dimensionExclusions": [], | ||
"spatialDimensions": [] | ||
}, | ||
"metricsSpec": [ | ||
{ | ||
"type": "count", | ||
"name": "count" | ||
}, | ||
{ | ||
"type": "doubleSum", | ||
"name": "added", | ||
"fieldName": "added" | ||
}, | ||
{ | ||
"type": "doubleSum", | ||
"name": "deleted", | ||
"fieldName": "deleted" | ||
}, | ||
{ | ||
"type": "doubleSum", | ||
"name": "delta", | ||
"fieldName": "delta" | ||
} | ||
], | ||
"granularitySpec": { | ||
"type": "uniform", | ||
"segmentGranularity": "MINUTE", | ||
"queryGranularity": "NONE" | ||
} | ||
}, | ||
"tuningConfig": { | ||
"type": "%%STREAM_TYPE%%", | ||
"intermediatePersistPeriod": "PT30S", | ||
"maxRowsPerSegment": 5000000, | ||
"maxRowsInMemory": 500000 | ||
}, | ||
"ioConfig": { | ||
"%%TOPIC_KEY%%": "%%TOPIC_VALUE%%", | ||
"%%STREAM_PROPERTIES_KEY%%": %%STREAM_PROPERTIES_VALUE%%, | ||
"taskCount": 1, | ||
"replicas": 1, | ||
"taskDuration": "PT600S", | ||
"%%USE_EARLIEST_KEY%%": true, | ||
"inputFormat" : %%INPUT_FORMAT%% | ||
} | ||
} |