diff --git a/sylph-web/src/main/webapp/node_modules/.bin/mini-css-extract-plugin b/sylph-web/src/main/webapp/node_modules/.bin/mini-css-extract-plugin deleted file mode 120000 index 49d71245e..000000000 --- a/sylph-web/src/main/webapp/node_modules/.bin/mini-css-extract-plugin +++ /dev/null @@ -1 +0,0 @@ -../mini-css-extract-plugin \ No newline at end of file diff --git a/sylph-web/src/main/webapp/node_modules/.bin/url-loader b/sylph-web/src/main/webapp/node_modules/.bin/url-loader deleted file mode 120000 index de7dbc8b3..000000000 --- a/sylph-web/src/main/webapp/node_modules/.bin/url-loader +++ /dev/null @@ -1 +0,0 @@ -../url-loader \ No newline at end of file diff --git a/sylph-web/src/main/webapp/node_modules/react-scripts/node_modules/.bin/mini-css-extract-plugin b/sylph-web/src/main/webapp/node_modules/react-scripts/node_modules/.bin/mini-css-extract-plugin deleted file mode 120000 index b1e4d3e84..000000000 --- a/sylph-web/src/main/webapp/node_modules/react-scripts/node_modules/.bin/mini-css-extract-plugin +++ /dev/null @@ -1 +0,0 @@ -../../../mini-css-extract-plugin \ No newline at end of file diff --git a/sylph-web/src/main/webapp/node_modules/react-scripts/node_modules/.bin/url-loader b/sylph-web/src/main/webapp/node_modules/react-scripts/node_modules/.bin/url-loader deleted file mode 120000 index b7a5da4e0..000000000 --- a/sylph-web/src/main/webapp/node_modules/react-scripts/node_modules/.bin/url-loader +++ /dev/null @@ -1 +0,0 @@ -../../../url-loader \ No newline at end of file diff --git a/sylph-yarn/src/main/java/ideal/sylph/runtime/local/Kernel32.java b/sylph-yarn/src/main/java/ideal/sylph/runtime/local/Kernel32.java index 2793ac698..9b6c92306 100644 --- a/sylph-yarn/src/main/java/ideal/sylph/runtime/local/Kernel32.java +++ b/sylph-yarn/src/main/java/ideal/sylph/runtime/local/Kernel32.java @@ -1,10 +1,27 @@ +/* + * Copyright (C) 2018 The Sylph Authors + * + * Licensed 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 ideal.sylph.runtime.local; import com.sun.jna.Library; import com.sun.jna.Native; -public interface Kernel32 extends Library { +public interface Kernel32 + extends Library +{ Kernel32 INSTANCE = (Kernel32) Native.load("kernel32", Kernel32.class); - long GetProcessId(Long hProcess); -} + long getProcessId(Long hProcess); +} diff --git a/sylph-yarn/src/main/java/ideal/sylph/runtime/local/LocalContainer.java b/sylph-yarn/src/main/java/ideal/sylph/runtime/local/LocalContainer.java index 32e21b74a..0eaa7eb89 100644 --- a/sylph-yarn/src/main/java/ideal/sylph/runtime/local/LocalContainer.java +++ b/sylph-yarn/src/main/java/ideal/sylph/runtime/local/LocalContainer.java @@ -20,6 +20,7 @@ import ideal.sylph.spi.job.JobContainerAbs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import java.lang.reflect.Field; import java.util.concurrent.Future; @@ -44,7 +45,7 @@ public String getRunId() } else { //todo: widnows get pid not return "windows"; - logger.debug("#### win 获取 "+getProcessId(process)); + logger.debug("#### win 获取 " + getProcessId(process)); return getProcessId(process); } } @@ -101,24 +102,28 @@ public Status getStatus() return super.getStatus(); } - public static String getProcessId(Process process) { + public static String getProcessId(Process process) + { long pid = -1; Field field = null; if (Platform.isWindows()) { try { field = process.getClass().getDeclaredField("handle"); field.setAccessible(true); - pid = Kernel32.INSTANCE.GetProcessId((Long) field.get(process)); - } catch (Exception ex) { + pid = Kernel32.INSTANCE.getProcessId((Long) field.get(process)); + } + catch (Exception ex) { ex.printStackTrace(); } - } else if (Platform.isLinux() || Platform.isAIX()) { + } + else if (Platform.isLinux() || Platform.isAIX()) { try { Class clazz = Class.forName("java.lang.UNIXProcess"); field = clazz.getDeclaredField("pid"); field.setAccessible(true); pid = (Integer) field.get(process); - } catch (Throwable e) { + } + catch (Throwable e) { e.printStackTrace(); } }