You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by James Carman <ja...@carmanconsulting.com> on 2008/06/10 14:31:01 UTC

[vfs] SFTP Provider and Daemon Threads?

Shouldn't the SFTP provider be calling setDaemon(true) on the JSch
session?  I am running a simple application which just lists the
contents of a directory and it hangs after it's done because there's a
non-daemon thread running (looks like a keep-alive thread from JSch).

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Re: Commons-Math UnivariateStatistic implementations have no copy ability - Copy Constructor Proposed

Posted by "Jason C. HandUber" <wh...@gmail.com>.
Phil,

Well, that was easy in some cases and I'm not sure how it went in others 
and could use help. I had issue with creating a copy constructor for 
GeometricMean and SummaryStatistic. Both of these classes allow the user 
to, via the API, set a StorelessUnivariateStatistic as the 
implementation. For instance take the following method in Geometric mean:

    public void setSumLogImpl(
            StorelessUnivariateStatistic sumLogImpl) {
        checkEmpty();
        this.sumOfLogs = sumLogImpl;
    }

There is no way to create a true deep copy of sumLogImpl, as we only 
know it to be an instance of StorelessUnivariateStatistic. I think the 
solution is to allow the copy constructors for the below classes into 
the baseline, but not provide a copy constructor for GeometricMean or 
SummaryStatistic unless you want to (1) deprecate the implementation 
business or (2) create a abstract copy method in 
StorelessUnivariateStatistic forcing all implementations to be 'copyable'.

The following classes were able to be given copy constructors without issue:
Max
SumOfSquares
Sum
Product
FirstMoment
SecondMoment
ThirdMoment
FourthMoment
Median
Min
SumOfLogs
Percentile
Skewness
Variance
Mean
Kurtois
StandardDeviation

Phil Steitz wrote:
> Jason C. HandUber wrote:
>> Hello,
>>
>> I'm writing an evolutionary algorithm in which each individual 
>> contains StandardDeviations and Means. From time to time I need a 
>> deep copy / clone of an individual. Thus far I've actually had to 
>> keep a list of all data and, when cloning, generate a new statistic 
>> and increment it with all that data. Now that I'm moving to 
>> production level, turns out I'm running out of memory (no huge 
>> surprise). I'm going to extend Mean, Variance, StandardDeviation, 
>> FirstMoment, and SecondMoment for my application to provide a copy 
>> constructor (which, according to Item 10, page 51 of Bloch's 
>> effective java, beats out clone, and I buy that) for each. Anyway, I 
>> think that addition would be easy and general enough to introduce 
>> into the trunk. Any thoughts?
> +1 on this enhancement, also for SummaryStatistics, implemented as you 
> describe.
>
> Please follow instructions here 
> <http://commons.apache.org/math/developers.html> to create a patch 
> against either trunk or the 2.0 development branch 
> (/branches/MATH_2_0) and attach it to a JIRA ticket.
>
> Thanks!
>
> Phil
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[math] Re: Commons-Math UnivariateStatistic implementations have no copy ability - Copy Constructor Proposed

Posted by Phil Steitz <ph...@steitz.com>.
Jason C. HandUber wrote:
> Hello,
>
> I'm writing an evolutionary algorithm in which each individual 
> contains StandardDeviations and Means. From time to time I need a deep 
> copy / clone of an individual. Thus far I've actually had to keep a 
> list of all data and, when cloning, generate a new statistic and 
> increment it with all that data. Now that I'm moving to production 
> level, turns out I'm running out of memory (no huge surprise). I'm 
> going to extend Mean, Variance, StandardDeviation, FirstMoment, and 
> SecondMoment for my application to provide a copy constructor (which, 
> according to Item 10, page 51 of Bloch's effective java, beats out 
> clone, and I buy that) for each. Anyway, I think that addition would 
> be easy and general enough to introduce into the trunk. Any thoughts?
+1 on this enhancement, also for SummaryStatistics, implemented as you 
describe.

