import java.io.DataOutputStream
import java.text.SimpleDateFormat
import java.util.Date
import org.apache.hadoop.fs.{
FSDataOutputStream, FileSystem}
import org.apache.hadoop.io.compress.{
CompressionCodec, GzipCodec}
import org.apache.hadoop.mapred.{
JobConf, RecordWriter, TextOutputFormat}
import org.apache.hadoop.util.{
Progressable, ReflectionUtils}
import org.apache.spark.{
HashPartitioner, SparkConf, SparkContext}
import org.apache.spark.rdd.RDD
import org.apache.spark.streaming.{
Seconds, StreamingContext}
import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.streaming.kafka010.{
ConsumerStrategies, KafkaUtils, LocationStrategies}
object writeToHdfs {
def main(args: Array[String]): Unit = {
val conf = new SparkConf()
.setAppName(
sparkStreaming 写入 hdfs
于 2020-08-07 22:21:47 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)