[HUDI-751] Fix some coding issues reported by FindBugs (#1470)
This commit is contained in:
@@ -66,6 +66,7 @@ import scala.Tuple2;
|
||||
*/
|
||||
public class HDFSParquetImporter implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger LOG = LogManager.getLogger(HDFSParquetImporter.class);
|
||||
|
||||
private static final DateTimeFormatter PARTITION_FORMATTER = DateTimeFormatter.ofPattern("yyyy/MM/dd")
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class Compactor implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger LOG = LogManager.getLogger(Compactor.class);
|
||||
|
||||
private transient HoodieWriteClient compactionClient;
|
||||
|
||||
@@ -83,9 +83,10 @@ import static org.apache.hudi.utilities.schema.RowBasedSchemaProvider.HOODIE_REC
|
||||
*/
|
||||
public class DeltaSync implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger LOG = LogManager.getLogger(DeltaSync.class);
|
||||
public static String CHECKPOINT_KEY = "deltastreamer.checkpoint.key";
|
||||
public static String CHECKPOINT_RESET_KEY = "deltastreamer.checkpoint.reset_key";
|
||||
public static final String CHECKPOINT_KEY = "deltastreamer.checkpoint.key";
|
||||
public static final String CHECKPOINT_RESET_KEY = "deltastreamer.checkpoint.reset_key";
|
||||
|
||||
/**
|
||||
* Delta Sync Config.
|
||||
|
||||
@@ -77,6 +77,7 @@ import java.util.stream.IntStream;
|
||||
*/
|
||||
public class HoodieDeltaStreamer implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger LOG = LogManager.getLogger(HoodieDeltaStreamer.class);
|
||||
|
||||
public static String CHECKPOINT_KEY = "deltastreamer.checkpoint.key";
|
||||
@@ -302,6 +303,7 @@ public class HoodieDeltaStreamer implements Serializable {
|
||||
*/
|
||||
public static class DeltaSyncService extends AbstractDeltaStreamerService {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* Delta Sync Config.
|
||||
*/
|
||||
@@ -489,6 +491,7 @@ public class HoodieDeltaStreamer implements Serializable {
|
||||
*/
|
||||
public static class AsyncCompactService extends AbstractDeltaStreamerService {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final int maxConcurrentCompaction;
|
||||
private transient Compactor compactor;
|
||||
private transient JavaSparkContext jssc;
|
||||
|
||||
@@ -58,6 +58,7 @@ import java.util.stream.IntStream;
|
||||
|
||||
public class TimelineServerPerf implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger LOG = LogManager.getLogger(TimelineServerPerf.class);
|
||||
private final Config cfg;
|
||||
private transient TimelineService timelineServer;
|
||||
|
||||
@@ -58,10 +58,12 @@ import java.util.List;
|
||||
* passed to the CSV reader without inferring the schema from the CSV file.
|
||||
*/
|
||||
public class CsvDFSSource extends RowSource {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
// CsvSource config prefix
|
||||
public static final String CSV_SRC_CONFIG_PREFIX = "hoodie.deltastreamer.csv.";
|
||||
protected static final String CSV_SRC_CONFIG_PREFIX = "hoodie.deltastreamer.csv.";
|
||||
// CSV-specific configurations to pass in from Hudi to Spark
|
||||
public static final List<String> CSV_CONFIG_KEYS = Arrays.asList(
|
||||
protected static final List<String> CSV_CONFIG_KEYS = Arrays.asList(
|
||||
"sep", "encoding", "quote", "escape", "charToEscapeQuoteEscaping", "comment",
|
||||
"header", "enforceSchema", "inferSchema", "samplingRatio", "ignoreLeadingWhiteSpace",
|
||||
"ignoreTrailingWhiteSpace", "nullValue", "emptyValue", "nanValue", "positiveInf",
|
||||
@@ -69,7 +71,7 @@ public class CsvDFSSource extends RowSource {
|
||||
"mode", "columnNameOfCorruptRecord", "multiLine"
|
||||
);
|
||||
|
||||
private final DFSPathSelector pathSelector;
|
||||
private final transient DFSPathSelector pathSelector;
|
||||
private final StructType sourceSchema;
|
||||
|
||||
public CsvDFSSource(TypedProperties props,
|
||||
|
||||
@@ -59,6 +59,8 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class HiveIncrPullSource extends AvroSource {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger LOG = LogManager.getLogger(HiveIncrPullSource.class);
|
||||
|
||||
private final transient FileSystem fs;
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class AvroConvertor implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* To be lazily inited on executors.
|
||||
*/
|
||||
|
||||
@@ -85,7 +85,7 @@ public class DFSPathSelector {
|
||||
long maxModificationTime = Long.MIN_VALUE;
|
||||
List<FileStatus> filteredFiles = new ArrayList<>();
|
||||
for (FileStatus f : eligibleFiles) {
|
||||
if (lastCheckpointStr.isPresent() && f.getModificationTime() <= Long.valueOf(lastCheckpointStr.get())) {
|
||||
if (lastCheckpointStr.isPresent() && f.getModificationTime() <= Long.valueOf(lastCheckpointStr.get()).longValue()) {
|
||||
// skip processed files
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user