Get process PID. @return the pid of this JVM, because Java doesn't provide a real way to do this.
()
| 1009 | * @return the pid of this JVM, because Java doesn't provide a real way to do this. |
| 1010 | */ |
| 1011 | public static String processPid() { |
| 1012 | String name = ManagementFactory.getRuntimeMXBean().getName(); |
| 1013 | String[] split = name.split("@"); |
| 1014 | if (split.length != 2) { |
| 1015 | throw new RuntimeException("Got unexpected process name: " + name); |
| 1016 | } |
| 1017 | return split[0]; |
| 1018 | } |
| 1019 | |
| 1020 | public static Map<String, Object> fromCompressedJsonConf(byte[] serialized) { |
| 1021 | try { |