Skip to content

update code style for task type#16343

Merged
abhishekrb19 merged 2 commits intoapache:masterfrom
AlbericByte:task_code_style
Apr 29, 2024
Merged

update code style for task type#16343
abhishekrb19 merged 2 commits intoapache:masterfrom
AlbericByte:task_code_style

Conversation

@AlbericByte
Copy link
Contributor

@AlbericByte AlbericByte commented Apr 27, 2024

Fixes code style for task type

Description

  • add TYPE property in each task
  • use this property in annotation

Fixed the bug ...

Renamed the class ...

Added a forbidden-apis entry ...

Release note

improve the code style of task type, to be consistent for each sub task


Key changed/added classes in this PR
  • AppenderatorDriverRealtimeIndexTask.java
  • ArchiveTask.java
  • CompactionTask.java
  • HadoopIndexTask.java
  • IndexTask.java
  • MoveTask.java
  • NoopTask.java
  • RealtimeIndexTask.java
  • RestoreTask.java
  • Task.java

This PR has:

  • been self-reviewed.
  • using the concurrency checklist (Remove this item if the PR doesn't have any relation to concurrency.)
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@AlbericByte
Copy link
Contributor Author

The failed check is cause by "Rate limit reached"

*/
public class NoopTask extends AbstractTask implements PendingSegmentAllocatingTask
{
public static final String TYPE = "noop";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also change getType() to return TYPE instead of the hardcoded value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch and fixed.


public class HadoopIndexTask extends HadoopTask implements ChatHandler
{
public static final String TYPE = "index_hadoop";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here regarding getType() using TYPE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch and fixed.

@abhishekrb19
Copy link
Contributor

Thanks for the contribution!

@abhishekrb19 abhishekrb19 merged commit 736a2ab into apache:master Apr 29, 2024
@AlbericByte AlbericByte deleted the task_code_style branch April 30, 2024 17:51
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants