incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [1/2] git commit: Fixed lineendings and trailing whitespaces in a bunch of files
Date Wed, 10 Oct 2012 00:25:45 GMT
Updated Branches:
  refs/heads/master 823f0c966 -> 839929b9b


Fixed lineendings and trailing whitespaces in a bunch of files

Conflicts:

	core/src/com/cloud/async/SyncQueueItemVO.java
	core/src/com/cloud/async/SyncQueueVO.java
	server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
	server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java


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

Branch: refs/heads/master
Commit: 839929b9b2768aa79636b61ded1386b6546b3a7a
Parents: 290e895
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Wed Oct 3 14:58:07 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Oct 9 17:17:36 2012 -0700

----------------------------------------------------------------------
 core/src/com/cloud/async/SyncQueueItemVO.java      |  154 +++++++-------
 core/src/com/cloud/async/SyncQueueVO.java          |  171 ++++++++-------
 .../src/com/cloud/async/dao/SyncQueueDaoImpl.java  |   57 +++---
 .../com/cloud/async/dao/SyncQueueItemDaoImpl.java  |   99 +++++----
 4 files changed, 244 insertions(+), 237 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/839929b9/core/src/com/cloud/async/SyncQueueItemVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/async/SyncQueueItemVO.java b/core/src/com/cloud/async/SyncQueueItemVO.java
