From c807bf66a8d945708af0f620576255cc133ffe46 Mon Sep 17 00:00:00 2001 From: maji2014 Date: Sun, 9 Nov 2014 07:58:50 -0800 Subject: [PATCH 1/3] Fix exception in SparkSinkSuite --- .../org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala b/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala index a2b2cc6149d95..6a60d814643aa 100644 --- a/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala +++ b/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala @@ -159,6 +159,7 @@ class SparkSinkSuite extends FunSuite { channelContext.put("transactionCapacity", 1000.toString) channelContext.put("keep-alive", 0.toString) channelContext.putAll(overrides) + channel.setName(getClass.getDeclaredMethods.toString) channel.configure(channelContext) val sink = new SparkSink() From 24c3d21dfa1dcc690505e65ff837bea4a08dde00 Mon Sep 17 00:00:00 2001 From: maji2014 Date: Mon, 10 Nov 2014 21:16:43 -0800 Subject: [PATCH 2/3] add log4j.properties for SparkSinkSuite and spark-4295 --- .../src/test/resources/log4j.properties | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 external/flume-sink/src/test/resources/log4j.properties diff --git a/external/flume-sink/src/test/resources/log4j.properties b/external/flume-sink/src/test/resources/log4j.properties new file mode 100644 index 0000000000000..4411d6e20c52a --- /dev/null +++ b/external/flume-sink/src/test/resources/log4j.properties @@ -0,0 +1,29 @@ +# +# 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. +# + +# Set everything to be logged to the file streaming/target/unit-tests.log +log4j.rootCategory=INFO, file +# log4j.appender.file=org.apache.log4j.FileAppender +log4j.appender.file=org.apache.log4j.FileAppender +log4j.appender.file.append=false +log4j.appender.file.file=target/unit-tests.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{1}: %m%n + +# Ignore messages below warning level from Jetty, because it's a bit verbose +log4j.logger.org.eclipse.jetty=WARN + From 312620a235d6b79dba2a222ae8455f9d4fc6d1b5 Mon Sep 17 00:00:00 2001 From: maji2014 Date: Mon, 10 Nov 2014 21:27:33 -0800 Subject: [PATCH 3/3] change a new statement for spark-4295 --- .../org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala b/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala index 6a60d814643aa..650b2fbe1c142 100644 --- a/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala +++ b/external/flume-sink/src/test/scala/org/apache/spark/streaming/flume/sink/SparkSinkSuite.scala @@ -159,7 +159,7 @@ class SparkSinkSuite extends FunSuite { channelContext.put("transactionCapacity", 1000.toString) channelContext.put("keep-alive", 0.toString) channelContext.putAll(overrides) - channel.setName(getClass.getDeclaredMethods.toString) + channel.setName(scala.util.Random.nextString(10)) channel.configure(channelContext) val sink = new SparkSink()