aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: DB schema for the job update store.
Date Mon, 04 Aug 2014 23:04:25 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master ffa786211 -> 869de2744


DB schema for the job update store.

Bugs closed: AURORA-612

Reviewed at https://reviews.apache.org/r/24243/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/869de274
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/869de274
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/869de274

Branch: refs/heads/master
Commit: 869de274455815c9427eebe725a8558f33f36153
Parents: ffa7862
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Mon Aug 4 16:03:51 2014 -0700
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Mon Aug 4 16:03:51 2014 -0700

----------------------------------------------------------------------
 .../aurora/scheduler/storage/db/schema.sql      | 57 ++++++++++++++++++++
 .../thrift/org/apache/aurora/gen/api.thrift     |  6 +--
 .../aurora/client/api/test_scheduler_client.py  |  4 +-
 .../org/apache/aurora/gen/api.thrift.md5        |  2 +-
 4 files changed, 63 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/869de274/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql b/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
index 5358b45..eb2216a 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
@@ -13,6 +13,7 @@
  */
 
 -- schema for h2 engine.
+/* TODO(maxim): Consider using TIMESTAMP instead of BIGINT for all "timestamp" fields below.
*/
 
 CREATE TABLE framework_id(
   id INT PRIMARY KEY,
@@ -77,3 +78,59 @@ CREATE TABLE host_attribute_values(
 
   UNIQUE(host_attribute_id, name, value)
 );
+
+CREATE TABLE job_instance_update_actions(
+  id INT PRIMARY KEY,
+  name VARCHAR NOT NULL,
+
+  UNIQUE(name)
+);
+
+CREATE TABLE job_update_statuses(
+  id INT PRIMARY KEY,
+  name VARCHAR NOT NULL,
+
+  UNIQUE(name)
+);
+
+CREATE TABLE job_updates(
+  id INT IDENTITY,
+  job_key_id INT NOT NULL REFERENCES job_keys(id),
+  update_id VARCHAR NOT NULL,
+  user_name VARCHAR NOT NULL,
+  status INT NOT NULL REFERENCES job_update_statuses(id),
+  inserted_timestamp_ms BIGINT NOT NULL,
+  modified_timestamp_ms BIGINT NOT NULL,
+  update_group_size INT NOT NULL,
+  max_per_instance_failures INT NOT NULL,
+  max_failed_instances INT NOT NULL,
+  max_wait_to_instance_running_ms INT NOT NULL,
+  min_wait_in_instance_running_ms INT NOT NULL,
+  rollback_on_failure BOOLEAN NOT NULL,
+  update_only_these_instances ARRAY,
+
+  UNIQUE(update_id)
+);
+
+CREATE TABLE job_update_configs(
+  id INT IDENTITY,
+  update_id INT NOT NULL REFERENCES job_updates(id),
+  task_config VARCHAR NOT NULL,
+  instances ARRAY NOT NULL,
+  is_new BOOLEAN NOT NULL
+);
+
+CREATE TABLE job_update_events(
+  id BIGINT IDENTITY,
+  update_id INT NOT NULL REFERENCES job_updates(id),
+  update_status INT NOT NULL REFERENCES job_update_statuses(id),
+  timestamp_ms BIGINT NOT NULL
+);
+
+CREATE TABLE job_instance_update_events(
+  id BIGINT IDENTITY,
+  update_id INT NOT NULL REFERENCES job_updates(id),
+  update_action INT NOT NULL REFERENCES job_instance_update_actions(id),
+  instance_id INT NOT NULL,
+  timestamp_ms BIGINT NOT NULL
+);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/869de274/src/main/thrift/org/apache/aurora/gen/api.thrift
----------------------------------------------------------------------
diff --git a/src/main/thrift/org/apache/aurora/gen/api.thrift b/src/main/thrift/org/apache/aurora/gen/api.thrift
index 595c8df..f2b3053 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -559,8 +559,8 @@ struct UpdateSettings {
   /** Min time to watch to watch a RUNNING instance. */
   5: i32 minWaitInInstanceRunningMs
 
-  /** If True, disables failed update rollback. */
-  6: bool doNotRollbackOnFailure
+  /** If true, enables failed update rollback. */
+  6: bool rollbackOnFailure
 
   /** A set of instance IDs to act on. */
   7: set<i32> updateOnlyTheseInstances
@@ -843,7 +843,7 @@ service ReadOnlyScheduler {
   Response populateJobConfig(1: JobConfiguration description)
 
   /** Returns all stored context specific resource/operation locks. */
-    Response getLocks()
+  Response getLocks()
 
   /** Gets job updates. Not implemented yet. */
   Response getUpdates(1: UpdateQuery updateQuery)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/869de274/src/test/python/apache/aurora/client/api/test_scheduler_client.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_scheduler_client.py b/src/test/python/apache/aurora/client/api/test_scheduler_client.py
index e1f1a95..9721ece 100644
--- a/src/test/python/apache/aurora/client/api/test_scheduler_client.py
+++ b/src/test/python/apache/aurora/client/api/test_scheduler_client.py
@@ -45,8 +45,8 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatus,
     SessionKey,
     TaskQuery,
-    UpdateRequest,
-    UpdateQuery
+    UpdateQuery,
+    UpdateRequest
 )
 
 ROLE = 'foorole'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/869de274/src/test/resources/org/apache/aurora/gen/api.thrift.md5
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/aurora/gen/api.thrift.md5 b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
index 3245817..63444e6 100644
--- a/src/test/resources/org/apache/aurora/gen/api.thrift.md5
+++ b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
@@ -1 +1 @@
-121eacd83eb70fe4053abc37a7143e95
+f5b56ed7617a817dea19bccf256f9775


Mime
View raw message