Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Class dependency problem

Thread view: 
Chris Uppal - 28 Jul 2006 09:36 GMT
FamilyNet International Newsgate

From: "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>

Kenneth P. Turvey wrote:

> The problem is that I would like the "Master" from the compute server to
> be able to connect to the space and put a bunch of tasks in that it would
> like the "Worker" nodes to compute.  Then the "Master" should be able to
> disconnect and be turned off.

But this is a completely different problem from the one you originally
described, where the worker could ask for classes it needed but didn't have.
The new version, fire-and-forget, is perfectly reasonable, but requires a
different architecture.

For a start, the job fired off to the worker must have /all/ the necessary
information for computation to complete (configuration, input data, classfiles,
...).  One natural medium for delivery of all that data would be a JAR file
containing all the needed.   Note that in a fire-and-forget environment it is
better to be pessimistic about providing data, in particular the effort of
identifying a truly minimal set of required classes would be a waste of time.

So I would just fire off a JAR file containing all the calculation classes with
every request.  There would be a lot of duplication, but so what ?  It would
make your life much easier.

If you do want to try to cut down the number of classes sent, then you'll have
to do it on the master machine, or in advance (perhaps by hand).  If you want
to generate such a list automatically (and I repeat that I don't think it would
be worthwhile), then a good way to do it would be to scan the bytecodes of the
relevant classes, forming a transitive closure of the class references starting
at the "entry-point".  The easy, but coarse, way to track inter-class
references is to look at each classfile's constant pool for references to other
classes.  If you are up for a bit of extra effort you could do the same kind of
thing, but at method granularity.  In either case, a classfile library like ASM
or BCEL would do the bulk of the work for you.   Note that you would have to
find some way of handling reflective references to class (Class.forName()) --
the simplest way of doing that would be to forbid them.  Alternatively look for
literal strings which are valid class names (in JNI syntax).

There are tools available which will do this kind of analysis in order to
reduce the size of JAR files.  You might be able to apply such a tool directly,
or "borrow" some of its code.

   -- chris

FamilyNet <> Internet Gated Mail
http://www.familynet-international.org
Chris Uppal - 28 Jul 2006 10:15 GMT
> FamilyNet <> Internet Gated Mail
> http://www.familynet-international.org

Presumably a fuckup in the gateway is causing these duplications (but why only
of /my/ messages ?).  I've dropped a line to FamilyNet (and abuse at verisign).

   -- chris


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.