Skip to content

Commit 328a99c

Browse files
authored
Merge pull request #7 from CodelyTV/update/scalafmt-core-3.8.3
Update scalafmt-core to 3.8.3
2 parents 8f6d46d + 1b064cb commit 328a99c

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Scala Steward: Reformat with scalafmt 3.8.3
2+
51ae86836c4b4dae7b615a16f3380fe0459f83fa

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.8.2
1+
version = 3.8.3
22
runner.dialect = scala213
33
style = default
44
maxColumn = 120

src/main/com/codely/lesson_04__spark_streaming_rabbitmq/video_01__rabbitmq_receiver/RabbitMQReceiver.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import org.apache.spark.storage.StorageLevel
55
import org.apache.spark.streaming.receiver.Receiver
66

77
class RabbitMQReceiver(queueName: String, host: String, port: Int, username: String, password: String)
8-
extends Receiver[String](StorageLevel.MEMORY_AND_DISK_2) {
8+
extends Receiver[String](StorageLevel.MEMORY_AND_DISK_2) {
99

1010
@transient var connection: Connection = _
11-
@transient var channel: Channel = _
11+
@transient var channel: Channel = _
1212

1313
override def onStart(): Unit = {
1414

@@ -33,11 +33,11 @@ class RabbitMQReceiver(queueName: String, host: String, port: Int, username: Str
3333
try {
3434
val consumer = new DefaultConsumer(channel) {
3535
override def handleDelivery(
36-
consumerTag: String,
37-
envelope: Envelope,
38-
properties: AMQP.BasicProperties,
39-
body: Array[Byte]
40-
): Unit = {
36+
consumerTag: String,
37+
envelope: Envelope,
38+
properties: AMQP.BasicProperties,
39+
body: Array[Byte]
40+
): Unit = {
4141
val message = new String(body, "UTF-8")
4242
store(message)
4343
}

src/main/com/codely/lesson_04__spark_streaming_rabbitmq/video_03__rabbitmq_custom_provider/RabbitMQPartitionReaderFactory.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ import org.apache.spark.sql.types.StructType
66

77
case class RabbitMQPartitionReaderFactory(schema: StructType) extends PartitionReaderFactory {
88
override def createReader(partition: InputPartition): PartitionReader[InternalRow] =
9-
109
RabbitMQPartitionReader(schema, partition.asInstanceOf[RabbitMQInputPartition])
1110
}

src/test/com/codely/SparkTestHelper.scala

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ import java.io.File
1111
import java.nio.file.Files
1212
import scala.reflect.io.Directory
1313

14-
trait SparkTestHelper
15-
extends AnyWordSpec
16-
with BeforeAndAfterEach
17-
with BeforeAndAfterAll
18-
with Matchers {
14+
trait SparkTestHelper extends AnyWordSpec with BeforeAndAfterEach with BeforeAndAfterAll with Matchers {
1915

2016
private val sparkSession = SparkSession
2117
.builder()
2218
.master("local[*]")
2319
.appName("test-spark-session")
2420
.config(sparkConfiguration)
25-
//.enableHiveSupport() uncomment this if you want to use Hive
21+
// .enableHiveSupport() uncomment this if you want to use Hive
2622
.getOrCreate()
2723

2824
protected var tempDir: String = _
@@ -33,14 +29,14 @@ trait SparkTestHelper
3329

3430
protected def sparkConfiguration: SparkConf =
3531
new SparkConf()
36-
/* Uncomment this if you want to use Delta Lake
32+
/* Uncomment this if you want to use Delta Lake
3733
3834
.set("spark.sql.extensions", "io.delta.sql.DeltaSparkSessionExtension")
3935
.set(
4036
"spark.sql.catalog.spark_catalog",
4137
"org.apache.spark.sql.delta.catalog.DeltaCatalog"
4238
)
43-
*/
39+
*/
4440

4541
override protected def beforeAll(): Unit = {
4642
super.beforeAll()

0 commit comments

Comments
 (0)