Skip to content

Commit

Permalink
[FLINK-15454][cluster] Remove redundant inherited ClusterEntrypoint#i…
Browse files Browse the repository at this point in the history
…nstallSecurityContext
  • Loading branch information
tisonkun authored and aljoscha committed Jan 3, 2020
1 parent 23ecdb1 commit de512c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private void configureFileSystems(Configuration configuration) {
FileSystem.initialize(configuration, PluginUtils.createPluginManagerFromRootFolder(configuration));
}

protected SecurityContext installSecurityContext(Configuration configuration) throws Exception {
private SecurityContext installSecurityContext(Configuration configuration) throws Exception {
LOG.info("Install security context.");

SecurityUtils.install(new SecurityConfiguration(configuration));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
import org.apache.flink.configuration.SecurityOptions;
import org.apache.flink.configuration.WebOptions;
import org.apache.flink.runtime.clusterframework.BootstrapTools;
import org.apache.flink.runtime.security.SecurityConfiguration;
import org.apache.flink.runtime.security.SecurityContext;
import org.apache.flink.runtime.security.SecurityUtils;
import org.apache.flink.util.Preconditions;
import org.apache.flink.yarn.Utils;
import org.apache.flink.yarn.YarnConfigKeys;
Expand All @@ -49,16 +46,6 @@
*/
public class YarnEntrypointUtils {

public static SecurityContext installSecurityContext(
Configuration configuration) throws Exception {

SecurityConfiguration sc = new SecurityConfiguration(configuration);

SecurityUtils.install(sc);

return SecurityUtils.getInstalledContext();
}

public static Configuration loadConfiguration(String workingDirectory, Map<String, String> env) {
Configuration configuration = GlobalConfiguration.loadConfiguration(workingDirectory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.flink.runtime.entrypoint.JobClusterEntrypoint;
import org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory;
import org.apache.flink.runtime.entrypoint.component.FileJobGraphRetriever;
import org.apache.flink.runtime.security.SecurityContext;
import org.apache.flink.runtime.util.EnvironmentInformation;
import org.apache.flink.runtime.util.JvmShutdownSafeguard;
import org.apache.flink.runtime.util.SignalHandler;
Expand All @@ -47,17 +46,10 @@
*/
public class YarnJobClusterEntrypoint extends JobClusterEntrypoint {

public YarnJobClusterEntrypoint(
Configuration configuration) {

public YarnJobClusterEntrypoint(Configuration configuration) {
super(configuration);
}

@Override
protected SecurityContext installSecurityContext(Configuration configuration) throws Exception {
return YarnEntrypointUtils.installSecurityContext(configuration);
}

@Override
protected String getRPCPortRange(Configuration configuration) {
return configuration.getString(YarnConfigOptions.APPLICATION_MASTER_PORT);
Expand Down Expand Up @@ -113,8 +105,7 @@ public static void main(String[] args) {

Configuration configuration = YarnEntrypointUtils.loadConfiguration(workingDirectory, env);

YarnJobClusterEntrypoint yarnJobClusterEntrypoint = new YarnJobClusterEntrypoint(
configuration);
YarnJobClusterEntrypoint yarnJobClusterEntrypoint = new YarnJobClusterEntrypoint(configuration);

ClusterEntrypoint.runClusterEntrypoint(yarnJobClusterEntrypoint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.flink.runtime.entrypoint.SessionClusterEntrypoint;
import org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory;
import org.apache.flink.runtime.entrypoint.component.DispatcherResourceManagerComponentFactory;
import org.apache.flink.runtime.security.SecurityContext;
import org.apache.flink.runtime.util.EnvironmentInformation;
import org.apache.flink.runtime.util.JvmShutdownSafeguard;
import org.apache.flink.runtime.util.SignalHandler;
Expand All @@ -40,16 +39,10 @@
*/
public class YarnSessionClusterEntrypoint extends SessionClusterEntrypoint {

public YarnSessionClusterEntrypoint(
Configuration configuration) {
public YarnSessionClusterEntrypoint(Configuration configuration) {
super(configuration);
}

@Override
protected SecurityContext installSecurityContext(Configuration configuration) throws Exception {
return YarnEntrypointUtils.installSecurityContext(configuration);
}

@Override
protected String getRPCPortRange(Configuration configuration) {
return configuration.getString(YarnConfigOptions.APPLICATION_MASTER_PORT);
Expand Down

0 comments on commit de512c0

Please sign in to comment.