启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
tmux at [-t 会话名]
public class StreamGraphHasherV2 implements StreamGraphHasher { | |
private static final Logger LOG = LoggerFactory.getLogger(StreamGraphHasherV2.class); | |
/** | |
* Returns a map with a hash for each {@link StreamNode} of the {@link | |
* StreamGraph}. The hash is used as the {@link JobVertexID} in order to | |
* identify nodes across job submissions if they didn't change. | |
* | |
* <p>The complete {@link StreamGraph} is traversed. The hash is either |
private final ReducingStateDescriptor<Long> stateDesc = | |
new ReducingStateDescriptor<>("fire-time", new Min(), LongSerializer.INSTANCE); |
/* | |
* 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 | |
* |
def urlses(cl: ClassLoader): Array[java.net.URL] = cl match { | |
case null => Array() | |
case u: java.net.URLClassLoader => u.getURLs() ++ urlses(cl.getParent) | |
case _ => urlses(cl.getParent) | |
} | |
val urls = urlses(getClass.getClassLoader) | |
println(urls.filterNot(_.toString.contains("ivy")).mkString("\n") |
def exists(p: A=> Boolean): Boolean = this match { | |
case Cons(h, t) => p(h()) || t().exists(p) | |
case _ => false | |
} |
try { | |
// invoke main method | |
prog.invokeInteractiveModeForExecution(); | |
if (lastJobExecutionResult == null && factory.getLastEnvCreated() == null) { | |
throw new ProgramMissingJobException(); | |
} | |
if (isDetached()) { | |
// in detached mode, we execute the whole user code to extract the Flink job, afterwards we run it here | |
return ((DetachedEnvironment) factory.getLastEnvCreated()).finalizeExecute(); | |
} |
package org.apache.flink.metrics; | |
public class MeterView implements Meter, View { | |
/** The underlying counter maintaining the count */ | |
private final Counter counter; | |
/** The time-span over which the average is calculated */ | |
private final int timeSpanInSeconds; | |
/** Circular array containing the history of values */ | |
private final long[] values; | |
/** The index in the array for the current time */ |
/** | |
* | |
*当我们调用get方法的时候,其实每个当前线程中都有一个ThreadLocal。每次获取或者设置都是对该ThreadLocal进行的操作,是与其他线程分开的 | |
*应用场景:当很多线程需要多次使用同一个对象,并且需要该对象具有相同初始化值的时候最适合使用ThreadLocal | |
*/ | |
public class ConnectionUtil { | |
private static ThreadLocal<Connection> tl = new ThreadLocal<Connection>(); | |
private static Connection initConn = null; | |
static { | |
try { |