index f70ff85..aceb318 100644
--- a/core/src/com/cloud/async/SyncQueueItemVO.java
+++ b/core/src/com/cloud/async/SyncQueueItemVO.java
@@ -29,19 +29,19 @@ import javax.persistence.Table;
 @Table(name="sync_queue_item")
 public class SyncQueueItemVO implements SyncQueueItem{
 
-	@Id
+    @Id
     @GeneratedValue(strategy=GenerationType.IDENTITY)
     @Column(name="id")
     private Long id = null;
-	
+    
     @Column(name="queue_id")
-	private Long queueId;
-	
+    private Long queueId;
+    
     @Column(name="content_type")
-	private String contentType;
-	
+    private String contentType;
+    
     @Column(name="content_id")
-	private Long contentId;
+    private Long contentId;
     
     @Column(name="queue_proc_msid")
     private Long lastProcessMsid;
@@ -49,76 +49,76 @@ public class SyncQueueItemVO implements SyncQueueItem{
     @Column(name="queue_proc_number")
     private Long lastProcessNumber;
     
-	@Column(name="created")
-	private Date created;
+    @Column(name="created")
+    private Date created;
+    
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getQueueId() {
+        return queueId;
+    }
+
+    public void setQueueId(Long queueId) {
+        this.queueId = queueId;
+    }
+
+    @Override
+    public String getContentType() {
+        return contentType;
+    }
+
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
+    }
+    
+    @Override
+    public Long getContentId() {
+        return contentId;
+    }
+
+    public void setContentId(Long contentId) {
+        this.contentId = contentId;
+    }
+
+    public Long getLastProcessMsid() {
+        return lastProcessMsid;
+    }
+
+    public void setLastProcessMsid(Long lastProcessMsid) {
+        this.lastProcessMsid = lastProcessMsid;
+    }
     
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getQueueId() {
-		return queueId;
-	}
-
-	public void setQueueId(Long queueId) {
-		this.queueId = queueId;
-	}
-
-	@Override
-	public String getContentType() {
-		return contentType;
-	}
-
-	public void setContentType(String contentType) {
-		this.contentType = contentType;
-	}
-	
-	@Override
-	public Long getContentId() {
-		return contentId;
-	}
-
-	public void setContentId(Long contentId) {
-		this.contentId = contentId;
-	}
-
-	public Long getLastProcessMsid() {
-		return lastProcessMsid;
-	}
-
-	public void setLastProcessMsid(Long lastProcessMsid) {
-		this.lastProcessMsid = lastProcessMsid;
-	}
-	
     public Long getLastProcessNumber() {
-		return lastProcessNumber;
-	}
-
-	public void setLastProcessNumber(Long lastProcessNumber) {
-		this.lastProcessNumber = lastProcessNumber;
-	}
-
-	public Date getCreated() {
-		return created;
-	}
-
-	public void setCreated(Date created) {
-		this.created = created;
-	}
-	
-	public String toString() {
-		StringBuffer sb = new StringBuffer();
-		sb.append("SyncQueueItemVO {id:").append(getId()).append(", queueId: ").append(getQueueId());
-		sb.append(", contentType: ").append(getContentType());
-		sb.append(", contentId: ").append(getContentId());
-		sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
-		sb.append(", lastprocessNumber: ").append(getLastProcessNumber());
-		sb.append(", created: ").append(getCreated());
-		sb.append("}");
-		return sb.toString();
-	}
+        return lastProcessNumber;
+    }
+
+    public void setLastProcessNumber(Long lastProcessNumber) {
+        this.lastProcessNumber = lastProcessNumber;
+    }
+
+    public Date getCreated() {
+        return created;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+    
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append("SyncQueueItemVO {id:").append(getId()).append(", queueId: ").append(getQueueId());
+        sb.append(", contentType: ").append(getContentType());
+        sb.append(", contentId: ").append(getContentId());
+        sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
+        sb.append(", lastprocessNumber: ").append(getLastProcessNumber());
+        sb.append(", created: ").append(getCreated());
+        sb.append("}");
+        return sb.toString();
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/839929b9/core/src/com/cloud/async/SyncQueueVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/async/SyncQueueVO.java b/core/src/com/cloud/async/SyncQueueVO.java
index 741312f..419fecb 100644
--- a/core/src/com/cloud/async/SyncQueueVO.java
+++ b/core/src/com/cloud/async/SyncQueueVO.java
@@ -14,6 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
+
 package com.cloud.async;
 
 import java.util.Date;
@@ -30,110 +31,112 @@ import javax.persistence.TemporalType;
 @Entity
 @Table(name="sync_queue")
 public class SyncQueueVO {
-	@Id
+
+    @Id
     @GeneratedValue(strategy=GenerationType.IDENTITY)
     @Column(name="id")
     private Long id;
 
     @Column(name="sync_objtype")
-	private String syncObjType;
+
+    private String syncObjType;
     
     @Column(name="sync_objid")
-	private Long syncObjId;
+    private Long syncObjId;
     
     @Column(name="queue_proc_number")
     private Long lastProcessNumber;
     
     @Column(name="queue_proc_time")
     @Temporal(TemporalType.TIMESTAMP)
-	private Date lastProcessTime;
+    private Date lastProcessTime;
     
     @Column(name="queue_proc_msid")
-	private Long lastProcessMsid;
+    private Long lastProcessMsid;
     
     @Column(name="created")
     @Temporal(TemporalType.TIMESTAMP)
-	private Date created;
+    private Date created;
     
     @Column(name="last_updated")
     @Temporal(TemporalType.TIMESTAMP)
-	private Date lastUpdated;
+    private Date lastUpdated;
+    
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getSyncObjType() {
+        return syncObjType;
+    }
+
+    public void setSyncObjType(String syncObjType) {
+        this.syncObjType = syncObjType;
+    }
+
+    public Long getSyncObjId() {
+        return syncObjId;
+    }
+
+    public void setSyncObjId(Long syncObjId) {
+        this.syncObjId = syncObjId;
+    }
+    
+    public Long getLastProcessNumber() {
+        return lastProcessNumber;
+    }
+    
+    public void setLastProcessNumber(Long number) {
+        lastProcessNumber = number;
+    }
+
+    public Date getLastProcessTime() {
+        return lastProcessTime;
+    }
+
+    public void setLastProcessTime(Date lastProcessTime) {
+        this.lastProcessTime = lastProcessTime;
+    }
+
+    public Long getLastProcessMsid() {
+        return lastProcessMsid;
+    }
+
+    public void setLastProcessMsid(Long lastProcessMsid) {
+        this.lastProcessMsid = lastProcessMsid;
+    }
+
+    public Date getCreated() {
+        return created;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+
+    public Date getLastUpdated() {
+        return lastUpdated;
+    }
+
+    public void setLastUpdated(Date lastUpdated) {
+        this.lastUpdated = lastUpdated;
+    }
     
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getSyncObjType() {
-		return syncObjType;
-	}
-
-	public void setSyncObjType(String syncObjType) {
-		this.syncObjType = syncObjType;
-	}
-
-	public Long getSyncObjId() {
-		return syncObjId;
-	}
-
-	public void setSyncObjId(Long syncObjId) {
-		this.syncObjId = syncObjId;
-	}
-	
-	public Long getLastProcessNumber() {
-		return lastProcessNumber;
-	}
-	
-	public void setLastProcessNumber(Long number) {
-		lastProcessNumber = number;
-	}
-
-	public Date getLastProcessTime() {
-		return lastProcessTime;
-	}
-
-	public void setLastProcessTime(Date lastProcessTime) {
-		this.lastProcessTime = lastProcessTime;
-	}
-
-	public Long getLastProcessMsid() {
-		return lastProcessMsid;
-	}
-
-	public void setLastProcessMsid(Long lastProcessMsid) {
-		this.lastProcessMsid = lastProcessMsid;
-	}
-
-	public Date getCreated() {
-		return created;
-	}
-
-	public void setCreated(Date created) {
-		this.created = created;
-	}
-
-	public Date getLastUpdated() {
-		return lastUpdated;
-	}
-
-	public void setLastUpdated(Date lastUpdated) {
-		this.lastUpdated = lastUpdated;
-	}
-	
-	public String toString() {
-		StringBuffer sb = new StringBuffer();
-		sb.append("SyncQueueVO {id:").append(getId());
-		sb.append(", syncObjType: ").append(getSyncObjType());
-		sb.append(", syncObjId: ").append(getSyncObjId());
-		sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
-		sb.append(", lastProcessNumber: ").append(getLastProcessNumber());
-		sb.append(", lastProcessTime: ").append(getLastProcessTime());
-		sb.append(", lastUpdated: ").append(getLastUpdated());
-		sb.append(", created: ").append(getCreated());
-		sb.append("}");
-		return sb.toString();
-	}
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append("SyncQueueVO {id:").append(getId());
+        sb.append(", syncObjType: ").append(getSyncObjType());
+        sb.append(", syncObjId: ").append(getSyncObjId());
+        sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
+        sb.append(", lastProcessNumber: ").append(getLastProcessNumber());
+        sb.append(", lastProcessTime: ").append(getLastProcessTime());
+        sb.append(", lastUpdated: ").append(getLastUpdated());
+        sb.append(", created: ").append(getCreated());
+        sb.append("}");
+        return sb.toString();
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/839929b9/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java b/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
index 49c6c4e..a40edb2 100644
--- a/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
+++ b/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
@@ -14,6 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
+
 package com.cloud.async.dao;
 
 import java.sql.PreparedStatement;
@@ -38,12 +39,12 @@ public class SyncQueueDaoImpl extends GenericDaoBase<SyncQueueVO, Long>
implemen
     private static final Logger s_logger = Logger.getLogger(SyncQueueDaoImpl.class.getName());
     
     SearchBuilder<SyncQueueVO> TypeIdSearch = createSearchBuilder();
-	
-	@Override
-	public void ensureQueue(String syncObjType, long syncObjId) {
-		Date dt = DateUtil.currentGMTTime();
-		String sql = "INSERT IGNORE INTO sync_queue(sync_objtype, sync_objid, created, last_updated)
values(?, ?, ?, ?)";
-		
+
+    @Override
+    public void ensureQueue(String syncObjType, long syncObjId) {
+        Date dt = DateUtil.currentGMTTime();
+        String sql = "INSERT IGNORE INTO sync_queue(sync_objtype, sync_objid, created, last_updated)
values(?, ?, ?, ?)";
+        
         Transaction txn = Transaction.currentTxn();
         PreparedStatement pstmt = null;
         try {
@@ -54,24 +55,24 @@ public class SyncQueueDaoImpl extends GenericDaoBase<SyncQueueVO, Long>
implemen
             pstmt.setString(4, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"),
dt));
             pstmt.execute();
         } catch (SQLException e) {
-        	s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":"
+ e.getMessage(), e);
+            s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId
+ ":" + e.getMessage(), e);
         } catch (Throwable e) {
-        	s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":"
+ e.getMessage(), e);
+            s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId
+ ":" + e.getMessage(), e);
         }