Please follow instructions here 
<http://commons.apache.org/math/developers.html> to create a patch 
against either trunk or the 2.0 development branch (/branches/MATH_2_0) 
and attach it to a JIRA ticket.

Thanks!

Phil
 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Commons-Math UnivariateStatistic implementations have no copy ability - Copy Constructor Proposed

Posted by "Jason C. HandUber" <wh...@gmail.com>.
Hello,

I'm writing an evolutionary algorithm in which each individual contains 
StandardDeviations and Means. From time to time I need a deep copy / 
clone of an individual. Thus far I've actually had to keep a list of all 
data and, when cloning, generate a new statistic and increment it with 
all that data. Now that I'm moving to production level, turns out I'm 
running out of memory (no huge surprise). I'm going to extend Mean, 
Variance, StandardDeviation, FirstMoment, and SecondMoment for my 
application to provide a copy constructor (which, according to Item 10, 
page 51 of Bloch's effective java, beats out clone, and I buy that) for 
each. Anyway, I think that addition would be easy and general enough to 
introduce into the trunk. Any thoughts?

Thanks,
Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Rob Moore <na...@xoxy.net>.
I might suggest removing the ant build if you don't plan on supporting it
since it's broken now. Also, the instructions on building with maven on the
web site might be made clearer since now it advises using the jar goal (this
could be ignorance to common maven practice on my part but it wouldn't help
to spell it out for those of us who are still kicking it old school with
ant).

Thanks,

Rob


jwcarman wrote:
> 
> Great!  I don't like Ant anymore anyway. :)  I'm glad maven works for you.
> 

-- 
View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17841443.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
Great!  I don't like Ant anymore anyway. :)  I'm glad maven works for you.

On Sat, Jun 14, 2008 at 1:32 AM, Rob Moore <na...@xoxy.net> wrote:
>
> I appreciate your willingness to do this but I'm happy to do the maven build
> instead -- I just was having problems getting it to work so went with the
> existing ant build. I just made another attempt with maven and it worked so
> I probably wasn't calling the right goal -- I was trying jar:jar but it
> didn't work. It seems  install is the proper goal.
>
> Thanks,
>
> Rob
>
>
> jwcarman wrote:
>>
>> Well, the commons projects are trying to move towards a maven-based
>> build.  However, maven can generate an ant-based build file.  I'll try
>> doing that and checking it in.
>>
>
> --
> View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17836067.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Rob Moore <na...@xoxy.net>.
I appreciate your willingness to do this but I'm happy to do the maven build
instead -- I just was having problems getting it to work so went with the
existing ant build. I just made another attempt with maven and it worked so
I probably wasn't calling the right goal -- I was trying jar:jar but it
didn't work. It seems  install is the proper goal.

Thanks,

Rob


jwcarman wrote:
> 
> Well, the commons projects are trying to move towards a maven-based
> build.  However, maven can generate an ant-based build file.  I'll try
> doing that and checking it in.
> 

-- 
View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17836067.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
Well, the commons projects are trying to move towards a maven-based
build.  However, maven can generate an ant-based build file.  I'll try
doing that and checking it in.

On Fri, Jun 13, 2008 at 7:27 PM, Rob Moore <na...@xoxy.net> wrote:
>
> I ran the build using ant and had the issue. I would expect these to have the
> same outcome, no?
>
>
> jwcarman wrote:
>>
>> I don't believe it requires us to change the version.  The version
>> used to build the current code has that part of the API in it.  I ran
>> the build with the pom.xml file unchanged and it worked fine.  Try
>> building trunk with the current pom.xml file and you shouldn't have
>> any problems.
>
> --
> View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17833746.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Rob Moore <na...@xoxy.net>.
I ran the build using ant and had the issue. I would expect these to have the
same outcome, no?


jwcarman wrote:
> 
> I don't believe it requires us to change the version.  The version
> used to build the current code has that part of the API in it.  I ran
> the build with the pom.xml file unchanged and it worked fine.  Try
> building trunk with the current pom.xml file and you shouldn't have
> any problems.

-- 
View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17833746.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
I don't believe it requires us to change the version.  The version
used to build the current code has that part of the API in it.  I ran
the build with the pom.xml file unchanged and it worked fine.  Try
building trunk with the current pom.xml file and you shouldn't have
any problems.

On Fri, Jun 13, 2008 at 11:53 AM, Rob Moore <na...@xoxy.net> wrote:
>
> Since this change requires a newer version of jsch then the one used to build
> the project, will it be updated as well (0.1.39 is the latest)? I'm trying
> to build a snapshot and it fails with:
>
> [javac]
> /home/rmoore/tmp/0613/vfs/core/src/main/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java:209:
> cannot find symbol
>    [javac] symbol  : method setDaemonThread(boolean)
>    [javac] location: class com.jcraft.jsch.Session
>    [javac]             session.setDaemonThread(true);
>    [javac]                    ^
>
> Thanks,
>
> Rob
>
>
> jwcarman wrote:
>>
>> I went ahead and committed it.  It was a one-line change.  So, it'll
>> be easy to back out if you so desire.  But, in my application, it
>> solved the hanging problem.  So, I resolved/closed the JIRA issue.
>>
>
> --
> View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17826602.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> Since this change requires a newer version of jsch then the one used to build
> the project, will it be updated as well (0.1.39 is the latest)? I'm trying
> to build a snapshot and it fails with:
>   
For the current VFS trunk we can do this.

James, could you update the pom and build.xml please.

Thanks!

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Rob Moore <na...@xoxy.net>.
Since this change requires a newer version of jsch then the one used to build
the project, will it be updated as well (0.1.39 is the latest)? I'm trying
to build a snapshot and it fails with:

[javac]
/home/rmoore/tmp/0613/vfs/core/src/main/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java:209:
cannot find symbol
    [javac] symbol  : method setDaemonThread(boolean)
    [javac] location: class com.jcraft.jsch.Session
    [javac]             session.setDaemonThread(true);
    [javac]                    ^
 
Thanks,

Rob


jwcarman wrote:
> 
> I went ahead and committed it.  It was a one-line change.  So, it'll
> be easy to back out if you so desire.  But, in my application, it
> solved the hanging problem.  So, I resolved/closed the JIRA issue.
> 

-- 
View this message in context: http://www.nabble.com/-vfs--SFTP-Provider-and-Daemon-Threads--tp17754263p17826602.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
On Tue, Jun 10, 2008 at 9:13 AM, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
>> I went ahead and committed it.  It was a one-line change.  So, it'll
>> be easy to back out if you so desire.  But, in my application, it
>> solved the hanging problem.  So, I resolved/closed the JIRA issue.
>>
> Yep, seems good. Thank you!

No problem!  VFS has been a lifesaver for our project!  Thank you for
all your hard work on this project.  I'm glad I could help.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> I went ahead and committed it.  It was a one-line change.  So, it'll
> be easy to back out if you so desire.  But, in my application, it
> solved the hanging problem.  So, I resolved/closed the JIRA issue.
>   
Yep, seems good. Thank you!

Ciao,
Mario
> On Tue, Jun 10, 2008 at 8:50 AM, James Carman
> <ja...@carmanconsulting.com> wrote:
>   
>> I've created:
>>
>> https://issues.apache.org/jira/browse/VFS-211
>>
>> and assigned it to myself.  If you don't mind, I'll add in this
>> feature and commit it (assuming it doesn't break anything of course).
>> :)
>>
>>
>> On Tue, Jun 10, 2008 at 8:45 AM, James Carman
>> <ja...@carmanconsulting.com> wrote:
>>     
>>> It's on the Session API (since 0.1.31 I believe).  There's a new
>>> setDaemonThread() method.
>>>
>>> On Tue, Jun 10, 2008 at 8:40 AM, Mario Ivankovits <ma...@ops.co.at> wrote:
>>>       
>>>> Hi!
>>>>         
>>>>> Shouldn't the SFTP provider be calling setDaemon(true) on the JSch
>>>>> session?  I am running a simple application which just lists the
>>>>> contents of a directory and it hangs after it's done because there's a
>>>>> non-daemon thread running (looks like a keep-alive thread from JSch).
>>>>>
>>>>>           
>>>> Is the JSch session inherited from Thread, or the flag exposed?
>>>> If there is a possibility to set this flag from VFS we should do it.
>>>>
>>>> Ciao,
>>>> Mario
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>
>>>>         
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>   


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
I went ahead and committed it.  It was a one-line change.  So, it'll
be easy to back out if you so desire.  But, in my application, it
solved the hanging problem.  So, I resolved/closed the JIRA issue.

On Tue, Jun 10, 2008 at 8:50 AM, James Carman
<ja...@carmanconsulting.com> wrote:
> I've created:
>
> https://issues.apache.org/jira/browse/VFS-211
>
> and assigned it to myself.  If you don't mind, I'll add in this
> feature and commit it (assuming it doesn't break anything of course).
> :)
>
>
> On Tue, Jun 10, 2008 at 8:45 AM, James Carman
> <ja...@carmanconsulting.com> wrote:
>> It's on the Session API (since 0.1.31 I believe).  There's a new
>> setDaemonThread() method.
>>
>> On Tue, Jun 10, 2008 at 8:40 AM, Mario Ivankovits <ma...@ops.co.at> wrote:
>>> Hi!
>>>> Shouldn't the SFTP provider be calling setDaemon(true) on the JSch
>>>> session?  I am running a simple application which just lists the
>>>> contents of a directory and it hangs after it's done because there's a
>>>> non-daemon thread running (looks like a keep-alive thread from JSch).
>>>>
>>> Is the JSch session inherited from Thread, or the flag exposed?
>>> If there is a possibility to set this flag from VFS we should do it.
>>>
>>> Ciao,
>>> Mario
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
I've created:

https://issues.apache.org/jira/browse/VFS-211

and assigned it to myself.  If you don't mind, I'll add in this
feature and commit it (assuming it doesn't break anything of course).
:)


On Tue, Jun 10, 2008 at 8:45 AM, James Carman
<ja...@carmanconsulting.com> wrote:
> It's on the Session API (since 0.1.31 I believe).  There's a new
> setDaemonThread() method.
>
> On Tue, Jun 10, 2008 at 8:40 AM, Mario Ivankovits <ma...@ops.co.at> wrote:
>> Hi!
>>> Shouldn't the SFTP provider be calling setDaemon(true) on the JSch
>>> session?  I am running a simple application which just lists the
>>> contents of a directory and it hangs after it's done because there's a
>>> non-daemon thread running (looks like a keep-alive thread from JSch).
>>>
>> Is the JSch session inherited from Thread, or the flag exposed?
>> If there is a possibility to set this flag from VFS we should do it.
>>
>> Ciao,
>> Mario
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by James Carman <ja...@carmanconsulting.com>.
It's on the Session API (since 0.1.31 I believe).  There's a new
setDaemonThread() method.

On Tue, Jun 10, 2008 at 8:40 AM, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
>> Shouldn't the SFTP provider be calling setDaemon(true) on the JSch
>> session?  I am running a simple application which just lists the
>> contents of a directory and it hangs after it's done because there's a
>> non-daemon thread running (looks like a keep-alive thread from JSch).
>>
> Is the JSch session inherited from Thread, or the flag exposed?
> If there is a possibility to set this flag from VFS we should do it.
>
> Ciao,
> Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] SFTP Provider and Daemon Threads?

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> Shouldn't the SFTP provider be calling setDaemon(true) on the JSch
> session?  I am running a simple application which just lists the
> contents of a directory and it hangs after it's done because there's a
> non-daemon thread running (looks like a keep-alive thread from JSch).
>   
Is the JSch session inherited from Thread, or the flag exposed?
If there is a possibility to set this flag from VFS we should do it.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org