[jira] [Commented] (HDFS-14355) Implement SCM cache using pure java mapped byte buffer

2019-03-16 Thread Feilong He (JIRA)


[ 
https://issues.apache.org/jira/browse/HDFS-14355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16794291#comment-16794291
 ] 

Feilong He commented on HDFS-14355:
---

[~rakeshr], thanks so much for your review and comments! 
 # I have renamed the configs as you suggested.
 # New way to get MappableBlockLoader instance is introduced to replace the 
previous if-else check way, which can make new implementation for 
MappableBlockLoader easily plugin in.
 # The message has been supplemented with the specific property name.
 # Unmap statement has been added in that piece of code.
 # Yes, this assert statement is not necessary and has been removed.
 # The path where block is mapped to has been described in the corresponding 
function's javadoc.
 # The annotation has been added for {{public static void 
verifyIfValidPmemVolume(File pmemDir)}} function.
 # The annotations has been added for two new classes.
 # 1) the MLOCK config has been removed. 2) The test class has been moved into 
the suggested package. Thus our previous change for FsDatasetImpl is 
unnecessary.

I have uploaded a new patch. This patch can be directly applied to upstream 
trunk branch. [~rakeshr], please feel free to post your comments if you have 
more suggestions. Suggestions from other reviewers are also welcome.

> Implement SCM cache using pure java mapped byte buffer
> --
>
> Key: HDFS-14355
> URL: https://issues.apache.org/jira/browse/HDFS-14355
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: caching, datanode
>Reporter: Feilong He
>Assignee: Feilong He
>Priority: Major
> Attachments: HDFS-14355.000.patch, HDFS-14355.001.patch, 
> HDFS-14355.002.patch
>
>
> This task is to implement the caching to persistent memory using pure 
> {{java.nio.MappedByteBuffer}}, which could be useful in case native support 
> isn't available or convenient in some environments or platforms.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Commented] (HDFS-14355) Implement SCM cache using pure java mapped byte buffer

2019-03-14 Thread Rakesh R (JIRA)


[ 
https://issues.apache.org/jira/browse/HDFS-14355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16792605#comment-16792605
 ] 

Rakesh R commented on HDFS-14355:
-

Thanks [~PhiloHe] for the incremental patch. Following are few quick comments, 
I will continue reviewing the patch.
 # Please rename configs: {{dfs.datanode.cache.loader.impl.classname}} to => 
{{dfs.datanode.cache.loader.class}}
 {{DFS_DATANODE_CACHE_LOADER_IMPL_CLASSNAME}} to => 
{{DFS_DATANODE_CACHE_LOADER_CLASS}}
 {{DFS_DATANODE_CACHE_LOADER_IMPL_CLASSNAME_DEFAULT}} to => 
{{DFS_DATANODE_CACHE_LOADER_CLASS_DEFAULT}}
 # Replace the config reading logic like below. Also, this would help avoiding 
if-else checks : {{if 
(cacheLoader.equals(MemoryMappableBlockLoader.class.getSimpleName()))}} to 
determine which class is configured by the user.
{code:java}
DFSConfigKeys.java
  public static final String DFS_DATANODE_CACHE_LOADER_CLASS = 
"dfs.datanode.cache.loader.class";
  public static final Class 
DFS_DATANODE_CACHE_LOADER_CLASS_DEFAULT = MemoryMappableBlockLoader.class;

   You can use the following way to instantiate the cache loader.
  ..
  ..
this.cacheLoader = getConf().getClass(
DFSConfigKeys.DFS_DATANODE_CACHE_LOADER_CLASS,
DFSConfigKeys.DFS_DATANODE_CACHE_LOADER_CLASS_DEFAULT, 
MappableBlockLoader.class);
{code}

 # Add config name into the message {{"The persistent memory volumes are not 
configured!"}} to => {{"The persistent memory volume, " + 
DFSConfigKeys.DFS_DATANODE_CACHE_PMEM_DIR_KEY + " is not configured!"}}
 # Good to Unmaps the block {{mappedoutbuffer}} before deleting the file like 
below,
{code:java}
FileMappableBlockLoader.java

#verifyIfValidPmemVolume(){
   ...
   ...
if (file != null) {
  IOUtils.closeQuietly(file);
  NativeIO.POSIX.munmap(out);
try {
  FsDatasetUtil.deleteMappedFile(testFilePath);
} catch (IOException e) {
  LOG.warn("Failed to delete test file " + testFilePath +
  " from persistent memory", e);
}
{code}

 # FileMappableBlockLoader - Please remove the {{assert 
NativeIO.isAvailable();}} check, its not needed right?
 # Describe briefly about the filepath string formation pattern 
'{{PmemDir/BlockPoolId-BlockId'}} either at class or function level javadocs.
{code:java}
FileMappableBlockLoader#load()

filePath = getOneLocation() + "/" + key.getBlockPoolId() +
  "-" + key.getBlockId();
{code}

 # Add @VisibleForTesting to {{public static void verifyIfValidPmemVolume(File 
pmemDir)}} function
 # Add annotation to the new classes FileMappedBlock, FileMappableBlockLoader.
{code:java}
@InterfaceAudience.Private
@InterfaceStability.Unstable
{code}

 # Comments on TestCacheWithFileMappableBlockLoader:
 ## Remove MLOCK config, which is not required.
{code:java}
myConf.setLong(DFSConfigKeys.DFS_DATANODE_MAX_LOCKED_MEMORY_KEY,
CACHE_CAPACITY);
{code}

 ## Move the test TestCacheWithFileMappableBlockLoader.java class to {{package 
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl}}. This will avoid making 
the class FsDatasetImpl public and infact no changes to FsDatasetImpl class 
required.

> Implement SCM cache using pure java mapped byte buffer
> --
>
> Key: HDFS-14355
> URL: https://issues.apache.org/jira/browse/HDFS-14355
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: caching, datanode
>Reporter: Feilong He
>Assignee: Feilong He
>Priority: Major
> Attachments: HDFS-14355.000.patch, HDFS-14355.001.patch
>
>
> This task is to implement the caching to persistent memory using pure 
> {{java.nio.MappedByteBuffer}}, which could be useful in case native support 
> isn't available or convenient in some environments or platforms.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Commented] (HDFS-14355) Implement SCM cache using pure java mapped byte buffer

2019-03-14 Thread Feilong He (JIRA)


[ 
https://issues.apache.org/jira/browse/HDFS-14355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16792596#comment-16792596
 ] 

Feilong He commented on HDFS-14355:
---

Currently, the patch for this subtask is an incremental one based on the patch 
for HDFS-14354. I just uploaded HDFS-14355.001.patch for tracking 
HDFS-14354.004.patch.

Please feel free to post you comments, thanks!

> Implement SCM cache using pure java mapped byte buffer
> --
>
> Key: HDFS-14355
> URL: https://issues.apache.org/jira/browse/HDFS-14355
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: caching, datanode
>Reporter: Feilong He
>Assignee: Feilong He
>Priority: Major
> Attachments: HDFS-14355.000.patch, HDFS-14355.001.patch
>
>
> This task is to implement the caching to persistent memory using pure 
> {{java.nio.MappedByteBuffer}}, which could be useful in case native support 
> isn't available or convenient in some environments or platforms.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org