@Private
public class LeaseRenewer
extends java.lang.Object
Used by DFSClient for renewing
file-being-written leases on the namenode.
When a file is opened for write (create or append),
namenode stores a file lease for recording the identity of the writer.
The writer (i.e. the DFSClient) is required to renew the lease periodically.
When the lease is not renewed before it expires,
the namenode considers the writer as failed and then it may either let
another writer to obtain the lease or close the file.
This class also provides the following functionality:
LeaseRenewer instance is used for renewing lease
for all the DFSClient to the same namenode and
the same user.
DFSClient.
Periodically the leases for all the clients are renewed.
A client is removed from the list when the client is closed.
LeaseRenewer
to renew the leases.
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method | Description |
|---|---|---|
void |
closeClient(DFSClient dfsc) |
Close the given client.
|
static LeaseRenewer |
getInstance(java.lang.String authority,
org.apache.hadoop.security.UserGroupInformation ugi,
DFSClient dfsc) |
Get a
LeaseRenewer instance |
void |
interruptAndJoin() |
|
boolean |
isEmpty() |
Does this renewer have nothing to renew?
|
boolean |
isRunning() |
|
boolean |
put(DFSClient dfsc) |
|
static void |
remove(LeaseRenewer renewer) |
Remove the given renewer from the Factory.
|
static void |
setLeaseRenewerGraceDefault(long leaseRenewerGraceDefault) |
|
void |
setRenewalTime(long renewal) |
Used for testing only.
|
java.lang.String |
toString() |
public static LeaseRenewer getInstance(java.lang.String authority, org.apache.hadoop.security.UserGroupInformation ugi, DFSClient dfsc)
LeaseRenewer instancepublic static void remove(LeaseRenewer renewer)
LeaseRenewer instance.renewer - Instance to be cleared from Factory@VisibleForTesting public void setRenewalTime(long renewal)
@VisibleForTesting public boolean isRunning()
public boolean isEmpty()
public boolean put(DFSClient dfsc)
public void closeClient(DFSClient dfsc)
public void interruptAndJoin()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.String toString()
toString in class java.lang.Object@VisibleForTesting public static void setLeaseRenewerGraceDefault(long leaseRenewerGraceDefault)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.