cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: updated refs/heads/vmsync to a410652
Date Tue, 09 Apr 2013 21:22:51 GMT
Updated Branches:
  refs/heads/vmsync 55935f986 -> a41065279


Add schema changes for job dispatcher


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

Branch: refs/heads/vmsync
Commit: a410652795753b249e308449239abb6ba1fd9a4c
Parents: 55935f9
Author: Kelven Yang <kelveny@gmail.com>
Authored: Tue Apr 9 14:21:00 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Tue Apr 9 14:21:00 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/async/AsyncJob.java              |    6 +-
 core/src/com/cloud/async/AsyncJobVO.java           |   70 ++++++---------
 .../com/cloud/async/AsyncJobExecutionContext.java  |    7 +--
 3 files changed, 31 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4106527/api/src/com/cloud/async/AsyncJob.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/async/AsyncJob.java b/api/src/com/cloud/async/AsyncJob.java
index 8e4aec0..faba92c 100644
--- a/api/src/com/cloud/async/AsyncJob.java
+++ b/api/src/com/cloud/async/AsyncJob.java
@@ -61,6 +61,8 @@ public interface AsyncJob extends Identity, InternalIdentity {
     int getCmdVersion();
 
     String getCmdInfo();
+    
+    String getDispatcher();
 
     int getCallbackType();
 
@@ -90,10 +92,6 @@ public interface AsyncJob extends Identity, InternalIdentity {
 
     Long getInstanceId();
 
-    String getSessionKey();
-
-    String getCmdOriginator();
-
     boolean isFromPreviousSession();
 
     SyncQueueItem getSyncSource();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4106527/core/src/com/cloud/async/AsyncJobVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/async/AsyncJobVO.java b/core/src/com/cloud/async/AsyncJobVO.java
index 687d062..83ddb0c 100644
--- a/core/src/com/cloud/async/AsyncJobVO.java
+++ b/core/src/com/cloud/async/AsyncJobVO.java
@@ -50,21 +50,18 @@ public class AsyncJobVO implements AsyncJob {
     @Column(name="account_id")
     private long accountId;
     
-    @Column(name="session_key")
-    private String sessionKey;
-    
 	@Column(name="job_cmd")
     private String cmd;
-	
-	@Column(name="job_cmd_originator")
-	private String cmdOriginator;
-    
+
 	@Column(name="job_cmd_ver")
     private int cmdVersion;
-    
+	
+	@Column(name="job_dispatcher")
+	private String jobDispatcher;
+	
     @Column(name="job_cmd_info", length=65535)
     private String cmdInfo;
-    
+  
     @Column(name="callback_type")
     private int callbackType;
     
@@ -124,22 +121,22 @@ public class AsyncJobVO implements AsyncJob {
     }
 
     public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId,
Type instanceType) {
-	this.userId = userId;
-	this.accountId = accountId;
-	this.cmd = cmd;
-	this.cmdInfo = cmdInfo;
-    	this.callbackType = CALLBACK_POLLING;
-    	this.uuid = UUID.randomUUID().toString();
-        this.instanceId = instanceId;
+		this.userId = userId;
+		this.accountId = accountId;
+		this.cmd = cmd;
+		this.cmdInfo = cmdInfo;
+	    this.callbackType = CALLBACK_POLLING;
+	    this.uuid = UUID.randomUUID().toString();
+	    this.instanceId = instanceId;
     }
 
     public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
-	int callbackType, String callbackAddress, Long instanceId, Type instanceType) {
-
-	this(userId, accountId, cmd, cmdInfo, instanceId, instanceType);
-	this.callbackType = callbackType;
-	this.callbackAddress = callbackAddress;
-    	this.uuid = UUID.randomUUID().toString();
+		int callbackType, String callbackAddress, Long instanceId, Type instanceType) {
+	
+		this(userId, accountId, cmd, cmdInfo, instanceId, instanceType);
+		this.callbackType = callbackType;
+		this.callbackAddress = callbackAddress;
+	    this.uuid = UUID.randomUUID().toString();
     }
 
 
@@ -196,6 +193,15 @@ public class AsyncJobVO implements AsyncJob {
 	public void setCmdInfo(String cmdInfo) {
 		this.cmdInfo = cmdInfo;
 	}
+	
+	@Override
+	public String getDispatcher() {
+		return this.jobDispatcher;
+	}
+	
+	public void setDispatcher(String dispatcher) {
+		this.jobDispatcher = dispatcher;
+	}
 
 	@Override
     public int getCallbackType() {
@@ -323,24 +329,6 @@ public class AsyncJobVO implements AsyncJob {
 		this.instanceId = instanceId;
 	}
 	
-    @Override
-    public String getSessionKey() {
-		return sessionKey;
-	}
-
-	public void setSessionKey(String sessionKey) {
-		this.sessionKey = sessionKey;
-	}
-	
-    @Override
-    public String getCmdOriginator() {
-		return cmdOriginator;
-	}
-
-	public void setCmdOriginator(String cmdOriginator) {
-		this.cmdOriginator = cmdOriginator;
-	}
-	
 	@Override
     public SyncQueueItemVO getSyncSource() {
         return syncSource;
@@ -374,11 +362,9 @@ public class AsyncJobVO implements AsyncJob {
 		sb.append("AsyncJobVO {id:").append(getId());
 		sb.append(", userId: ").append(getUserId());
 		sb.append(", accountId: ").append(getAccountId());
-		sb.append(", sessionKey: ").append(getSessionKey());
 		sb.append(", instanceType: ").append(getInstanceType());
 		sb.append(", instanceId: ").append(getInstanceId());
 		sb.append(", cmd: ").append(getCmd());
-		sb.append(", cmdOriginator: ").append(getCmdOriginator());
 		sb.append(", cmdInfo: ").append(getCmdInfo());
 		sb.append(", cmdVersion: ").append(getCmdVersion());
 		sb.append(", callbackType: ").append(getCallbackType());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4106527/server/src/com/cloud/async/AsyncJobExecutionContext.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobExecutionContext.java b/server/src/com/cloud/async/AsyncJobExecutionContext.java
index d8cf3aa..a09604b 100644
--- a/server/src/com/cloud/async/AsyncJobExecutionContext.java
+++ b/server/src/com/cloud/async/AsyncJobExecutionContext.java
@@ -17,7 +17,6 @@
 package com.cloud.async;
 
 public class AsyncJobExecutionContext  {
-	private SyncQueueItemVO _syncSource;
 	private AsyncJobVO _job;
 	
 	private static ThreadLocal<AsyncJobExecutionContext> s_currentExectionContext = new
ThreadLocal<AsyncJobExecutionContext>();
@@ -30,11 +29,7 @@ public class AsyncJobExecutionContext  {
 	}
 	
 	public SyncQueueItemVO getSyncSource() {
-		return _syncSource;
-	}
-	
-	public void setSyncSource(SyncQueueItemVO syncSource) {
-		_syncSource = syncSource;
+		return _job.getSyncSource();
 	}
 	
 	public AsyncJobVO getJob() {


Mime
View raw message