|
@@ -17,6 +17,7 @@ import java.util.List;
|
|
public class VideoCleanExecutor {
|
|
public class VideoCleanExecutor {
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
String file = args[0];
|
|
String file = args[0];
|
|
|
|
+ int repartition = Integer.valueOf(args[1]);
|
|
log.info("hdfs file {}", file);
|
|
log.info("hdfs file {}", file);
|
|
SparkConf sparkConf = new SparkConf()
|
|
SparkConf sparkConf = new SparkConf()
|
|
//.setMaster("local")
|
|
//.setMaster("local")
|
|
@@ -27,7 +28,7 @@ public class VideoCleanExecutor {
|
|
|
|
|
|
log.info("count {}", multiFileRDD.count());
|
|
log.info("count {}", multiFileRDD.count());
|
|
OSSService ossService = new OSSService();
|
|
OSSService ossService = new OSSService();
|
|
- multiFileRDD.repartition(100).foreachPartition(s -> {
|
|
|
|
|
|
+ multiFileRDD.repartition(repartition).foreachPartition(s -> {
|
|
List<String> objectNames = new ArrayList<>();
|
|
List<String> objectNames = new ArrayList<>();
|
|
while (s.hasNext()) {
|
|
while (s.hasNext()) {
|
|
String[] data = StringUtils.split(s.next(), "\t");
|
|
String[] data = StringUtils.split(s.next(), "\t");
|