ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject git commit: AMBARI-5210. After upgrade (1.4.3 -> 1.5.0, HDP-1.3.2) unable to issue restart. (Myroslav P via mahadev)
Date Tue, 25 Mar 2014 19:44:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4490dea55 -> 322e390b7


AMBARI-5210. After upgrade (1.4.3 -> 1.5.0, HDP-1.3.2) unable to issue restart. (Myroslav
P via mahadev)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/322e390b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/322e390b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/322e390b

Branch: refs/heads/trunk
Commit: 322e390b7bd8951819a3e2d46259b53ff8e10ce6
Parents: 4490dea
Author: Mahadev Konar <mahadev@apache.org>
Authored: Tue Mar 25 12:44:12 2014 -0700
Committer: Mahadev Konar <mahadev@apache.org>
Committed: Tue Mar 25 12:44:12 2014 -0700

----------------------------------------------------------------------
 .../apache/ambari/server/orm/entities/RequestEntity.java | 11 ++++++-----
 .../server/orm/entities/RequestResourceFilterEntity.java |  6 +++---
 .../apache/ambari/server/upgrade/UpgradeCatalog150.java  |  2 +-
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql       |  4 ++--
 .../src/main/resources/Ambari-DDL-Oracle-CREATE.sql      |  4 ++--
 .../src/main/resources/Ambari-DDL-Postgres-CREATE.sql    |  4 ++--
 6 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/322e390b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
