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

Matt Dailey commented on ACCUMULO-1849:
---------------------------------------

I took a look at this problem, and I was thinking of solving it like this:

Before:

{code:java}
  private static int getFSOutputBufferSize(Configuration conf) {
    return conf.getInt(FS_OUTPUT_BUF_SIZE_ATTR, 256 * 1024);
  }

  private static int getFSInputBufferSize(Configuration conf) {
    return conf.getInt(FS_INPUT_BUF_SIZE_ATTR, 32 * 1024);
  }
{code}

After:

{code:java}
  public static final String TFILE_FS_OUTPUT_BUF_SIZE_ATTR = 
"tfile.fs.output.buffer.size";
  public static final String TFILE_FS_INPUT_BUF_SIZE_ATTR = 
"tfile.fs.input.buffer.size";

  public static final String BCFILE_FS_OUTPUT_BUF_SIZE_ATTR = 
"bcfile.fs.output.buffer.size";
  public static final String BCFILE_FS_INPUT_BUF_SIZE_ATTR = 
"bcfile.fs.input.buffer.size";

  public static final int DEFAULT_FS_OUTPUT_BUFFER_SIZE = 256 * 1024;
  public static final int DEFAULT_FS_INPUT_BUFFER_SIZE = 32 * 1024;

  public static int getFSOutputBufferSize(Configuration conf) {
    return conf.getInt(BCFILE_FS_OUTPUT_BUF_SIZE_ATTR,
            conf.getInt(TFILE_FS_OUTPUT_BUF_SIZE_ATTR, 
DEFAULT_FS_OUTPUT_BUFFER_SIZE));
  }

  public static int getFSInputBufferSize(Configuration conf) {
    return conf.getInt(BCFILE_FS_INPUT_BUF_SIZE_ATTR,
            conf.getInt(TFILE_FS_INPUT_BUF_SIZE_ATTR, 
DEFAULT_FS_INPUT_BUFFER_SIZE));
  }
{code}

Changes: 
* Adds {{bcfile.x.y.z}} parameters, which are read from the Configuration with 
higher precedence than the {{tfile.x.y.z}} parameters.
* All of the constants and the static methods are public.

I really made things public to assist in unit testing, but wasn't sure about 
side-effects of that change.  This class isn't part of the public API, so I was 
unsure of how much churn is acceptable.  Thoughts?

> Migrate tfile buffer configurations to bcfile configuration paramter
> --------------------------------------------------------------------
>
>                 Key: ACCUMULO-1849
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1849
>             Project: Accumulo
>          Issue Type: Bug
>          Components: tserver
>            Reporter: John Vines
>              Labels: newbie
>             Fix For: 1.7.0
>
>
> In 1.6.0 we purged the TFile code, because we only use 2 static methods which 
> utilized 2 configurations with tfile in the name. We should migrate those 
> configurations over into a bcfile named convention (as well as document those 
> configurations).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to