[Building Sakai] Fwd: Proposed kernel API change for supporting files >2G

Jim Eng jimeng at umich.edu
Tue Jun 23 06:32:31 PDT 2009


There are at least two places in the patch to kernel codes where some  
issues are marked as unresolved.  Shouldn't those unresolved issues be  
dealt with before this is committed?  Otherwise, this patch may lead  
to problems later.  See the quote below for two examples.

It looks like these occur in the branch in which the entire content of  
the resource is read into a byte array in memory instead of streaming  
the content.  Earlier patches limited the use of memory arrays, but  
I'm not sure there are any guarantees that this won't result in an  
attempt to cast a very large long value to an integer.  If that  
occurs, will an exception be thrown?  If so, will the exception be  
handled?

Thanks.

Jim


Index: kernel-impl/src/main/java/org/sakaiproject/content/impl/ 
DbContentService.java
===================================================================
--- kernel-impl/src/main/java/org/sakaiproject/content/impl/ 
DbContentService.java	(revision 63329)
+++ kernel-impl/src/main/java/org/sakaiproject/content/impl/ 
DbContentService.java	(working copy)
@@ -1900,7 +1900,8 @@
  			fields[0] = resource.getId();

  			// create the body to read into
-			byte[] body = new byte[((BaseResourceEdit)  
resource).m_contentLength];
+			// TODO - check for > 2G and fail.
+			byte[] body = new byte[(int)((BaseResourceEdit)  
resource).m_contentLength];
  			m_sqlService.dbReadBinary(sql, fields, body);

  			return body;
@@ -1924,7 +1925,8 @@
  			// read the new
  			try
  			{
-				byte[] body = new byte[((BaseResourceEdit)  
resource).m_contentLength];
+				// TODO - check for >2G and fail
+				byte[] body = new byte[(int) ((BaseResourceEdit)  
resource).m_contentLength];
  				FileInputStream in = new FileInputStream(file);

  				in.read(body);



On Jun 23, 2009, at 8:39 AM, Stephen Marquard wrote:

> Hi all,
>
> In the absence of any comment on this, we intend to commit these  
> changes to kernel trunk and 5 dependent modules (metaobj, msgcntr,  
> rwiki, sam, syllabus) on Fri 26 June.
>
> The nature of the change means that the kernel and trunk code have  
> to be updated together (otherwise the trunk build will break), so  
> this will also involve updating the 1.1-SNAPSHOT kernel build in the  
> repo.
>
> If you have 3rd-party code (collab or local tools) that use or set  
> the content length for a resource, this may also require minor  
> updates.
>
> Cheers
> Stephen
>
> Stephen Marquard, Learning Technologies Co-ordinator
> Centre for Educational Technology, University of Cape Town
> http://www.cet.uct.ac.za
> Email/IM/XMPP: stephen.marquard at uct.ac.za
> Phone: +27-21-650-5037 Cell: +27-83-500-5290
>
>
>>>> "Stephen Marquard" <stephen.marquard at uct.ac.za> 06/19/09 4:23 PM  
>>>> >>>
> Hi all,
>
> http://jira.sakaiproject.org/jira/browse/KNL-205  is to support  
> files in Content Hosting over 2G in size.
>
> This requires an API change in the ContentResource and  
> ContentResourceEdit interfaces, viz.:
>
> -	public int getContentLength();
> +	public long getContentLength();
>
> -	public void setContentLength(int length);
> +	public void setContentLength(long length);
>
> It also requires a set of minor changes in five core projects, viz.  
> metaobj, msgcntr, rwiki, sam, syllabus, to deal with consequences of  
> the size change, which means that the trunk checkin needs to be  
> synchronized with the kernel update.
>
> Are there any objections to going ahead with this in trunk?
>
> Regards
> Stephen
>
>
> Stephen Marquard, Learning Technologies Co-ordinator
> Centre for Educational Technology, University of Cape Town
> http://www.cet.uct.ac.za
> Email/IM/XMPP: stephen.marquard at uct.ac.za
> Phone: +27-21-650-5037 Cell: +27-83-500-5290
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org 
>  with a subject of "unsubscribe"
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org 
>  with a subject of "unsubscribe"
>
>



More information about the sakai-dev mailing list