[
https://issues.apache.org/jira/browse/HADOOP-18399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17624356#comment-17624356
]
ASF GitHub Bot commented on HADOOP-18399:
-----------------------------------------
steveloughran commented on code in PR #5054:
URL: https://github.com/apache/hadoop/pull/5054#discussion_r1005514543
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/SingleFilePerBlockCache.java:
##########
@@ -67,6 +71,8 @@ public class SingleFilePerBlockCache implements BlockCache {
private final PrefetchingStatistics prefetchingStatistics;
+ private static LocalDirAllocator localDirAllocator;
Review Comment:
shouldn't be static, as that would be shared across all fs instances, even
those of different users.
better: constructor takes an allocator, which is created in s3a caching
block manager.
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/BlockCache.java:
##########
@@ -64,7 +66,10 @@ public interface BlockCache extends Closeable {
*
* @param blockNumber the id of the given block.
* @param buffer contents of the given block to be added to this cache.
+ * @param conf the configuration.
+ * @param bufferDirConf buffer dir config to be used by local dir allocator.
* @throws IOException if there is an error writing the given block.
*/
- void put(int blockNumber, ByteBuffer buffer) throws IOException;
+ void put(int blockNumber, ByteBuffer buffer, Configuration conf, String
bufferDirConf)
Review Comment:
the allocator should be per instance for the cache; and so no need to pass
in binding info here
> SingleFilePerBlockCache to use LocalDirAllocator for file allocatoin
> --------------------------------------------------------------------
>
> Key: HADOOP-18399
> URL: https://issues.apache.org/jira/browse/HADOOP-18399
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 3.4.0
> Reporter: Steve Loughran
> Assignee: Viraj Jasani
> Priority: Major
> Labels: pull-request-available
>
> prefetching stream's SingleFilePerBlockCache uses Files.tempFile() to
> allocate a temp file.
> it should be using LocalDirAllocator to allocate space from a list of dirs,
> taking a config key to use. for s3a we will use the Constants.BUFFER_DIR
> option, which on yarn deployments is fixed under the env.LOCAL_DIR path, so
> automatically cleaned up on container exit
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]