top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime?

+2 votes
325 views
What are LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime?
posted Mar 6, 2014 by Muskan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Famous Interview Question and can find so many references -

In normal .NET environment objects lifetime is managed by garbage collector. But in remoting environment remote clients can access objects which are out of control of garbage collector. Garbage collector boundary is limited to a single PC on which framework is running; any remote client across physical PC is out of control of GC (Garbage Collector).

This constraint of garbage collector leads to a new way of handling lifetime for remoting objects, by using concept called as LeaseTime. Every server side object is assigned by default a LeaseTime of five minutes. This leasetime is decreased at certain intervals. Again for every method call a default of two minutes is assigned. When I say method call means every call made from client. This is called as RenewalOnCallTime. Let’s put the whole thing in equation to make the concept more clear.

Total Remoting object life time = LeaseTime + (Number of method calls) X (RenewalTime).

If we take NumberOfMethodCalls as one, then

default Remote Object Life Time = 5 + (1) X 2 = 10 minutes (Everything is in minutes)

When total object lifetime is reduced to zero, it queries the sponsor that should the object be destroyed. Sponsor is an object which decides should object Lifetime be renewed. So it queries any registered sponsors with the object, if does not find any then the object is marked for garbage collection. After this garbage collection has whole control on the object lifetime. If we do not foresee how long a object will be needed specify the SponsorShipTimeOut value. SponsorShipTimeOut is time unit a call to a sponsor is timed out. LeaseManagerPollTime defines the time the sponsor has to return a lease time extension

answer Mar 6, 2014 by Salil Agrawal
Similar Questions
+1 vote

My project required to execute a hadoop job remotely and the job requires some third-part libraries (jar files). I tried:
1. Copy these jar files to hdfs.
2. Copy them into the distributed cache using DistributedCache.addFileToClassPath so that hadoop can spread these jar files to each of the slave nodes.

However, my program still throws ClassNotFoundException. Indicating that some of the classes cannot be found when the job is running.

So I am lookinh:
1. What is the correct way to run a job remotely and programmatically while the job requires some third-party jar files.
2. I found DistributedCache is deprecated (Im using hadoop 1.2.0), what is the alternative class?

+1 vote

I have a requirement where I need to kill one process on remote windows machine. Following command just works fine if i have to kill process on local machine

os.system('taskkill /f /im processName.exe')

However I am not able to figure out how to execute this command on remote windows machine. So is there any way I can execute command from windows machine on remote windows machine ?
Note: my local machine is also windows (machine from where i have to execute command)

...