Github user mjsax commented on a diff in the pull request:

    https://github.com/apache/flink/pull/573#discussion_r27810138
  
    --- Diff: 
flink-staging/flink-streaming/flink-storm-compatibility/src/main/java/org/apache/flink/stormcompatibility/api/FlinkClient.java
 ---
    @@ -0,0 +1,362 @@
    +/*
    + * 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.stormcompatibility.api;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.net.InetSocketAddress;
    +import java.util.ArrayList;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
    +import org.apache.flink.api.common.JobID;
    +import org.apache.flink.api.common.JobSubmissionResult;
    +import org.apache.flink.client.program.Client;
    +import org.apache.flink.client.program.JobWithJars;
    +import org.apache.flink.client.program.ProgramInvocationException;
    +import org.apache.flink.configuration.ConfigConstants;
    +import org.apache.flink.configuration.Configuration;
    +import org.apache.flink.configuration.GlobalConfiguration;
    +import org.apache.flink.core.fs.Path;
    +import org.apache.flink.runtime.akka.AkkaUtils;
    +import org.apache.flink.runtime.jobgraph.JobGraph;
    +import org.apache.flink.runtime.jobmanager.JobManager;
    +import org.apache.flink.runtime.messages.JobManagerMessages.CancelJob;
    +
    +import scala.Some;
    +import scala.concurrent.Await;
    +import scala.concurrent.Future;
    +import scala.concurrent.duration.FiniteDuration;
    +import akka.actor.ActorRef;
    +import akka.actor.ActorSystem;
    +import akka.pattern.Patterns;
    +import akka.util.Timeout;
    +import backtype.storm.Config;
    +import backtype.storm.generated.AlreadyAliveException;
    +import backtype.storm.generated.ClusterSummary;
    +import backtype.storm.generated.InvalidTopologyException;
    +import backtype.storm.generated.KillOptions;
    +import backtype.storm.generated.NotAliveException;
    +import backtype.storm.generated.SubmitOptions;
    +import backtype.storm.utils.NimbusClient;
    +import backtype.storm.utils.Utils;
    +
    +
    +
    +
    +
    +/**
    + * {@link FlinkClient} mimics a Storm {@link NimbusClient} and {@link 
backtype.storm.generated.Nimbus.Client
    + * Nimbus.Client} at once, to interact with Flink's JobManager instead of 
Storm's Nimbus.
    + * 
    + * @author mjsax
    + */
    +public class FlinkClient {
    +   /**
    +    * Configuration key to specify the location of the file 
storm-core-0.9.4.jar (for org.apache.storm).
    +    */
    +   public final static String FLINK_STROM_CORE_JAR_LOCATION = 
"flink.storm.jar-location.storm-core";
    +   /**
    +    * Configuration key to specify the location of the file 
json-simple-1.1.jar (for com.googlecode.json-simple).
    +    */
    +   public final static String FLINK_STROM_JSON_SIMPLE_JAR_LOCATION = 
"flink.storm.jar-location.json-simple";
    --- End diff --
    
    No really. It was the least intrusive way to make it work....
    
    In order to be able to execute a Storm topology on Flink, both jars are 
needed. The build configuration could be changed to include both in the final 
Flink jar. Because I did not want to change the build without feedback, I added 
both parameter keys to enalbe the user to specifiy the location for both jars 
manually.
    
    Right now, both parameters are used within StormWordCountRemote (in a ugly 
hardcoded way). This could also be removed, if both jars would be included in 
the final Flink jar.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to