You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2025/09/04 05:54:51 UTC

[PR] Remove type params from MetadataStorageActionHandler (druid)

kfaraz opened a new pull request, #18479:
URL: https://github.com/apache/druid/pull/18479

   ### Description
   
   The `MetadataStorageActionHandler` deals with persistence of `Task` and related objects.
   But those model classes exist in `indexing-service` module which forces the `MetadataStorageActionHandler`
   to deal with generics unnecessarily. This makes the code cluttered and difficult to understand at times.
   
   ### Changes
   
   - Move `MetadataStorageActionHandler` and factory classes to `indexing-service` module
   - Move implementations to respective extensions
   - Simplify class `TaskInfo` by removing type parameters
   - Add class `TaskIdWithStatus`
   - Remove class `TaskStuff`
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (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](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] 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](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Remove type params from MetadataStorageActionHandler (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #18479:
URL: https://github.com/apache/druid/pull/18479#discussion_r2322558900


##########
processing/src/main/java/org/apache/druid/indexer/TaskIdStatus.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.indexer;
+
+import org.joda.time.DateTime;
+
+/**
+ * Contains a {@link TaskIdentifier} and its {@link TaskStatus}.
+ */
+public class TaskIdStatus
+{
+  private final TaskIdentifier taskId;
+  private final TaskStatus taskStatus;
+  private final String dataSource;
+  private final DateTime createdTime;
+
+  public TaskIdStatus(
+      TaskIdentifier taskId,
+      TaskStatus taskStatus,
+      String dataSource,
+      DateTime createdTime
+  )
+  {
+    this.taskId = taskId;

Review Comment:
   Sure, do you mean a null check?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Refactor: Remove type params from MetadataStorageActionHandler (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #18479:
URL: https://github.com/apache/druid/pull/18479#issuecomment-3260232921

   Thanks for the reviews, @jtuglu1 , @gianm !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Remove type params from MetadataStorageActionHandler (druid)

Posted by "jtuglu1 (via GitHub)" <gi...@apache.org>.
jtuglu1 commented on code in PR #18479:
URL: https://github.com/apache/druid/pull/18479#discussion_r2321147875


##########
processing/src/main/java/org/apache/druid/indexer/TaskIdStatus.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.indexer;
+
+import org.joda.time.DateTime;
+
+/**
+ * Contains a {@link TaskIdentifier} and its {@link TaskStatus}.
+ */
+public class TaskIdStatus
+{
+  private final TaskIdentifier taskId;
+  private final TaskStatus taskStatus;
+  private final String dataSource;
+  private final DateTime createdTime;
+
+  public TaskIdStatus(
+      TaskIdentifier taskId,
+      TaskStatus taskStatus,
+      String dataSource,
+      DateTime createdTime
+  )
+  {
+    this.taskId = taskId;

Review Comment:
   I'm assuming we don't want to perform validations on these fields?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Remove type params from MetadataStorageActionHandler (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #18479:
URL: https://github.com/apache/druid/pull/18479#discussion_r2322558900


##########
processing/src/main/java/org/apache/druid/indexer/TaskIdStatus.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.indexer;
+
+import org.joda.time.DateTime;
+
+/**
+ * Contains a {@link TaskIdentifier} and its {@link TaskStatus}.
+ */
+public class TaskIdStatus
+{
+  private final TaskIdentifier taskId;
+  private final TaskStatus taskStatus;
+  private final String dataSource;
+  private final DateTime createdTime;
+
+  public TaskIdStatus(
+      TaskIdentifier taskId,
+      TaskStatus taskStatus,
+      String dataSource,
+      DateTime createdTime
+  )
+  {
+    this.taskId = taskId;

Review Comment:
   Do you mean a null check?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Refactor: Remove type params from MetadataStorageActionHandler (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz merged PR #18479:
URL: https://github.com/apache/druid/pull/18479


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org