Interface DBSpecificQueryProvider

All Known Implementing Classes:
DB2DatabaseQueryProvider, H2DatabaseQueryProvider, MySQLDatabaseQueryProvider, OracleDatabaseQueryProvider, PostgreSQLDatabaseQueryProvider, SQLServerDatabaseQueryProvider

public interface DBSpecificQueryProvider
  • Method Details

    • currentDbTimestampExpression

      default String currentDbTimestampExpression()
      The database-clock "now" expression for this dialect. Every server-side timestamp write uses it, so that timestamps are written with the same clock the heartbeat/orphan age comparisons read — making liveness immune to node<->DB clock skew. Defaults to the SQL-standard CURRENT_TIMESTAMP; a dialect whose age comparison uses a different now-expression overrides this to match it (e.g. Oracle compares against SYSTIMESTAMP, so it must also write it — CURRENT_TIMESTAMP on Oracle is the session time zone and would disagree with the server-time-zone SYSTIMESTAMP).
    • getInsertQueryToRegisterNodeQuery

      default String getInsertQueryToRegisterNodeQuery()
    • getUpdateNodeHeartBeatQuery

      default String getUpdateNodeHeartBeatQuery()
    • getSaveBatchJobCoordinationInfoQuery

      default String getSaveBatchJobCoordinationInfoQuery()
    • getUpdateBatchJobCoordinationStatusQuery

      default String getUpdateBatchJobCoordinationStatusQuery()
    • getSaveBatchPartitionsQuery

      default String getSaveBatchPartitionsQuery()
    • getUpdateBatchPartitionsToReAssignedNodesQuery

      default String getUpdateBatchPartitionsToReAssignedNodesQuery()
    • getPendingTasksCountQuery

      default String getPendingTasksCountQuery()
    • getFailedTasksCountQuery

      default String getFailedTasksCountQuery()
      Count of partitions that ended in FAILED for a job, so the master can fail the step accordingly.
    • getFetchPartitionAssignedTasksQuery

      default String getFetchPartitionAssignedTasksQuery()
    • getUpdatePartitionStatusToQuery

      default String getUpdatePartitionStatusToQuery()
    • getUpdateLastUpdateTimeQuery

      default String getUpdateLastUpdateTimeQuery()
    • getCheckForOrphanedTasksQuery

      default String getCheckForOrphanedTasksQuery()
    • getActiveNodesQuery

      default String getActiveNodesQuery()
    • getOrphanedMasterJobsQuery

      default String getOrphanedMasterJobsQuery()
      Finds jobs whose current owner has left the cluster: coordination rows still in-flight (STARTED, or RECOVERING if a previous reaper died) whose master_node_id no longer exists in batch_nodes (the owner was marked unreachable and then removed by the node-cleanup phase). Including RECOVERING ensures a recovery that was itself interrupted is picked up by another node rather than being stranded.
    • getCoordinatedJobsQuery

      default String getCoordinatedJobsQuery()
      Read-only: lists coordinated jobs (most recent first), for the job-centric observability view.
    • getJobCoordinationByIdQuery

      default String getJobCoordinationByIdQuery()
      Read-only: the coordination row for one job execution.
    • getPartitionsByMasterStepQuery

      default String getPartitionsByMasterStepQuery()
      Read-only: the partitions of a job (by manager step execution id) with their placement and status.
    • getRecordPhaseEventQuery

      default String getRecordPhaseEventQuery()
      Appends a coordination phase event, timestamped with the database clock (single clock across nodes).
    • getClaimOrphanedMasterJobQuery

      default String getClaimOrphanedMasterJobQuery()
      Atomically claims an orphaned coordination row for recovery: sets the transient status and takes ownership (master_node_id), guarded by the (job execution, lost owner) pair. Because the winner overwrites master_node_id with its own id, concurrent reapers see zero rows updated, so a job is claimed exactly once; and if the winner later dies, the row's owner is gone again and it is re-detected.
    • getAllNodesInClusterQuery

      default String getAllNodesInClusterQuery()
    • getMarkNodesUnreachableQuery

      String getMarkNodesUnreachableQuery()
    • getDeleteNodesUnreachableQuery

      String getDeleteNodesUnreachableQuery()
    • getTimeStampColumnWithDiffInMillisToCurrentTime

      String getTimeStampColumnWithDiffInMillisToCurrentTime(String columnName)
      Returns a dialect-specific SQL expression for the elapsed milliseconds between columnName and the current database time, used in heartbeat-age comparisons.

      Security: columnName is interpolated directly into SQL, so it must always be a trusted, hard-coded column name from this library — never user-supplied input. All values in the generated queries are passed as bind parameters (?), not concatenated.