Skip to content

Commit

Permalink
[FLINK-1650] Let Netty(Akka) use Slf4j
Browse files Browse the repository at this point in the history
This closes apache#518
  • Loading branch information
rmetzger committed Mar 27, 2015
1 parent 973d778 commit c9d29f2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import akka.actor._
import akka.pattern.{ask => akkaAsk}
import com.typesafe.config.{Config, ConfigFactory}
import org.apache.flink.configuration.{ConfigConstants, Configuration}
import org.jboss.netty.logging.{Slf4JLoggerFactory, InternalLoggerFactory}
import org.slf4j.LoggerFactory
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
Expand Down Expand Up @@ -65,6 +66,8 @@ object AkkaUtils {
* @return created actor system
*/
def createActorSystem(akkaConfig: Config): ActorSystem = {
// Initialize slf4j as logger of Akka's Netty instead of java.util.logging (FLINK-1650)
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory)
ActorSystem.create("flink", akkaConfig)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ object JobManager {
* @param args The command line arguments.
*/
def main(args: Array[String]): Unit = {

// startup checks and logging
EnvironmentInformation.logEnvironmentInfo(LOG, "JobManager", args)
EnvironmentInformation.checkJavaVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.flink.runtime.taskmanager

import java.io.{File, IOException}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public abstract class YarnTestBase {

// The tests are scanning for these strings in the final output.
protected final static String[] PROHIBITED_STRINGS = {
// "Exception", // we don't want any exceptions to happen
"Exception", // we don't want any exceptions to happen
"Started [email protected]:8081" // Jetty should start on a random port in YARN mode.
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class YarnTaskManagerRunner {


public static void main(final String[] args) throws IOException {

EnvironmentInformation.logEnvironmentInfo(LOG, "YARN TaskManager", args);
EnvironmentInformation.checkJavaVersion();
org.apache.flink.runtime.util.SignalHandler.register(LOG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.flink.yarn

import java.io.{PrintWriter, FileWriter, BufferedWriter}
Expand Down Expand Up @@ -45,7 +44,8 @@ object ApplicationMaster {
val MODIFIED_CONF_FILE = "flink-conf-modified.yaml"
val MAX_REGISTRATION_DURATION = "5 minutes"

def main(args: Array[String]): Unit ={
def main(args: Array[String]): Unit = {

val yarnClientUsername = System.getenv(FlinkYarnClient.ENV_CLIENT_USERNAME)
LOG.info(s"YARN daemon runs as ${UserGroupInformation.getCurrentUser.getShortUserName} " +
s"setting user to execute Flink ApplicationMaster/JobManager to ${yarnClientUsername}")
Expand Down

0 comments on commit c9d29f2

Please sign in to comment.