Commit Details

Avatar

Repository https://sgs-server.dev.java.net/svn/sgs-server/trunk /trunk
by owenkellett on 2009-10-02 13:42 (2 months ago)

- implementation for issue #40
- adds a global application time exposed through the watchdog service which reports total uptime of currently running application
- updates task service to use global application time when scheduling delayed and periodic tasks
- reviewed by awol, stp

M sgs-server/src/test/java/com/sun/sgs/test/impl/service/watchdog/TestWatchdogServiceImpl.java

- added tests to verify global application time behavior
- verify initialization
- verify recovery of application time across shutdowns
- verify synchronization between app nodes and core node

M sgs-server/src/main/java/com/sun/sgs/impl/service/watchdog/WatchdogServiceImpl.java

- implemented global app time behavior for watchdog service
- syncs with watchdog server at node startup and at a configurable periodic interval

M sgs-server/src/main/java/com/sun/sgs/impl/service/watchdog/WatchdogServer.java

- added currentAppTimeMillis() method to remote interface so app nodes can sync up with the core

M sgs-server/src/main/java/com/sun/sgs/impl/service/watchdog/WatchdogServerImpl.java

- implemented core node functionality for global app time behavior
- master time is kept by the core node and periodically stored in the data store
- time offset is established at node startup, restoring app time from the data store if applicable

M sgs-server-internal-api/src/main/java/com/sun/sgs/service/WatchdogService.java

- added currentAppTimeMillis() method to report global application time
- added getAppTimeMillis(..) method to convert from system time to application time
- added getSystemTimeMillis(..) method to convert from application time to system time

M sgs-server/src/test/java/com/sun/sgs/test/impl/service/task/TestTaskServiceImpl.java

- added tests to verify behavior of delayed and periodic tasks across shutdowns

M sgs-server/src/test/java/com/sun/sgs/test/impl/service/task/DummyWatchdogService.java

- updated dummy watchdog service to implement new WatchdogService api

M sgs-server/src/main/java/com/sun/sgs/impl/service/task/TaskServiceImpl.java

- modified task service to schedule tasks according to global application time as reported
by the watchdog service rather than according to system time

M sgs-server/src/main/java/com/sun/sgs/impl/service/task/PendingTask.java

- added a lastStartTime property in order to support rescheduling periodic tasks according to
global application time across node shutdowns and handoffs
- Note that coordinating the correct restart time of periodic tasks on handoff between nodes
or across system shutdowns is approximated by recording the application start time of each
task execution. This is subject to the possibility of skipping periods in the execution.
In order to address this issue, additional information about a task (specifically the authoritative
"task start time" as maintained by the transaction scheduler) needs to be made available to a
transaction.

M sgs-server-dist/src/main/etc/CHANGELOG

- updated changelog to reflect changes

Language Totals

  Language Code Added Code Removed Comments Added Comments Removed Blanks Added Blanks Removed
  Java 363 43 202 0 66 0

Files Changed

[10 total ]
File Language Code Added Code Removed Comments Added Comments Removed Blanks Added Blanks Removed
sgs-server-dist/src/main/etc/CHANGELOG
sgs-server-internal-api/src/main/java/com/sun/sgs/service/WatchdogService.java
  Java 4 0 42 0 3 0
sgs-server/src/main/java/com/sun/sgs/impl/service/task/PendingTask.java
  Java 11 1 9 0 2 0
sgs-server/src/main/java/com/sun/sgs/impl/service/task/TaskServiceImpl.java
  Java 48 32 19 0 2 0
sgs-server/src/main/java/com/sun/sgs/impl/service/watchdog/WatchdogServerImpl.java
  Java 87 2 56 0 17 0
sgs-server/src/main/java/com/sun/sgs/impl/service/watchdog/WatchdogServer.java
  Java 2 0 16 0 1 0
sgs-server/src/main/java/com/sun/sgs/impl/service/watchdog/WatchdogServiceImpl.java
  Java 48 0 32 0 12 0
sgs-server/src/test/java/com/sun/sgs/test/impl/service/task/DummyWatchdogService.java
  Java 9 0 10 0 3 0
sgs-server/src/test/java/com/sun/sgs/test/impl/service/task/TestTaskServiceImpl.java
  Java 87 3 10 0 12 0
sgs-server/src/test/java/com/sun/sgs/test/impl/service/watchdog/TestWatchdogServiceImpl.java
  Java 67 5 8 0 14 0