Skip to content

Commit

Permalink
HUDI-5027. Fix CheckStyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 authored and yihua committed Oct 22, 2022
1 parent 30fd8c4 commit dc85aaa
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static List<String> filterKeysFromFile(Path filePath, List<String> candid
try {
// Load all rowKeys from the file, to double-confirm
if (!candidateRecordKeys.isEmpty()) {
HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
HoodieFileReader fileReader = HoodieFileReaderFactory.getFileReader(configuration, filePath);
Set<String> fileRowKeys = fileReader.filterRowKeys(new TreeSet<>(candidateRecordKeys));
foundRecordKeys.addAll(fileRowKeys);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public HoodieKeyLookupHandle(HoodieWriteConfig config, HoodieTable<T, I, K, O> h

private BloomFilter getBloomFilter() {
BloomFilter bloomFilter = null;
HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
try {
if (config.getBloomIndexUseMetadata()
&& hoodieTable.getMetaClient().getTableConfig().getMetadataPartitions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected HoodieWriteHandle(HoodieWriteConfig config, String instantTime, String
this.tableSchemaWithMetaFields = HoodieAvroUtils.addMetadataFields(tableSchema, config.allowOperationMetadataField());
this.writeSchema = overriddenSchema.orElseGet(() -> getWriteSchema(config));
this.writeSchemaWithMetaFields = HoodieAvroUtils.addMetadataFields(writeSchema, config.allowOperationMetadataField());
this.timer = new HoodieTimer().startTimer();
this.timer = HoodieTimer.start().startTimer();
this.writeStatus = (WriteStatus) ReflectionUtils.loadClass(config.getWriteStatusClassName(),
!hoodieTable.getIndex().isImplicitWithStorage(), config.getWriteStatusFailureFraction());
this.taskContextSupplier = taskContextSupplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public void initTableMetadata() {
protected <T extends SpecificRecordBase> void initializeIfNeeded(HoodieTableMetaClient dataMetaClient,
Option<T> actionMetadata,
Option<String> inflightInstantTimestamp) throws IOException {
HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();

boolean exists = metadataTableExists(dataMetaClient, actionMetadata);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private HoodieCleanMetadata runClean(HoodieTable<T, I, K, O> table, HoodieInstan

HoodieInstant inflightInstant = null;
try {
final HoodieTimer timer = new HoodieTimer();
final HoodieTimer timer = HoodieTimer.start();
timer.startTimer();
if (cleanInstant.isRequested()) {
inflightInstant = table.getActiveTimeline().transitionCleanRequestedToInflight(cleanInstant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public RunIndexActionExecutor(HoodieEngineContext context, HoodieWriteConfig con

@Override
public Option<HoodieIndexCommitMetadata> execute() {
HoodieTimer indexTimer = new HoodieTimer();
HoodieTimer indexTimer = HoodieTimer.start();
indexTimer.startTimer();

HoodieInstant indexInstant = validateAndGetIndexInstant();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public BaseRestoreActionExecutor(HoodieEngineContext context,

@Override
public HoodieRestoreMetadata execute() {
HoodieTimer restoreTimer = new HoodieTimer();
HoodieTimer restoreTimer = HoodieTimer.start();
restoreTimer.startTimer();

Option<HoodieInstant> restoreInstant = table.getRestoreTimeline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private HoodieRollbackMetadata runRollback(HoodieTable<T, I, K, O> table, Hoodie
? table.getActiveTimeline().transitionRollbackRequestedToInflight(rollbackInstant)
: rollbackInstant;

HoodieTimer rollbackTimer = new HoodieTimer().startTimer();
HoodieTimer rollbackTimer = HoodieTimer.start().startTimer();
List<HoodieRollbackStat> stats = doRollbackAndGetStats(rollbackPlan);
HoodieRollbackMetadata rollbackMetadata = TimelineMetadataUtils.convertRollbackMetadata(
instantTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public CopyOnWriteRollbackActionExecutor(HoodieEngineContext context,

@Override
protected List<HoodieRollbackStat> executeRollback(HoodieRollbackPlan hoodieRollbackPlan) {
HoodieTimer rollbackTimer = new HoodieTimer();
HoodieTimer rollbackTimer = HoodieTimer.start();
rollbackTimer.startTimer();

List<HoodieRollbackStat> stats = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public MergeOnReadRollbackActionExecutor(HoodieEngineContext context,

@Override
protected List<HoodieRollbackStat> executeRollback(HoodieRollbackPlan hoodieRollbackPlan) {
HoodieTimer rollbackTimer = new HoodieTimer();
HoodieTimer rollbackTimer = HoodieTimer.start();
rollbackTimer.startTimer();

LOG.info("Rolling back instant " + instantToRollback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected Option<Path> create(String partitionPath, String dataFileName, IOType
}

private Option<Path> create(Path markerPath, boolean checkIfExists) {
HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
Path dirPath = markerPath.getParent();
try {
if (!fs.exists(dirPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public Set<String> allMarkerFilePaths() {

@Override
protected Option<Path> create(String partitionPath, String dataFileName, IOType type, boolean checkIfExists) {
HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
String markerFileName = getMarkerFileName(dataFileName, type);

Map<String, String> paramsMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public HoodieRowDataCreateHandle(HoodieTable table, HoodieWriteConfig writeConfi
this.taskEpochId = taskEpochId;
this.fileId = fileId;
this.preserveHoodieMetadata = preserveHoodieMetadata;
this.currTimer = new HoodieTimer();
this.currTimer = HoodieTimer.start();
this.currTimer.startTimer();
this.fs = table.getMetaClient().getFs();
this.path = makeNewPath(partitionPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private static long mapColumnValueToLong(Row row, int index, DataType dataType)
} else if (dataType instanceof IntegerType) {
return row.isNullAt(index) ? Long.MAX_VALUE : (long) row.getInt(index);
} else if (dataType instanceof FloatType) {
return row.isNullAt(index) ? Long.MAX_VALUE : Double.doubleToLongBits((double) row.getFloat(index));
return row.isNullAt(index) ? Long.MAX_VALUE : Double.doubleToLongBits(row.getFloat(index));
} else if (dataType instanceof StringType) {
return row.isNullAt(index) ? Long.MAX_VALUE : BinaryUtil.convertStringToLong(row.getString(index));
} else if (dataType instanceof DateType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public SparkDeletePartitionCommitActionExecutor(HoodieEngineContext context,
@Override
public HoodieWriteMetadata<HoodieData<WriteStatus>> execute() {
try {
HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
context.setJobStatus(this.getClass().getSimpleName(), "Gather all file ids from all deleting partitions.");
Map<String, List<String>> partitionToReplaceFileIds =
HoodieJavaPairRDD.getJavaPairRDD(context.parallelize(partitions).distinct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,7 @@ private void validateMetadata(SparkRDDWriteClient testClient) throws IOException
return;
}

HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
HoodieSparkEngineContext engineContext = new HoodieSparkEngineContext(jsc);

// Partitions should match
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public void validateMetadata(HoodieTestTable testTable, List<String> inflightCom
}
assertEquals(inflightCommits, testTable.inflightCommits());

HoodieTimer timer = new HoodieTimer().startTimer();
HoodieTimer timer = HoodieTimer.start().startTimer();
HoodieSparkEngineContext engineContext = new HoodieSparkEngineContext(jsc);

// Partitions should match
Expand Down

0 comments on commit dc85aaa

Please sign in to comment.