tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid...@pidster.com>
Subject Re: Copying large files around
Date Sat, 13 Oct 2007 18:23:03 GMT
David Kerber wrote:
> Pid wrote:
>> David Kerber wrote:
>>  
>>> What is the most efficient (=fastest) way of copying large (> 1GB [yes,
>>> that's a Giga]) files around the network in java when running under
>>> tomcat 5.5.x?  Do I use a FileInputStream and FileOutputStream with a
>>> large byte[] array?  Or what?
>>>     
>>
>> I think that the NIO apis were intended to handle speedier transfers of
>> data across network connections.
>>
>> It depends how you wish to move the data.  Google provided a wealth of
>> results of mixed tutorials and API explanations for "java nio".
>>
>> p
>>   
> Let me give a bit more detail:  I am working on a utility function in my
> webapp that will periodically copy the database file from the db server
> to a backup server on the LAN.  This particular function does not use
> the internet, it's strictly copying on the LAN.  I don't care what
> method it uses as long as it's fairly simple to code, and moves fast. 
> I've already got the creation of the backup file handled; that's a
> database function.  It's just the copying to another machine that I'm
> working on now.

Can you not make the second DB a slave of the main one, it'll be
permanently up to date that way and it doesn't require any copying.

For integrity to be maintained during the copy you'd have to stop the
database otherwise, or you could have unpleasant conditions occuring
where some database writing occurs while you're copying it.

p



> D
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message