-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-8344][flip6] Retrieve leading WebMonitor in RestClusterClient
Make WebMonitorEndpoint instances participate in leader election. Use leading instance's base url to issue HTTP request from RestClusterClient. Make polling of JobExecutionResults and savepoints fault tolerant. [FLINK-8344][flip6] Add TestLogger to unit tests [FLINK-8344][flip6] Update RestOptions Declare timeouts and delays as long datatype. Add descriptions to ConfigOptions. [FLINK-8344][flip6] Rename methods in RestClusterClient Rename waitForSavepointCompletion to pollSavepointAsync. Rename waitForResource to pollResourceAsync. This closes #5312.
- Loading branch information
1 parent
d33aed3
commit ac8225f
Showing
34 changed files
with
1,053 additions
and
203 deletions.
There are no files selected for viewing
322 changes: 241 additions & 81 deletions
322
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
52 changes: 52 additions & 0 deletions
52
...rc/test/java/org/apache/flink/client/program/rest/RestClusterClientConfigurationTest.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,52 @@ | |||
/* | |||
* 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.flink.client.program.rest; | |||
|
|||
import org.apache.flink.configuration.Configuration; | |||
import org.apache.flink.configuration.RestOptions; | |||
import org.apache.flink.util.TestLogger; | |||
|
|||
import org.junit.Before; | |||
import org.junit.Test; | |||
|
|||
import static org.junit.Assert.assertEquals; | |||
|
|||
/** | |||
* Tests for {@link RestClusterClientConfiguration}. | |||
*/ | |||
public class RestClusterClientConfigurationTest extends TestLogger { | |||
|
|||
private RestClusterClientConfiguration restClusterClientConfiguration; | |||
|
|||
@Before | |||
public void setUp() throws Exception { | |||
final Configuration config = new Configuration(); | |||
config.setLong(RestOptions.AWAIT_LEADER_TIMEOUT, 1); | |||
config.setInteger(RestOptions.RETRY_MAX_ATTEMPTS, 2); | |||
config.setLong(RestOptions.RETRY_DELAY, 3); | |||
restClusterClientConfiguration = RestClusterClientConfiguration.fromConfiguration(config); | |||
} | |||
|
|||
@Test | |||
public void testConfiguration() { | |||
assertEquals(1, restClusterClientConfiguration.getAwaitLeaderTimeout()); | |||
assertEquals(2, restClusterClientConfiguration.getRetryMaxAttempts()); | |||
assertEquals(3, restClusterClientConfiguration.getRetryDelay()); | |||
} | |||
} |
Oops, something went wrong.