You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Conor MacNeill <co...@cenqua.com> on 2005/04/14 06:15:17 UTC

[PATCH] Add Javahl method to stream content

This patch adds the ability to stream file content to a java 
OutputStream rather than reading the complete content into a byte array 
is is the case with the current fileContent methods. Requiring all of 
the content to be read into memory wont scale for larger files. The 
buffer size is passed in as part of the interface but this could be set 
within the code if desired and eliminated from the interface.

By using an OutputStream approach rather than creating a svn specific 
InputStream subClass, the javahl interface can be in control of the 
underlying native stream lifetime.

The common code between fileContent and streamFileContent has been 
extracted to a new method createReadStream which does the stream creation.

There's also a little bugfix included for the JNIEntry call in the 
fileContent method in org_tigris_subversion_javahl_SVNClient.cpp

I've added a simple testcase based on the existing fileContent test 
method in BasicTests.

The new interface method takes a pegRevision parameter like the new 
version of fileContent but I must admit I'm not sure what a pegRevision 
is. Can anyone explain that?

The other issue I came across is that I build subversion using a 
checkout of apr. On WinXP, this always fails to get file protection 
information in the apr_stat call just after creating a directory. I 
disabled this in my working copy to be able to test this patch.

Feel free to make changes, etc and let me know of any issues.

Cheers
Conor

Re: [PATCH] Add Javahl method to stream content

Posted by Michael W Thelen <mi...@pietdepsi.com>.
Conor MacNeill wrote:
> This patch adds the ability to stream file content to a java
> OutputStream rather than reading the complete content into a byte array
> is is the case with the current fileContent methods. Requiring all of
> the content to be read into memory wont scale for larger files. The
> buffer size is passed in as part of the interface but this could be set
> within the code if desired and eliminated from the interface.

Thank you for the patch, I've filed it as issue #2299:
http://subversion.tigris.org/issues/show_bug.cgi?id=2299

> There's also a little bugfix included for the JNIEntry call in the
> fileContent method in org_tigris_subversion_javahl_SVNClient.cpp

Since it's a small bugfix that can be applied separately, you may want
to send it as a separate patch to the dev@ mailing list.

--
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Problem building subversion with apr checkout Was: [PATCH] Add Javahl method to stream content

Posted by Patrick Mayweg <ma...@qint.de>.
Hi Conor,
I have changed the subject line, to make the problem more prominent for 
the core developers. This is not an area, where I can do much.
Patrick

>>> The other issue I came across is that I build subversion using a 
>>> checkout of apr. On WinXP, this always fails to get file protection 
>>> information in the apr_stat call just after creating a directory. I 
>>> disabled this in my working copy to be able to test this patch.
>>
>>
>>
>> No idea. Do you have the same problem if you use the command line 
>> client?
>>
>
> Yes. - it is not java related.
>
> Conor


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Add Javahl method to stream content

Posted by Conor MacNeill <co...@cenqua.com>.
Patrick Mayweg wrote:
> Hi Conor,
> I will have a detail look a at your patch in the next days. I am at the 
> moment not real sure if I can add the new method to the 1.2 branch.
> 
>>
>> There's also a little bugfix included for the JNIEntry call in the 
>> fileContent method in org_tigris_subversion_javahl_SVNClient.cpp
> 
> 
> Can you tell me something about the underlying problem?
> 

No real problem - just a typo or cut&paste issue. In the fileContent 
method's JNIEntry it said "propertyCreate"

    (JNIEnv *env, jobject jthis, jstring jpath, jobject jrevision,
     jobject jpegRevision)
  {
-    JNIEntry(SVNClient, propertyCreate);
+    JNIEntry(SVNClient, fileContent);


>> The other issue I came across is that I build subversion using a 
>> checkout of apr. On WinXP, this always fails to get file protection 
>> information in the apr_stat call just after creating a directory. I 
>> disabled this in my working copy to be able to test this patch.
> 
> 
> No idea. Do you have the same problem if you use the command line client?
> 

Yes. - it is not java related.

Conor

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Add Javahl method to stream content

Posted by Patrick Mayweg <ma...@qint.de>.
Hi Conor,
I will have a detail look a at your patch in the next days. I am at the 
moment not real sure if I can add the new method to the 1.2 branch.

Conor MacNeill wrote:

> This patch adds the ability to stream file content to a java 
> OutputStream rather than reading the complete content into a byte 
> array is is the case with the current fileContent methods. Requiring 
> all of the content to be read into memory wont scale for larger files. 
> The buffer size is passed in as part of the interface but this could 
> be set within the code if desired and eliminated from the interface.
>
> By using an OutputStream approach rather than creating a svn specific 
> InputStream subClass, the javahl interface can be in control of the 
> underlying native stream lifetime.
>
> The common code between fileContent and streamFileContent has been 
> extracted to a new method createReadStream which does the stream 
> creation.
>
> There's also a little bugfix included for the JNIEntry call in the 
> fileContent method in org_tigris_subversion_javahl_SVNClient.cpp

Can you tell me something about the underlying problem?

>
> I've added a simple testcase based on the existing fileContent test 
> method in BasicTests.
>
> The new interface method takes a pegRevision parameter like the new 
> version of fileContent but I must admit I'm not sure what a 
> pegRevision is. Can anyone explain that?

If you want to access a file a an earlier revision, which has been 
moved, you need to specify a pegRegvision. This revision is used to 
interpret the path.

>
> The other issue I came across is that I build subversion using a 
> checkout of apr. On WinXP, this always fails to get file protection 
> information in the apr_stat call just after creating a directory. I 
> disabled this in my working copy to be able to test this patch.

No idea. Do you have the same problem if you use the command line client?

>
> Feel free to make changes, etc and let me know of any issues.
>
> Cheers
> Conor
>
Thanks,
Patrick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org