[hotfix] [mesos] Delete unused class FlinkMesosSessionCli.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/557bf0a6 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/557bf0a6 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/557bf0a6 Branch: refs/heads/release-1.5 Commit: 557bf0a66e80ed9ef0713fb2889b5ee79ff1a67b Parents: 0f34a85 Author: gyao <[email protected]> Authored: Thu Apr 26 17:38:20 2018 +0200 Committer: Stephan Ewen <[email protected]> Committed: Mon Apr 30 23:25:10 2018 +0200 ---------------------------------------------------------------------- .../flink/mesos/cli/FlinkMesosSessionCli.java | 75 -------------------- 1 file changed, 75 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/557bf0a6/flink-mesos/src/main/java/org/apache/flink/mesos/cli/FlinkMesosSessionCli.java ---------------------------------------------------------------------- diff --git a/flink-mesos/src/main/java/org/apache/flink/mesos/cli/FlinkMesosSessionCli.java b/flink-mesos/src/main/java/org/apache/flink/mesos/cli/FlinkMesosSessionCli.java deleted file mode 100644 index e0df1c9..0000000 --- a/flink-mesos/src/main/java/org/apache/flink/mesos/cli/FlinkMesosSessionCli.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.mesos.cli; - -import org.apache.flink.configuration.Configuration; - -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.type.TypeReference; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper; - -import java.io.IOException; -import java.util.Map; - -/** - * Class handling the command line interface to the Mesos session. - */ -public class FlinkMesosSessionCli { - - private static final ObjectMapper mapper = new ObjectMapper(); - - /** - * Decode encoded dynamic properties. - * - * @param dynamicPropertiesEncoded encoded properties produced by the encoding method. - * @return a configuration instance to be merged with the static configuration. - */ - public static Configuration decodeDynamicProperties(String dynamicPropertiesEncoded) { - try { - Configuration configuration = new Configuration(); - if (dynamicPropertiesEncoded != null) { - TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() { - }; - Map<String, String> props = mapper.readValue(dynamicPropertiesEncoded, typeRef); - for (Map.Entry<String, String> property : props.entrySet()) { - configuration.setString(property.getKey(), property.getValue()); - } - } - return configuration; - } catch (IOException ex) { - throw new IllegalArgumentException("unreadable encoded properties", ex); - } - } - - /** - * Encode dynamic properties as a string to be transported as an environment variable. - * - * @param configuration the dynamic properties to encode. - * @return a string to be decoded later. - */ - public static String encodeDynamicProperties(Configuration configuration) { - try { - String dynamicPropertiesEncoded = mapper.writeValueAsString(configuration.toMap()); - return dynamicPropertiesEncoded; - } - catch (JsonProcessingException ex) { - throw new IllegalArgumentException("unwritable properties", ex); - } - } -}
