1
0

[HUDI-482] Fix missing @Override annotation on methods (#1156)

* [HUDI-482] Fix missing @Override annotation on methods
This commit is contained in:
lamber-ken
2019-12-30 21:44:56 -06:00
committed by vinoyang
parent 2a823f32ee
commit ab6ae5cebb
23 changed files with 42 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ import org.springframework.stereotype.Component;
@Order(Ordered.HIGHEST_PRECEDENCE)
public class HoodieHistoryFileNameProvider extends DefaultHistoryFileNameProvider {
@Override
public String getHistoryFileName() {
return "hoodie-cmd.log";
}

View File

@@ -50,14 +50,17 @@ public class HoodieSplashScreen extends DefaultBannerProvider {
+ "* *" + OsUtils.LINE_SEPARATOR
+ "===================================================================" + OsUtils.LINE_SEPARATOR;
@Override
public String getBanner() {
return screen;
}
@Override
public String getVersion() {
return "1.0";
}
@Override
public String getWelcomeMessage() {
return "Welcome to Apache Hudi CLI. Please type help if you are looking for help. ";
}

View File

@@ -72,6 +72,7 @@ public abstract class AbstractHoodieClient implements Serializable, AutoCloseabl
/**
* Releases any resources used by the client.
*/
@Override
public void close() {
stopEmbeddedServerView(true);
}

View File

@@ -973,6 +973,7 @@ public class HoodieWriteClient<T extends HoodieRecordPayload> extends AbstractHo
/**
* Releases any resources used by the client.
*/
@Override
public void close() {
// Stop timeline-server if running
super.close();

View File

@@ -48,6 +48,7 @@ public class SparkBoundedInMemoryExecutor<I, O, E> extends BoundedInMemoryExecut
this.sparkThreadTaskContext = TaskContext.get();
}
@Override
public void preExecute() {
// Passing parent thread's TaskContext to newly launched thread for it to access original TaskContext properties.
TaskContext$.MODULE$.setTaskContext(sparkThreadTaskContext);

View File

@@ -88,6 +88,7 @@ public class BloomIndexFileInfo implements Serializable {
return Objects.hashCode(fileId, minRecordKey, maxRecordKey);
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("BloomIndexFileInfo {");
sb.append(" fileId=").append(fileId);

View File

@@ -154,6 +154,7 @@ public class HBaseIndex<T extends HoodieRecordPayload> extends HoodieIndex<T> {
*/
private void addShutDownHook() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
hbaseConnection.close();
@@ -167,6 +168,7 @@ public class HBaseIndex<T extends HoodieRecordPayload> extends HoodieIndex<T> {
/**
* Ensure that any resources used for indexing are released here.
*/
@Override
public void close() {
this.hBaseIndexQPSResourceAllocator.releaseQPSResources();
}

View File

@@ -94,6 +94,7 @@ public class HoodieCreateHandle<T extends HoodieRecordPayload> extends HoodieWri
/**
* Perform the actual writing of the given record into the backing file.
*/
@Override
public void write(HoodieRecord record, Option<IndexedRecord> avroRecord) {
Option recordMetadata = record.getData().getMetadata();
try {

View File

@@ -92,6 +92,7 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload> extends HoodieWrit
return HoodieAvroUtils.addMetadataFields(originalSchema);
}
@Override
public Path makeNewPath(String partitionPath) {
Path path = FSUtils.getPartitionPath(config.getBasePath(), partitionPath);
try {
@@ -103,6 +104,7 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload> extends HoodieWrit
return new Path(path.toString(), FSUtils.makeDataFileName(instantTime, writeToken, fileId));
}
@Override
public Schema getWriterSchema() {
return writerSchema;
}
@@ -113,6 +115,7 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload> extends HoodieWrit
* - Whether it belongs to the same partitionPath as existing records - Whether the current file written bytes lt max
* file size
*/
@Override
public boolean canWrite(HoodieRecord record) {
return false;
}
@@ -120,6 +123,7 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload> extends HoodieWrit
/**
* Perform the actual writing of the given record into the backing file.
*/
@Override
public void write(HoodieRecord record, Option<IndexedRecord> insertValue) {
// NO_OP
}
@@ -127,6 +131,7 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload> extends HoodieWrit
/**
* Perform the actual writing of the given record into the backing file.
*/
@Override
public void write(HoodieRecord record, Option<IndexedRecord> avroRecord, Option<Exception> exception) {
Option recordMetadata = record.getData().getMetadata();
if (exception.isPresent() && exception.get() instanceof Throwable) {
@@ -141,6 +146,7 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload> extends HoodieWrit
/**
* Rewrite the GenericRecord with the Schema containing the Hoodie Metadata fields.
*/
@Override
protected GenericRecord rewriteRecord(GenericRecord record) {
return HoodieAvroUtils.rewriteRecord(record, writerSchema);
}

View File

@@ -93,6 +93,7 @@ public class HoodieParquetWriter<T extends HoodieRecordPayload, R extends Indexe
writeSupport.add(record.getRecordKey());
}
@Override
public boolean canWrite() {
return fs.getBytesWritten(file) < maxFileSize;
}

View File

@@ -279,6 +279,7 @@ public class HoodieCopyOnWriteTable<T extends HoodieRecordPayload> extends Hoodi
* @param jsc JavaSparkContext
* @return Cleaner Plan
*/
@Override
public HoodieCleanerPlan scheduleClean(JavaSparkContext jsc) {
try {
HoodieCleanHelper cleaner = new HoodieCleanHelper(this, config);

View File

@@ -108,6 +108,7 @@ class HoodieLogFileReader implements HoodieLogFormat.Reader {
*/
private void addShutDownHook() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
close();

View File

@@ -107,6 +107,7 @@ public class HoodieLogFormatWriter implements HoodieLogFormat.Writer {
return fs;
}
@Override
public HoodieLogFile getLogFile() {
return logFile;
}
@@ -212,6 +213,7 @@ public class HoodieLogFormatWriter implements HoodieLogFormat.Writer {
output.hsync();
}
@Override
public long getCurrentSize() throws IOException {
if (output == null) {
throw new IllegalStateException("Cannot get current size as the underlying stream has been closed already");

View File

@@ -145,6 +145,7 @@ public class HoodieActiveTimeline extends HoodieDefaultTimeline {
* timeline * With Async compaction a requested/inflight compaction-instant is a valid baseInstant for a file-slice as
* there could be delta-commits with that baseInstant.
*/
@Override
public HoodieTimeline getCommitsAndCompactionTimeline() {
return getTimelineOfActions(Sets.newHashSet(COMMIT_ACTION, DELTA_COMMIT_ACTION, COMPACTION_ACTION));
}

View File

@@ -182,6 +182,7 @@ public abstract class AbstractTableFileSystemView implements SyncableFileSystemV
/**
* Clears the partition Map and reset view states.
*/
@Override
public final void reset() {
try {
writeLock.lock();
@@ -380,6 +381,7 @@ public abstract class AbstractTableFileSystemView implements SyncableFileSystemV
/**
* Get Latest data file for a partition and file-Id.
*/
@Override
public final Option<HoodieDataFile> getLatestDataFile(String partitionStr, String fileId) {
try {
readLock.lock();
@@ -434,6 +436,7 @@ public abstract class AbstractTableFileSystemView implements SyncableFileSystemV
/**
* Get Latest File Slice for a given fileId in a given partition.
*/
@Override
public final Option<FileSlice> getLatestFileSlice(String partitionStr, String fileId) {
try {
readLock.lock();

View File

@@ -205,6 +205,7 @@ public class HoodieTableFileSystemView extends IncrementalTimelineSyncFileSystem
});
}
@Override
public void close() {
closed = true;
super.reset();
@@ -212,6 +213,7 @@ public class HoodieTableFileSystemView extends IncrementalTimelineSyncFileSystem
fgIdToPendingCompaction = null;
}
@Override
public boolean isClosed() {
return closed;
}

View File

@@ -76,6 +76,7 @@ public class SpillableMapBasedFileSystemView extends HoodieTableFileSystemView {
}
}
@Override
protected Map<HoodieFileGroupId, Pair<String, CompactionOperation>> createFileIdToPendingCompactionMap(
Map<HoodieFileGroupId, Pair<String, CompactionOperation>> fgIdToPendingCompaction) {
try {
@@ -91,6 +92,7 @@ public class SpillableMapBasedFileSystemView extends HoodieTableFileSystemView {
}
}
@Override
public Stream<HoodieFileGroup> getAllFileGroups() {
return ((ExternalSpillableMap) partitionToFileGroupsMap).valueStream()
.flatMap(fg -> ((List<HoodieFileGroup>) fg).stream());

View File

@@ -124,6 +124,7 @@ public class ObjectSizeCalculator {
private final LoadingCache<Class<?>, ClassSizeInfo> classSizeInfos =
CacheBuilder.newBuilder().build(new CacheLoader<Class<?>, ClassSizeInfo>() {
@Override
public ClassSizeInfo load(Class<?> clazz) {
return new ClassSizeInfo(clazz);
}

View File

@@ -125,6 +125,7 @@ public final class DiskBasedMap<T extends Serializable, R extends Serializable>
*/
private void addShutDownHook() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
if (writeOnlyFileHandle != null) {

View File

@@ -115,6 +115,7 @@ public class LazyFileIterable<T, R> implements Iterable<R> {
private void addShutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
close();
}

View File

@@ -173,10 +173,12 @@ public class HoodieParquetInputFormat extends MapredParquetInputFormat implement
return grouped;
}
@Override
public void setConf(Configuration conf) {
this.conf = conf;
}
@Override
public Configuration getConf() {
return conf;
}

View File

@@ -805,6 +805,7 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
public HoodieCombineFileInputFormatShim() {}
@Override
public Path[] getInputPathsShim(JobConf conf) {
try {
return FileInputFormat.getInputPaths(conf);
@@ -813,6 +814,7 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
}
}
@Override
public void createPool(JobConf conf, PathFilter... filters) {
super.createPool(conf, filters);
}
@@ -822,6 +824,7 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
throw new IOException("CombineFileInputFormat.getRecordReader not needed.");
}
@Override
protected List<FileStatus> listStatus(JobContext job) throws IOException {
LOG.info("Listing status in HoodieCombineHiveInputFormat.HoodieCombineFileInputFormatShim");
List<FileStatus> result;
@@ -851,6 +854,7 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
return result;
}
@Override
public CombineFileSplit[] getSplits(JobConf job, int numSplits) throws IOException {
long minSize = job.getLong(org.apache.hadoop.mapreduce.lib.input.FileInputFormat.SPLIT_MINSIZE, 0L);
if (job.getLong("mapreduce.input.fileinputformat.split.minsize.per.node", 0L) == 0L) {
@@ -879,10 +883,12 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
return (CombineFileSplit[]) inputSplitShims.toArray(new HadoopShimsSecure.InputSplitShim[inputSplitShims.size()]);
}
@Override
public HadoopShimsSecure.InputSplitShim getInputSplitShim() throws IOException {
return new HadoopShimsSecure.InputSplitShim();
}
@Override
public RecordReader getRecordReader(JobConf job, CombineFileSplit split, Reporter reporter,
Class<RecordReader<K, V>> rrClass) throws IOException {
return new HadoopShimsSecure.CombineFileRecordReader(job, split, reporter, rrClass);

View File

@@ -554,6 +554,7 @@ public class HoodieDeltaStreamer implements Serializable {
/**
* Start Compaction Service.
*/
@Override
protected Pair<CompletableFuture, ExecutorService> startService() {
ExecutorService executor = Executors.newFixedThreadPool(maxConcurrentCompaction);
List<CompletableFuture<Boolean>> compactionFutures =