HADOOP-18476. Abfs and S3A FileContext bindings to close wrapped filesystems in finalizer (#4966)
This is to try and close the underlying filesystems when the FileContext APIs are used. Without this, threads may be leaked Contributed by Steve Loughran
This commit is contained in:
parent
84c7fd909b
commit
7a18ceb269
@ -54,4 +54,13 @@ public String toString() {
|
|||||||
sb.append('}');
|
sb.append('}');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the file system; the FileContext API doesn't have an explicit close.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void finalize() throws Throwable {
|
||||||
|
fsImpl.close();
|
||||||
|
super.finalize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,4 +43,13 @@ public class Abfs extends DelegateToFileSystem {
|
|||||||
public int getUriDefaultPort() {
|
public int getUriDefaultPort() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the file system; the FileContext API doesn't have an explicit close.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void finalize() throws Throwable {
|
||||||
|
fsImpl.close();
|
||||||
|
super.finalize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,4 +43,13 @@ public class Abfss extends DelegateToFileSystem {
|
|||||||
public int getUriDefaultPort() {
|
public int getUriDefaultPort() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the file system; the FileContext API doesn't have an explicit close.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void finalize() throws Throwable {
|
||||||
|
fsImpl.close();
|
||||||
|
super.finalize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user