|
@@ -55,6 +55,7 @@ import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import org.apache.hadoop.classification.VisibleForTesting;
|
|
import org.apache.hadoop.classification.VisibleForTesting;
|
|
|
|
+import org.apache.hadoop.fs.impl.BackReference;
|
|
import org.apache.hadoop.util.Preconditions;
|
|
import org.apache.hadoop.util.Preconditions;
|
|
import org.apache.hadoop.thirdparty.com.google.common.base.Strings;
|
|
import org.apache.hadoop.thirdparty.com.google.common.base.Strings;
|
|
import org.apache.hadoop.thirdparty.com.google.common.util.concurrent.Futures;
|
|
import org.apache.hadoop.thirdparty.com.google.common.util.concurrent.Futures;
|
|
@@ -189,6 +190,9 @@ public class AzureBlobFileSystemStore implements Closeable, ListingSupport {
|
|
/** Bounded ThreadPool for this instance. */
|
|
/** Bounded ThreadPool for this instance. */
|
|
private ExecutorService boundedThreadPool;
|
|
private ExecutorService boundedThreadPool;
|
|
|
|
|
|
|
|
+ /** ABFS instance reference to be held by the store to avoid GC close. */
|
|
|
|
+ private BackReference fsBackRef;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* FileSystem Store for {@link AzureBlobFileSystem} for Abfs operations.
|
|
* FileSystem Store for {@link AzureBlobFileSystem} for Abfs operations.
|
|
* Built using the {@link AzureBlobFileSystemStoreBuilder} with parameters
|
|
* Built using the {@link AzureBlobFileSystemStoreBuilder} with parameters
|
|
@@ -202,6 +206,7 @@ public class AzureBlobFileSystemStore implements Closeable, ListingSupport {
|
|
String[] authorityParts = authorityParts(uri);
|
|
String[] authorityParts = authorityParts(uri);
|
|
final String fileSystemName = authorityParts[0];
|
|
final String fileSystemName = authorityParts[0];
|
|
final String accountName = authorityParts[1];
|
|
final String accountName = authorityParts[1];
|
|
|
|
+ this.fsBackRef = abfsStoreBuilder.fsBackRef;
|
|
|
|
|
|
leaseRefs = Collections.synchronizedMap(new WeakHashMap<>());
|
|
leaseRefs = Collections.synchronizedMap(new WeakHashMap<>());
|
|
|
|
|
|
@@ -711,6 +716,7 @@ public class AzureBlobFileSystemStore implements Closeable, ListingSupport {
|
|
.withExecutorService(new SemaphoredDelegatingExecutor(boundedThreadPool,
|
|
.withExecutorService(new SemaphoredDelegatingExecutor(boundedThreadPool,
|
|
blockOutputActiveBlocks, true))
|
|
blockOutputActiveBlocks, true))
|
|
.withTracingContext(tracingContext)
|
|
.withTracingContext(tracingContext)
|
|
|
|
+ .withAbfsBackRef(fsBackRef)
|
|
.build();
|
|
.build();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -818,6 +824,7 @@ public class AzureBlobFileSystemStore implements Closeable, ListingSupport {
|
|
abfsConfiguration.shouldReadBufferSizeAlways())
|
|
abfsConfiguration.shouldReadBufferSizeAlways())
|
|
.withReadAheadBlockSize(abfsConfiguration.getReadAheadBlockSize())
|
|
.withReadAheadBlockSize(abfsConfiguration.getReadAheadBlockSize())
|
|
.withBufferedPreadDisabled(bufferedPreadDisabled)
|
|
.withBufferedPreadDisabled(bufferedPreadDisabled)
|
|
|
|
+ .withAbfsBackRef(fsBackRef)
|
|
.build();
|
|
.build();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1871,6 +1878,7 @@ public class AzureBlobFileSystemStore implements Closeable, ListingSupport {
|
|
private AbfsCounters abfsCounters;
|
|
private AbfsCounters abfsCounters;
|
|
private DataBlocks.BlockFactory blockFactory;
|
|
private DataBlocks.BlockFactory blockFactory;
|
|
private int blockOutputActiveBlocks;
|
|
private int blockOutputActiveBlocks;
|
|
|
|
+ private BackReference fsBackRef;
|
|
|
|
|
|
public AzureBlobFileSystemStoreBuilder withUri(URI value) {
|
|
public AzureBlobFileSystemStoreBuilder withUri(URI value) {
|
|
this.uri = value;
|
|
this.uri = value;
|
|
@@ -1906,6 +1914,12 @@ public class AzureBlobFileSystemStore implements Closeable, ListingSupport {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public AzureBlobFileSystemStoreBuilder withBackReference(
|
|
|
|
+ BackReference fsBackRef) {
|
|
|
|
+ this.fsBackRef = fsBackRef;
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
public AzureBlobFileSystemStoreBuilder build() {
|
|
public AzureBlobFileSystemStoreBuilder build() {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|