index 6054126..e7098d2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
@@ -29,6 +29,7 @@ import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
@@ -58,9 +59,9 @@ public class RequestEntity {
   @Basic
   private String commandName;
 
-  @Column(name = "inputs", length = 32000)
-  @Basic
-  private String inputs;
+  @Column(name = "inputs")
+  @Lob
+  private byte[] inputs = new byte[0];
 
   @Column(name = "request_type")
   @Enumerated(value = EnumType.STRING)
@@ -153,11 +154,11 @@ public class RequestEntity {
   }
 
   public String getInputs() {
-    return inputs;
+    return inputs != null ? new String(inputs) : null;
   }
 
   public void setInputs(String inputs) {
-    this.inputs = inputs;
+    this.inputs = inputs != null ? inputs.getBytes() : null;
   }
 
   public RequestType getRequestType() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/322e390b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestResourceFilterEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestResourceFilterEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestResourceFilterEntity.java
index 30e32aa..4307d08 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestResourceFilterEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestResourceFilterEntity.java
@@ -57,7 +57,7 @@ public class RequestResourceFilterEntity {
 
   @Column(name = "hosts")
   @Lob
-  private String hosts;
+  private byte[] hosts;
 
   @ManyToOne
   @JoinColumn(name = "request_id", referencedColumnName = "request_id", nullable = false,
insertable = false, updatable = false)
@@ -88,11 +88,11 @@ public class RequestResourceFilterEntity {
   }
 
   public String getHosts() {
-    return hosts;
+    return hosts != null ? new String(hosts) : null;
   }
 
   public void setHosts(String hosts) {
-    this.hosts = hosts;
+    this.hosts = hosts != null ? hosts.getBytes() : null;
   }
 
   public Long getRequestId() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/322e390b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
index 72f3b74..37ab6e1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
@@ -235,7 +235,7 @@ public class UpgradeCatalog150 extends AbstractUpgradeCatalog {
     columns.add(new DBColumnInfo("component_name", String.class, 255, null, true));
     columns.add(new DBColumnInfo("hosts", byte[].class, null, null, true));
 
-    dbAccessor.createTable("requestresourcefilter", columns, "request_id");
+    dbAccessor.createTable("requestresourcefilter", columns, "filter_id");
 
     createQuartzTables();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/322e390b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 883a64b..398fc29 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -42,8 +42,8 @@ CREATE TABLE execution_command (task_id BIGINT NOT NULL, command LONGBLOB,
PRIMA
 CREATE TABLE host_role_command (task_id BIGINT NOT NULL, attempt_count SMALLINT NOT NULL,
event LONGTEXT NOT NULL, exitcode INTEGER NOT NULL, host_name VARCHAR(255) NOT NULL, last_attempt_time
BIGINT NOT NULL, request_id BIGINT NOT NULL, role VARCHAR(255), role_command VARCHAR(255),
stage_id BIGINT NOT NULL, start_time BIGINT NOT NULL, end_time BIGINT, status VARCHAR(255),
std_error LONGBLOB, std_out LONGBLOB, structured_out LONGBLOB, command_detail VARCHAR(255),
custom_command_name VARCHAR(255), PRIMARY KEY (task_id));
 CREATE TABLE role_success_criteria (role VARCHAR(255) NOT NULL, request_id BIGINT NOT NULL,
stage_id BIGINT NOT NULL, success_factor DOUBLE NOT NULL, PRIMARY KEY (role, request_id, stage_id));
 CREATE TABLE stage (stage_id BIGINT NOT NULL, request_id BIGINT NOT NULL, cluster_id BIGINT,
log_info VARCHAR(255) NOT NULL, request_context VARCHAR(255), cluster_host_info LONGBLOB,
PRIMARY KEY (stage_id, request_id));
-CREATE TABLE request (request_id BIGINT NOT NULL, cluster_id BIGINT, request_schedule_id
BIGINT, command_name VARCHAR(255), create_time BIGINT NOT NULL, end_time BIGINT NOT NULL,
inputs LONGTEXT, request_context VARCHAR(255), request_type VARCHAR(255), start_time BIGINT
NOT NULL, status VARCHAR(255), PRIMARY KEY (request_id));
-CREATE TABLE requestresourcefilter (filter_id BIGINT NOT NULL, request_id BIGINT NOT NULL,
service_name VARCHAR(255), component_name VARCHAR(255), hosts LONGTEXT, PRIMARY KEY (filter_id));
+CREATE TABLE request (request_id BIGINT NOT NULL, cluster_id BIGINT, request_schedule_id
BIGINT, command_name VARCHAR(255), create_time BIGINT NOT NULL, end_time BIGINT NOT NULL,
inputs LONGBLOB, request_context VARCHAR(255), request_type VARCHAR(255), start_time BIGINT
NOT NULL, status VARCHAR(255), PRIMARY KEY (request_id));
+CREATE TABLE requestresourcefilter (filter_id BIGINT NOT NULL, request_id BIGINT NOT NULL,
service_name VARCHAR(255), component_name VARCHAR(255), hosts LONGBLOB, PRIMARY KEY (filter_id));
 CREATE TABLE key_value_store (`key` VARCHAR(255), `value` LONGTEXT, PRIMARY KEY (`key`));
 CREATE TABLE clusterconfigmapping (type_name VARCHAR(255) NOT NULL, create_timestamp BIGINT
NOT NULL, cluster_id BIGINT NOT NULL, selected INTEGER NOT NULL DEFAULT 0, version_tag VARCHAR(255)
NOT NULL, user_name VARCHAR(255) NOT NULL DEFAULT '_db', PRIMARY KEY (type_name, create_timestamp,
cluster_id));
 CREATE TABLE hostconfigmapping (create_timestamp BIGINT NOT NULL, host_name VARCHAR(255)
NOT NULL, cluster_id BIGINT NOT NULL, type_name VARCHAR(255) NOT NULL, selected INTEGER NOT
NULL DEFAULT 0, service_name VARCHAR(255), version_tag VARCHAR(255) NOT NULL, user_name VARCHAR(255)
NOT NULL DEFAULT '_db', PRIMARY KEY (create_timestamp, host_name, cluster_id, type_name));

http://git-wip-us.apache.org/repos/asf/ambari/blob/322e390b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index 6f3ec00..367ec3f 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -32,8 +32,8 @@ CREATE TABLE execution_command (task_id NUMBER(19) NOT NULL, command BLOB
NULL,
 CREATE TABLE host_role_command (task_id NUMBER(19) NOT NULL, attempt_count NUMBER(5) NOT
NULL, event CLOB NULL, exitcode NUMBER(10) NOT NULL, host_name VARCHAR2(255) NOT NULL, last_attempt_time
NUMBER(19) NOT NULL, request_id NUMBER(19) NOT NULL, role VARCHAR2(255) NULL, role_command
VARCHAR2(255) NULL, stage_id NUMBER(19) NOT NULL, start_time NUMBER(19) NOT NULL, end_time
NUMBER(19), status VARCHAR2(255) NULL, std_error BLOB NULL, std_out BLOB NULL, structured_out
BLOB NULL,  command_detail VARCHAR2(255) NULL, custom_command_name VARCHAR2(255) NULL, PRIMARY
KEY (task_id));
 CREATE TABLE role_success_criteria (role VARCHAR2(255) NOT NULL, request_id NUMBER(19) NOT
NULL, stage_id NUMBER(19) NOT NULL, success_factor NUMBER(19,4) NOT NULL, PRIMARY KEY (role,
request_id, stage_id));
 CREATE TABLE stage (stage_id NUMBER(19) NOT NULL, request_id NUMBER(19) NOT NULL, cluster_id
NUMBER(19) NULL, log_info VARCHAR2(255) NULL, request_context VARCHAR2(255) NULL, cluster_host_info
BLOB NOT NULL, PRIMARY KEY (stage_id, request_id));
-CREATE TABLE request (request_id NUMBER(19) NOT NULL, cluster_id NUMBER(19), request_schedule_id
NUMBER(19), command_name VARCHAR(255), create_time NUMBER(19) NOT NULL, end_time NUMBER(19)
NOT NULL, inputs CLOB, request_context VARCHAR(255), request_type VARCHAR(255), start_time
NUMBER(19) NOT NULL, status VARCHAR(255), PRIMARY KEY (request_id));
-CREATE TABLE requestresourcefilter (filter_id NUMBER(19) NOT NULL, request_id NUMBER(19)
NOT NULL, service_name VARCHAR2(255), component_name VARCHAR2(255), hosts CLOB, PRIMARY KEY
(filter_id));
+CREATE TABLE request (request_id NUMBER(19) NOT NULL, cluster_id NUMBER(19), request_schedule_id
NUMBER(19), command_name VARCHAR(255), create_time NUMBER(19) NOT NULL, end_time NUMBER(19)
NOT NULL, inputs BLOB, request_context VARCHAR(255), request_type VARCHAR(255), start_time
NUMBER(19) NOT NULL, status VARCHAR(255), PRIMARY KEY (request_id));
+CREATE TABLE requestresourcefilter (filter_id NUMBER(19) NOT NULL, request_id NUMBER(19)
NOT NULL, service_name VARCHAR2(255), component_name VARCHAR2(255), hosts BLOB, PRIMARY KEY
(filter_id));
 CREATE TABLE key_value_store ("key" VARCHAR2(255) NOT NULL, "value" CLOB NULL, PRIMARY KEY
("key"));
 CREATE TABLE clusterconfigmapping (type_name VARCHAR2(255) NOT NULL, create_timestamp NUMBER(19)
NOT NULL, cluster_id NUMBER(19) NOT NULL, selected NUMBER(10) NOT NULL, version_tag VARCHAR2(255)
NOT NULL, user_name VARCHAR(255) DEFAULT '_db', PRIMARY KEY (type_name, create_timestamp,
cluster_id));
 CREATE TABLE hostconfigmapping (create_timestamp NUMBER(19) NOT NULL, host_name VARCHAR2(255)
NOT NULL, cluster_id NUMBER(19) NOT NULL, type_name VARCHAR2(255) NOT NULL, selected NUMBER(10)
NOT NULL, service_name VARCHAR2(255) NULL, version_tag VARCHAR2(255) NOT NULL, user_name VARCHAR(255)
DEFAULT '_db', PRIMARY KEY (create_timestamp, host_name, cluster_id, type_name));

http://git-wip-us.apache.org/repos/asf/ambari/blob/322e390b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index ffd1743..44b7639 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -79,10 +79,10 @@ GRANT ALL PRIVILEGES ON TABLE ambari.role_success_criteria TO :username;
 CREATE TABLE ambari.stage (stage_id BIGINT NOT NULL, request_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, log_info VARCHAR(255) NOT NULL, request_context VARCHAR(255), cluster_host_info
BYTEA NOT NULL, PRIMARY KEY (stage_id, request_id));
 GRANT ALL PRIVILEGES ON TABLE ambari.stage TO :username;
 
-CREATE TABLE ambari.request (request_id BIGINT NOT NULL, cluster_id BIGINT, command_name
VARCHAR(255), create_time BIGINT NOT NULL, end_time BIGINT NOT NULL, inputs VARCHAR(32000),
request_context VARCHAR(255), request_type VARCHAR(255), request_schedule_id BIGINT, start_time
BIGINT NOT NULL, status VARCHAR(255), PRIMARY KEY (request_id));
+CREATE TABLE ambari.request (request_id BIGINT NOT NULL, cluster_id BIGINT, command_name
VARCHAR(255), create_time BIGINT NOT NULL, end_time BIGINT NOT NULL, inputs BYTEA, request_context
VARCHAR(255), request_type VARCHAR(255), request_schedule_id BIGINT, start_time BIGINT NOT
NULL, status VARCHAR(255), PRIMARY KEY (request_id));
 GRANT ALL PRIVILEGES ON TABLE ambari.request TO :username;
 
-CREATE TABLE ambari.requestresourcefilter (filter_id BIGINT NOT NULL, request_id BIGINT NOT
NULL, service_name VARCHAR(255), component_name VARCHAR(255), hosts TEXT, PRIMARY KEY (filter_id));
+CREATE TABLE ambari.requestresourcefilter (filter_id BIGINT NOT NULL, request_id BIGINT NOT
NULL, service_name VARCHAR(255), component_name VARCHAR(255), hosts BYTEA, PRIMARY KEY (filter_id));
 GRANT ALL PRIVILEGES ON TABLE ambari.requestresourcefilter TO :username;
 
 CREATE TABLE ambari.ClusterHostMapping (cluster_id BIGINT NOT NULL, host_name VARCHAR(255)
NOT NULL, PRIMARY KEY (cluster_id, host_name));


Mime
View raw message