You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/09/28 03:18:04 UTC

[GitHub] [james-project] vttranlina commented on a diff in pull request #1208: JAMES-3825 Task to clean up tasks

vttranlina commented on code in PR #1208:
URL: https://github.com/apache/james-project/pull/1208#discussion_r981902846


##########
server/task/task-distributed/src/main/scala/org/apache/james/task/eventsourcing/cassandra/CassandraTaskExecutionDetailsProjectionModule.scala:
##########
@@ -44,19 +45,20 @@ object CassandraTaskExecutionDetailsProjectionModule {
 
   val MODULE: CassandraModule = CassandraModule.table(CassandraTaskExecutionDetailsProjectionTable.TABLE_NAME)
     .comment("Projection of TaskExecutionDetails used by the distributed task manager")
-    .options(options => options.withCaching(true, SchemaBuilder.RowsPerPartition.NONE))
+    .options(options => options.withCaching(true, SchemaBuilder.RowsPerPartition.NONE)
+      .withClusteringOrder(CassandraTaskExecutionDetailsProjectionTable.SUBMITTED_DATE, ClusteringOrder.ASC))
     .statement(statement => types => statement
       .withPartitionKey(CassandraTaskExecutionDetailsProjectionTable.TASK_ID, DataTypes.UUID)
+      .withClusteringColumn(CassandraTaskExecutionDetailsProjectionTable.SUBMITTED_DATE, DataTypes.TIMESTAMP)
       .withColumn(CassandraTaskExecutionDetailsProjectionTable.ADDITIONAL_INFORMATION, DataTypes.TEXT)
       .withColumn(CassandraTaskExecutionDetailsProjectionTable.TYPE, DataTypes.TEXT)
       .withColumn(CassandraTaskExecutionDetailsProjectionTable.STATUS, DataTypes.TEXT)
-      .withColumn(CassandraTaskExecutionDetailsProjectionTable.SUBMITTED_DATE, types.getDefinedUserType(CassandraZonedDateTimeModule.ZONED_DATE_TIME))
       .withColumn(CassandraTaskExecutionDetailsProjectionTable.SUBMITTED_NODE, DataTypes.TEXT)
-      .withColumn(CassandraTaskExecutionDetailsProjectionTable.STARTED_DATE, types.getDefinedUserType(CassandraZonedDateTimeModule.ZONED_DATE_TIME))
+      .withColumn(CassandraTaskExecutionDetailsProjectionTable.STARTED_DATE, DataTypes.TIMESTAMP)
       .withColumn(CassandraTaskExecutionDetailsProjectionTable.RAN_NODE, DataTypes.TEXT)
-      .withColumn(CassandraTaskExecutionDetailsProjectionTable.COMPLETED_DATE, types.getDefinedUserType(CassandraZonedDateTimeModule.ZONED_DATE_TIME))
-      .withColumn(CassandraTaskExecutionDetailsProjectionTable.CANCELED_DATE, types.getDefinedUserType(CassandraZonedDateTimeModule.ZONED_DATE_TIME))
+      .withColumn(CassandraTaskExecutionDetailsProjectionTable.COMPLETED_DATE, DataTypes.TIMESTAMP)
+      .withColumn(CassandraTaskExecutionDetailsProjectionTable.CANCELED_DATE, DataTypes.TIMESTAMP)
       .withColumn(CassandraTaskExecutionDetailsProjectionTable.CANCEL_REQUESTED_NODE, DataTypes.TEXT)
-      .withColumn(CassandraTaskExecutionDetailsProjectionTable.FAILED_DATE, types.getDefinedUserType(CassandraZonedDateTimeModule.ZONED_DATE_TIME)))
+      .withColumn(CassandraTaskExecutionDetailsProjectionTable.FAILED_DATE, DataTypes.TIMESTAMP))

Review Comment:
   My idea is we can filter "olderThan" at db layer. But It will be hard with UDTType when orderBy.
   



-- 
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: notifications-unsubscribe@james.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org