[MINOR] Remove unused imports and some other checkstyle issues (#2800)
This commit is contained in:
@@ -126,7 +126,7 @@ public class HoodieTestSuiteWriter implements Serializable {
|
||||
public RDD<GenericRecord> getNextBatch() throws Exception {
|
||||
Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> nextBatch = fetchSource();
|
||||
lastCheckpoint = Option.of(nextBatch.getValue().getLeft());
|
||||
JavaRDD <HoodieRecord> inputRDD = nextBatch.getRight().getRight();
|
||||
JavaRDD<HoodieRecord> inputRDD = nextBatch.getRight().getRight();
|
||||
return inputRDD.map(r -> (GenericRecord) r.getData()
|
||||
.getInsertValue(new Schema.Parser().parse(schema)).get()).rdd();
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@ import org.apache.hudi.integ.testsuite.generator.LazyRecordGeneratorIterator;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.apache.spark.api.java.JavaRDD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DeleteConverter implements Converter<GenericRecord, GenericRecord> {
|
||||
|
||||
private final String schemaStr;
|
||||
|
||||
@@ -50,11 +50,6 @@ import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hudi.common.util.ReflectionUtils;
|
||||
import org.apache.hudi.common.util.StringUtils;
|
||||
import org.apache.hudi.common.util.collection.Pair;
|
||||
import org.apache.hudi.integ.testsuite.configuration.DeltaConfig;
|
||||
import org.apache.hudi.integ.testsuite.dag.nodes.DagNode;
|
||||
|
||||
/**
|
||||
* Utility class to SerDe workflow dag.
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.apache.hudi.integ.testsuite.dag.nodes.DelayNode;
|
||||
import org.apache.hudi.metrics.Metrics;
|
||||
|
||||
import org.apache.spark.api.java.JavaSparkContext;
|
||||
import org.junit.runners.Suite;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package org.apache.hudi.integ.testsuite.dag.scheduler;
|
||||
|
||||
import org.apache.hudi.exception.HoodieException;
|
||||
import org.apache.hudi.integ.testsuite.dag.scheduler.DagScheduler;
|
||||
import org.apache.hudi.integ.testsuite.dag.WorkflowDag;
|
||||
import org.apache.hudi.integ.testsuite.dag.WriterContext;
|
||||
import org.apache.hudi.integ.testsuite.dag.nodes.DagNode;
|
||||
|
||||
@@ -21,9 +21,7 @@ package org.apache.hudi.integ.testsuite.generator;
|
||||
import org.apache.avro.Schema;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Lazy delete record generator.
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.StreamSupport;
|
||||
@@ -41,10 +40,6 @@ import org.apache.hudi.integ.testsuite.configuration.DFSDeltaConfig;
|
||||
import org.apache.hudi.integ.testsuite.configuration.DeltaConfig.Config;
|
||||
import org.apache.hudi.integ.testsuite.converter.Converter;
|
||||
import org.apache.hudi.integ.testsuite.converter.DeleteConverter;
|
||||
import org.apache.hudi.common.util.Option;
|
||||
import org.apache.hudi.integ.testsuite.configuration.DFSDeltaConfig;
|
||||
import org.apache.hudi.integ.testsuite.configuration.DeltaConfig;
|
||||
import org.apache.hudi.integ.testsuite.configuration.DeltaConfig.Config;
|
||||
import org.apache.hudi.integ.testsuite.converter.UpdateConverter;
|
||||
import org.apache.hudi.integ.testsuite.reader.DFSAvroDeltaInputReader;
|
||||
import org.apache.hudi.integ.testsuite.reader.DFSHoodieDatasetInputReader;
|
||||
@@ -55,7 +50,6 @@ import org.apache.hudi.integ.testsuite.writer.DeltaWriterAdapter;
|
||||
import org.apache.hudi.integ.testsuite.writer.DeltaWriterFactory;
|
||||
import org.apache.hudi.keygen.BuiltinKeyGenerator;
|
||||
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.apache.spark.api.java.JavaRDD;
|
||||
import org.apache.spark.api.java.JavaSparkContext;
|
||||
import org.apache.spark.sql.SparkSession;
|
||||
@@ -63,18 +57,6 @@ import org.apache.spark.storage.StorageLevel;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import scala.Tuple2;
|
||||
|
||||
/**
|
||||
@@ -235,7 +217,6 @@ public class DeltaGenerator implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, Long> getPartitionToCountMap(JavaRDD<GenericRecord> records) {
|
||||
// Requires us to keep the partitioner the same
|
||||
return records.mapPartitionsWithIndex((index, itr) -> {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class FlexibleSchemaRecordGenerationIterator implements Iterator<GenericR
|
||||
List<String> partitionPathFieldNames, int numPartitions, int startPartition) {
|
||||
this.counter = maxEntriesToProduce;
|
||||
this.partitionPathFieldNames = new HashSet<>(partitionPathFieldNames);
|
||||
if(partitionPathFieldNames != null && partitionPathFieldNames.size() > 0) {
|
||||
if (partitionPathFieldNames != null && partitionPathFieldNames.size() > 0) {
|
||||
this.firstPartitionPathField = partitionPathFieldNames.get(0);
|
||||
}
|
||||
Schema schema = new Schema.Parser().parse(schemaStr);
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.apache.avro.generic.GenericData;
|
||||
import org.apache.avro.generic.GenericData.Fixed;
|
||||
import org.apache.avro.generic.GenericFixed;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.junit.runners.Suite;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
package org.apache.hudi.integ.testsuite.writer;
|
||||
|
||||
import org.apache.hudi.integ.testsuite.schema.SchemaUtils;
|
||||
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class HoodieTestHiveBase extends ITTestBase {
|
||||
tableType, hiveTableName, commitType, hoodieTableName);
|
||||
if (partitionType == PartitionType.MULTI_KEYS_PARTITIONED) {
|
||||
cmd = cmd + " --use-multi-partition-keys";
|
||||
} else if (partitionType == PartitionType.NON_PARTITIONED){
|
||||
} else if (partitionType == PartitionType.NON_PARTITIONED) {
|
||||
cmd = cmd + " --non-partitioned";
|
||||
}
|
||||
executeCommandStringInDocker(ADHOC_1_CONTAINER, cmd, true);
|
||||
|
||||
@@ -166,7 +166,7 @@ public abstract class ITTestBase {
|
||||
// try to capture stdout and stderr of the stuck process.
|
||||
|
||||
boolean completed =
|
||||
dockerClient.execStartCmd(createCmdResponse.getId()).withDetach(false).withTty(false).exec(callback)
|
||||
dockerClient.execStartCmd(createCmdResponse.getId()).withDetach(false).withTty(false).exec(callback)
|
||||
.awaitCompletion(540, SECONDS);
|
||||
if (!completed) {
|
||||
callback.getStderr().flush();
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ package org.apache.hudi.integ.testsuite.converter;
|
||||
|
||||
import static junit.framework.TestCase.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -66,7 +66,8 @@ class HoodieDataSourceInternalTable implements SupportsWrite {
|
||||
return new HashSet<TableCapability>() {{
|
||||
add(TableCapability.BATCH_WRITE);
|
||||
add(TableCapability.TRUNCATE);
|
||||
}};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user