///**
// * 
// */
//package org.springblade.etl.engine.flink.client.session;
//
//import java.nio.file.Path;
//
//import org.apache.flink.api.java.tuple.Tuple2;
//import org.apache.flink.client.program.ClusterClient;
//import org.apache.flink.configuration.Configuration;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//public class YarnSessionCreateCommand implements SessionCommand {
//	
//    private static final Logger log = LoggerFactory.getLogger(YarnSessionCreateCommand.class);
//
//    public YarnSessionCreateCommand() {
//    }
//
//    public Tuple2<String, ClusterClient> create(Path flinkHome, Configuration configuration) throws Exception {
//        YarnClusterDescriptor clusterDescriptor = (YarnClusterDescriptor)FlinkKit.createClusterDescriptor(configuration);
//        Util.addJarFiles(clusterDescriptor, flinkHome, configuration);
//        ClusterSpecification clusterSpecification = FlinkKit.createClusterSpecification(configuration);
//        ClusterClient<ApplicationId> clusterClient = this.createClusterClient(clusterDescriptor, clusterSpecification);
//        return new Tuple2<>(clusterClient.getClusterId().toString(), clusterClient);
//    }
//
//    private ClusterClient<ApplicationId> createClusterClient(YarnClusterDescriptor clusterDescriptor, ClusterSpecification clusterSpecification) throws ClusterDeploymentException {
//        ClusterClientProvider<ApplicationId> provider = clusterDescriptor.deploySessionCluster(clusterSpecification);
//        ClusterClient<ApplicationId> clusterClient = provider.getClusterClient();
//        log.info("deploy session with appId: {}", clusterClient.getClusterId());
//        return clusterClient;
//    }
//}