Author: chathuri
Date: Wed Aug 7 15:23:15 2013
New Revision: 1511359
URL: http://svn.apache.org/r1511359
Log:
updating registry migrate tool
Added:
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_derby.sql
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_mysql.sql
Modified:
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
airavata/trunk/tools/registry-tool/README
airavata/trunk/tools/registry-tool/src/main/java/org/apache/airavata/registry/tool/DBMigrator.java
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.6/migrate_derby.sql
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_mysql.sql
Modified:
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java?rev=1511359&r1=1511358&r2=1511359&view=diff
==============================================================================
---
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
(original)
+++
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
Wed Aug 7 15:23:15 2013
@@ -200,9 +200,6 @@ public class GridFTPOutputHandler implem
} catch (URISyntaxException e) {
log.error(e.getMessage());
throw new GFacHandlerException("URI is malformatted:" +
e.getMessage(), jobExecutionContext, e,
readLastLinesofStdOut(localStdErrFile.getPath(), 20));
- } catch (NullPointerException e) {
- log.error(e.getMessage());
- throw new GFacHandlerException("Output is not produced in
stdout:" + e.getMessage(), jobExecutionContext, e,
readLastLinesofStdOut(localStdErrFile.getPath(), 20));
}
}
} catch (Exception e) {
Modified:
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java?rev=1511359&r1=1511358&r2=1511359&view=diff
==============================================================================
---
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
(original)
+++
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
Wed Aug 7 15:23:15 2013
@@ -28,6 +28,7 @@ import java.util.regex.Pattern;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.MappingFactory;
+import org.apache.airavata.gfac.handler.GFacHandlerException;
import org.apache.airavata.schemas.gfac.StdErrParameterType;
import org.apache.airavata.schemas.gfac.StdOutParameterType;
import org.apache.airavata.schemas.gfac.URIParameterType;
@@ -37,6 +38,10 @@ public class OutputUtils {
public static Map<String, ActualParameter>
fillOutputFromStdout(Map<String, Object> output, String stdout, String stderr)
throws Exception {
+ if (stdout == null || stdout.equals("")){
+ throw new GFacHandlerException("Standard output is empty.");
+ }
+
Map<String, ActualParameter> result = new HashMap<String,
ActualParameter>();
Set<String> keys = output.keySet();
for (String paramName : keys) {
Modified: airavata/trunk/tools/registry-tool/README
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/README?rev=1511359&r1=1511358&r2=1511359&view=diff
==============================================================================
--- airavata/trunk/tools/registry-tool/README (original)
+++ airavata/trunk/tools/registry-tool/README Wed Aug 7 15:23:15 2013
@@ -1,4 +1,4 @@
-0.5 => 0.6
+0.7 => 0.8
==============
1. Build registry-tools
Modified:
airavata/trunk/tools/registry-tool/src/main/java/org/apache/airavata/registry/tool/DBMigrator.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/src/main/java/org/apache/airavata/registry/tool/DBMigrator.java?rev=1511359&r1=1511358&r2=1511359&view=diff
==============================================================================
---
airavata/trunk/tools/registry-tool/src/main/java/org/apache/airavata/registry/tool/DBMigrator.java
(original)
+++
airavata/trunk/tools/registry-tool/src/main/java/org/apache/airavata/registry/tool/DBMigrator.java
Wed Aug 7 15:23:15 2013
@@ -60,7 +60,6 @@ public class DBMigrator {
"','SYSTEM')";
UPDATE_QUERY = "UPDATE CONFIGURATION SET config_val='" +
getIncrementedVersion(currentAiravataVersion) + "', expire_date='" +
getCurrentDate() +
"' WHERE config_key='" + REGISTRY_VERSION + "' and
category_id='SYSTEM'";
-
}
//we assume given database is up and running
@@ -102,26 +101,35 @@ public class DBMigrator {
updateConfigTable(connection);
}
} catch (ClassNotFoundException e) {
+ e.printStackTrace();
logger.error("Unable to find SQL scripts..." , e);
} catch (InstantiationException e) {
+ e.printStackTrace();
logger.error("Error while updating the database..." , e);
} catch (IllegalAccessException e) {
+ e.printStackTrace();
logger.error("Error while updating the database..." , e);
} catch (SQLException e) {
+ e.printStackTrace();
logger.error("Error while updating the database..." , e);
} catch (Exception e) {
+ e.printStackTrace();
logger.error("Error while updating the database..." , e);
}
}
private static boolean canUpdated (Connection conn){
- String config = executeSelectQuery(conn);
- if (config != null){
- if (config.equals(getIncrementedVersion(currentAiravataVersion))) {
- return false;
- } else {
- return true;
+ if (!currentAiravataVersion.equals("0.5")){
+ String config = executeSelectQuery(conn);
+ if (config != null){
+ if
(config.equals(getIncrementedVersion(currentAiravataVersion))) {
+ return false;
+ } else {
+ return true;
+ }
}
+ } else if (currentAiravataVersion.equals("0.5")){
+ return true;
}
return false;
}
@@ -211,6 +219,7 @@ public class DBMigrator {
sql.replace(0, sql.length(), "");
}
}
+ System.out.println(sql.toString());
// Catch any statements not followed by ;
if (sql.length() > 0) {
executeSQL(sql.toString(), conn);
Modified:
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.6/migrate_derby.sql
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.6/migrate_derby.sql?rev=1511359&r1=1511358&r2=1511359&view=diff
==============================================================================
---
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.6/migrate_derby.sql
(original)
+++
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.6/migrate_derby.sql
Wed Aug 7 15:23:15 2013
@@ -30,4 +30,6 @@ ADD execution_index int NOT NULL DEFAULT
ALTER TABLE Node_Data DROP PRIMARY KEY;
-ALTER TABLE Node_Data ADD PRIMARY KEY(workflow_instanceID, node_id,
execution_index);
\ No newline at end of file
+ALTER TABLE Node_Data ADD PRIMARY KEY(workflow_instanceID, node_id,
execution_index);
+
+
Added:
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_derby.sql
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_derby.sql?rev=1511359&view=auto
==============================================================================
---
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_derby.sql
(added)
+++
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_derby.sql
Wed Aug 7 15:23:15 2013
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+CREATE TABLE community_user
+(
+ GATEWAY_NAME VARCHAR(256) NOT NULL,
+ COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+ TOKEN_ID VARCHAR(256) NOT NULL,
+ COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+ PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+
+CREATE TABLE credentials
+(
+ GATEWAY_ID VARCHAR(256) NOT NULL,
+ TOKEN_ID VARCHAR(256) NOT NULL,
+ CREDENTIAL BLOB NOT NULL,
+ PORTAL_USER_ID VARCHAR(256) NOT NULL,
+ TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
\ No newline at end of file
Added:
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_mysql.sql
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_mysql.sql?rev=1511359&view=auto
==============================================================================
---
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_mysql.sql
(added)
+++
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.7/migrate_mysql.sql
Wed Aug 7 15:23:15 2013
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+CREATE TABLE community_user
+(
+ GATEWAY_NAME VARCHAR(256) NOT NULL,
+ COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+ TOKEN_ID VARCHAR(256) NOT NULL,
+ COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+ PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+
+CREATE TABLE credentials
+(
+ GATEWAY_ID VARCHAR(256) NOT NULL,
+ TOKEN_ID VARCHAR(256) NOT NULL,
+ CREDENTIAL TEXT NOT NULL,
+ PORTAL_USER_ID VARCHAR(256) NOT NULL,
+ TIME_PERSISTED TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
\ No newline at end of file
Modified:
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_mysql.sql
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_mysql.sql?rev=1511359&r1=1511358&r2=1511359&view=diff
==============================================================================
---
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_mysql.sql
(original)
+++
airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_mysql.sql
Wed Aug 7 15:23:15 2013
@@ -54,7 +54,7 @@ create table GFac_Job_Data
status_update_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
status varchar(255),
metadata LONGTEXT,
- PRIMARY KEY(local_Job_ID),
+ PRIMARY KEY(local_Job_ID)
FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID),
FOREIGN KEY (workflow_instanceID) REFERENCES
Workflow_Data(workflow_instanceID)
);