Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.Write.RECOVER_LEASE_ON_CLOSE_EXCEPTION_DEFAULT;
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.Write.RECOVER_LEASE_ON_CLOSE_EXCEPTION_KEY;

/**
* This class supports writing files in striped layout and erasure coded format.
* Each stripe contains a sequence of cells.
Expand Down Expand Up @@ -1200,9 +1197,7 @@ void setClosed() {

@Override
protected synchronized void closeImpl() throws IOException {
boolean recoverLeaseOnCloseException = dfsClient.getConfiguration()
.getBoolean(RECOVER_LEASE_ON_CLOSE_EXCEPTION_KEY,
RECOVER_LEASE_ON_CLOSE_EXCEPTION_DEFAULT);
boolean recoverLeaseOnCloseException = dfsClient.getConf().getRecoverLeaseOnCloseException();
try {
if (isClosed()) {
exceptionLastSeen.check(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public class DfsClientConf {

private final boolean deadNodeDetectionEnabled;
private final long leaseHardLimitPeriod;
private final boolean recoverLeaseOnCloseException;

public DfsClientConf(Configuration conf) {
// The hdfsTimeout is currently the same as the ipc timeout
Expand Down Expand Up @@ -315,6 +316,11 @@ public DfsClientConf(Configuration conf) {
HdfsClientConfigKeys.DFS_CLIENT_PIPELINE_RECOVERY_MAX_RETRIES,
HdfsClientConfigKeys.DFS_CLIENT_PIPELINE_RECOVERY_MAX_RETRIES_DEFAULT
);

recoverLeaseOnCloseException = conf.getBoolean(
Write.RECOVER_LEASE_ON_CLOSE_EXCEPTION_KEY,
Write.RECOVER_LEASE_ON_CLOSE_EXCEPTION_DEFAULT
);
}

private ByteArrayManager.Conf loadWriteByteArrayManagerConf(
Expand Down Expand Up @@ -745,6 +751,10 @@ public int getMaxPipelineRecoveryRetries() {
return maxPipelineRecoveryRetries;
}

public boolean getRecoverLeaseOnCloseException() {
return recoverLeaseOnCloseException;
}

/**
* Configuration for short-circuit reads.
*/
Expand Down