-	}
-	
-	@Override
-	public SyncQueueVO find(String syncObjType, long syncObjId) {
-    	SearchCriteria<SyncQueueVO> sc = TypeIdSearch.create();
-    	sc.setParameters("syncObjType", syncObjType);
-    	sc.setParameters("syncObjId", syncObjId);
+    }
+    
+    @Override
+    public SyncQueueVO find(String syncObjType, long syncObjId) {
+        SearchCriteria<SyncQueueVO> sc = TypeIdSearch.create();
+        sc.setParameters("syncObjType", syncObjType);
+        sc.setParameters("syncObjId", syncObjId);
         return findOneBy(sc);
-	}
+    }
 
-	@Override @DB
-	public void resetQueueProcessing(long msid) {
-		String sql = "UPDATE sync_queue set queue_proc_msid=NULL, queue_proc_time=NULL where queue_proc_msid=?";
-		
+    @Override @DB
+    public void resetQueueProcessing(long msid) {
+        String sql = "UPDATE sync_queue set queue_proc_msid=NULL, queue_proc_time=NULL where
queue_proc_msid=?";
+        
         Transaction txn = Transaction.currentTxn();
         PreparedStatement pstmt = null;
         try {
@@ -79,17 +80,17 @@ public class SyncQueueDaoImpl extends GenericDaoBase<SyncQueueVO, Long>
implemen
             pstmt.setLong(1, msid);
             pstmt.execute();
         } catch (SQLException e) {
-        	s_logger.warn("Unable to reset sync queue for management server " + msid, e);
+            s_logger.warn("Unable to reset sync queue for management server " + msid, e);
         } catch (Throwable e) {
-        	s_logger.warn("Unable to reset sync queue for management server " + msid, e);
+            s_logger.warn("Unable to reset sync queue for management server " + msid, e);
         }
-	}
-	
-	protected SyncQueueDaoImpl() {
-	    super();
-	    TypeIdSearch = createSearchBuilder();
+    }
+    
+    protected SyncQueueDaoImpl() {
+        super();
+        TypeIdSearch = createSearchBuilder();
         TypeIdSearch.and("syncObjType", TypeIdSearch.entity().getSyncObjType(), SearchCriteria.Op.EQ);
         TypeIdSearch.and("syncObjId", TypeIdSearch.entity().getSyncObjId(), SearchCriteria.Op.EQ);
         TypeIdSearch.done();
-	}
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/839929b9/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java b/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
index 814777d..e6a4e53 100644
--- a/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
+++ b/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
@@ -14,6 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
+
 package com.cloud.async.dao;
 
 import java.sql.PreparedStatement;
@@ -44,35 +45,36 @@ public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO,
Long>
     
     private final SyncQueueDao _syncQueueDao = new SyncQueueDaoImpl();
 
-	@Override
-	public SyncQueueItemVO getNextQueueItem(long queueId) {
-		
-		SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
+
+    @Override
+    public SyncQueueItemVO getNextQueueItem(long queueId) {
+        
+        SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
         sb.and("queueId", sb.entity().getQueueId(), SearchCriteria.Op.EQ);
-        sb.and("lastProcessNumber", sb.entity().getLastProcessNumber(),	SearchCriteria.Op.NULL);
+        sb.and("lastProcessNumber", sb.entity().getLastProcessNumber(),    SearchCriteria.Op.NULL);
         sb.done();
         
-    	SearchCriteria<SyncQueueItemVO> sc = sb.create();
-    	sc.setParameters("queueId", queueId);
-    	
-    	Filter filter = new Filter(SyncQueueItemVO.class, "created", true, 0L, 1L);
+        SearchCriteria<SyncQueueItemVO> sc = sb.create();
+        sc.setParameters("queueId", queueId);
+        
+        Filter filter = new Filter(SyncQueueItemVO.class, "created", true, 0L, 1L);
         List<SyncQueueItemVO> l = listBy(sc, filter);
         if(l != null && l.size() > 0)
-        	return l.get(0);
-    	
-		return null;
-	}
+            return l.get(0);
+        
+        return null;
+    }
 
-	@Override
-	public List<SyncQueueItemVO> getNextQueueItems(int maxItems) {
-		List<SyncQueueItemVO> l = new ArrayList<SyncQueueItemVO>();
-		
-		String sql = "SELECT i.id, i.queue_id, i.content_type, i.content_id, i.created " +
-					 " FROM sync_queue AS q JOIN sync_queue_item AS i ON q.id = i.queue_id " +
-					 " WHERE q.queue_proc_time IS NULL AND i.queue_proc_number IS NULL " +
-					 " GROUP BY q.id " +
-					 " ORDER BY i.id " +
-					 " LIMIT 0, ?";
+    @Override
+    public List<SyncQueueItemVO> getNextQueueItems(int maxItems) {
+        List<SyncQueueItemVO> l = new ArrayList<SyncQueueItemVO>();
+        
+        String sql = "SELECT i.id, i.queue_id, i.content_type, i.content_id, i.created "
+
+                     " FROM sync_queue AS q JOIN sync_queue_item AS i ON q.id = i.queue_id
" +
+                     " WHERE q.queue_proc_time IS NULL AND i.queue_proc_number IS NULL "
+
+                     " GROUP BY q.id " +
+                     " ORDER BY i.id " +
+                     " LIMIT 0, ?";
 
         Transaction txn = Transaction.currentTxn();
         PreparedStatement pstmt = null;
@@ -81,39 +83,40 @@ public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO,
Long>
             pstmt.setInt(1, maxItems);
             ResultSet rs = pstmt.executeQuery();
             while(rs.next()) {
-            	SyncQueueItemVO item = new SyncQueueItemVO();
-            	item.setId(rs.getLong(1));
-            	item.setQueueId(rs.getLong(2));
-            	item.setContentType(rs.getString(3));
-            	item.setContentId(rs.getLong(4));
-            	item.setCreated(DateUtil.parseDateString(TimeZone.getTimeZone("GMT"), rs.getString(5)));
-            	l.add(item);
+                SyncQueueItemVO item = new SyncQueueItemVO();
+                item.setId(rs.getLong(1));
+                item.setQueueId(rs.getLong(2));
+                item.setContentType(rs.getString(3));
+                item.setContentId(rs.getLong(4));
+                item.setCreated(DateUtil.parseDateString(TimeZone.getTimeZone("GMT"), rs.getString(5)));
+                l.add(item);
             }
         } catch (SQLException e) {
-        	s_logger.error("Unexpected sql excetpion, ", e);
+            s_logger.error("Unexpected sql excetpion, ", e);
         } catch (Throwable e) {
-        	s_logger.error("Unexpected excetpion, ", e);
+            s_logger.error("Unexpected excetpion, ", e);
         }
-		return l;
-	}
-	
-	@Override
-	public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive) {
-		SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
+        return l;
+    }
+
+    @Override
+    public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive)
{
+        SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
         sb.and("lastProcessMsid", sb.entity().getLastProcessMsid(),
-    		SearchCriteria.Op.EQ);
+            SearchCriteria.Op.EQ);
         sb.done();
         
-    	SearchCriteria<SyncQueueItemVO> sc = sb.create();
-    	sc.setParameters("lastProcessMsid", msid);
-    	
-    	Filter filter = new Filter(SyncQueueItemVO.class, "created", true, null, null);
-    	
-    	if(exclusive)
-    		return lockRows(sc, filter, true);
+        SearchCriteria<SyncQueueItemVO> sc = sb.create();
+        sc.setParameters("lastProcessMsid", msid);
+        
+        Filter filter = new Filter(SyncQueueItemVO.class, "created", true, null, null);
+        
+        if(exclusive)
+            return lockRows(sc, filter, true);
         return listBy(sc, filter);
-	}
-	
+    }
+
+
     @Override
     public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive)
{
         Date cutTime = DateUtil.currentGMTTime();


Mime
View raw message