-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use AutoValue for ActionProgressEvent
- Loading branch information
Showing
3 changed files
with
18 additions
and
34 deletions.
There are no files selected for viewing
40 changes: 12 additions & 28 deletions
40
src/main/java/com/google/devtools/build/lib/actions/ActionProgressEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,26 @@ | ||
package com.google.devtools.build.lib.actions; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.google.devtools.build.lib.events.ExtendedEventHandler.ProgressLike; | ||
|
||
/** | ||
* Notifies that an in-flight action is making progress. | ||
*/ | ||
public class ActionProgressEvent implements ProgressLike { | ||
private final ActionExecutionMetadata action; | ||
private final String progressId; | ||
private final String progress; | ||
private final boolean isFinished; | ||
/** Notifies that an in-flight action is making progress. */ | ||
@AutoValue | ||
public abstract class ActionProgressEvent implements ProgressLike { | ||
|
||
public ActionProgressEvent(ActionExecutionMetadata action, String progressId, String progress, boolean isFinished) { | ||
this.action = action; | ||
this.progressId = progressId; | ||
this.progress = progress; | ||
this.isFinished = isFinished; | ||
public static ActionProgressEvent create( | ||
ActionExecutionMetadata action, String progressId, String progress, boolean finished) { | ||
return new AutoValue_ActionProgressEvent(action, progressId, progress, finished); | ||
} | ||
|
||
/** Gets the metadata associated with the action being scheduled. */ | ||
public ActionExecutionMetadata getActionMetadata() { | ||
return action; | ||
} | ||
public abstract ActionExecutionMetadata action(); | ||
|
||
/** | ||
* The id that uniquely determines the progress among all progress events within an action. | ||
*/ | ||
public String getProgressId() { | ||
return progressId; | ||
} | ||
/** The id that uniquely determines the progress among all progress events within an action. */ | ||
public abstract String progressId(); | ||
|
||
/** Human readable description of the progress */ | ||
public String getProgress() { | ||
return progress; | ||
} | ||
public abstract String progress(); | ||
|
||
/** Whether the download progress reported about is finished already */ | ||
public boolean isFinished() { | ||
return isFinished; | ||
} | ||
public abstract boolean finished(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters