keith-turner commented on code in PR #3801:
URL: https://github.com/apache/accumulo/pull/3801#discussion_r1344451173


##########
core/src/main/thrift/tasks.thrift:
##########
@@ -0,0 +1,127 @@
+/*
+ * 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
+ *
+ *   https://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.
+ */
+namespace java org.apache.accumulo.core.tasks.thrift
+namespace cpp org.apache.accumulo.core.tasks.thrift
+
+include "security.thrift"
+include "client.thrift"
+include "tabletserver.thrift"
+
+enum WorkerType {
+  COMPACTION
+  LOG_SORTING
+  SPLIT_POINT_CALCULATION
+}
+
+struct TaskRunnerInfo {
+ 1:string hostname
+ 2:i32 port
+ 3:WorkerType workerType
+ 4:string resourceGroup
+}
+
+struct Task {
+  1:string taskId
+  2:string messageType
+  3:string message
+}
+
+service TaskManager {
+
+  Task getTask(
+    1:client.TInfo tinfo
+    2:security.TCredentials credentials  
+    3:TaskRunnerInfo taskRunner
+    4:string taskID  
+  )
+
+  oneway void taskStatus(
+    1:client.TInfo tinfo
+    2:security.TCredentials credentials
+    3:i64 timestamp
+    4:Task taskUpdateObject
+  )
+
+  void taskCompleted(
+    1:client.TInfo tinfo
+    2:security.TCredentials credentials  
+    3:Task task  
+  )
+
+  void taskFailed(
+    1:client.TInfo tinfo
+    2:security.TCredentials credentials  
+    3:Task task  
+  )
+  
+  void cancelTask(
+    1:client.TInfo tinfo
+    2:security.TCredentials credentials
+    3:string taskID
+  )
+
+  /*
+   * Called by the Monitor to get progress information
+   */
+  Task getRunningTasks(

Review Comment:
   This comment is soley for discussion, not recommending any changes.  
Thinking it would be best to push as much serialization into thrift as possible 
for things that are common.  Took a stab at this below, but not sure if its 
workable.
   
   ```
   // renamed from WorkerType
   enum TaskType {
     COMPACTION
     LOG_SORTING
     SPLIT_POINT_CALCULATION
   }
   
   enum TaskState {
      RUNNING,
      COMPLETE,
      FAILED
   }
   
   // used to report the status of a task
   struct TaskStatus {
       string taskId
       long startTime  // time a worker started running the task
       TaskType taskType
       TaskState taskState
       byte[] data // status data specific to the taskType and taskState
   }
   
   list<TaskStatus> getRunningTasks(
   ```



##########
server/manager/src/main/java/org/apache/accumulo/manager/tasks/DeadCompactionDetector.java:
##########
@@ -126,7 +126,7 @@ private void detectDeadCompactions() {
 
   public void start() {
     long interval = this.context.getConfiguration()
-        
.getTimeInMillis(Property.COMPACTION_COORDINATOR_DEAD_COMPACTOR_CHECK_INTERVAL);
+        .getTimeInMillis(Property.TASK_MANAGER_DEAD_COMPACTOR_CHECK_INTERVAL);

Review Comment:
   Nothing to do in this PR, but I think in general we may need reconsider some 
of the property prefixes. Opened #3803 for this. For this property maybe it 
should have a another prefix that is not related to where its running, but is 
more related to the compaction functionality.  Not sure though, would be best 
to consider all properties are once for this instead of looking at this one in 
isolation.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to