You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Keith Turner (JIRA)" <ji...@apache.org> on 2012/09/12 03:23:08 UTC

[jira] [Commented] (ACCUMULO-706) Batch Writer needs timeout

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

Keith Turner commented on ACCUMULO-706:
---------------------------------------

I implemented the timeout code in the batch writer implementation.  Now I am at the point where I need to let the user configure the timeout.   I am thinking of adding the following to the API.

{code:java}

public class BatchWriterConfig {
  private long maxMemory = 10000000;
  private long maxLatency = 120000;
  private long timeout = Long.MAX_VALUE;
  private int maxWriteThreads = 3;

  public BatchWriterConfig setMaxMemory(long maxMemory) {
    this.maxMemory = maxMemory;
    return this;
  }

  public BatchWriterConfig setMaxLatency(long maxLatency) {
    this.maxLatency = maxLatency;
    return this;
  }

  public BatchWriterConfig setTimeout(long timeout) {
    this.timeout = timeout;
    return this;
  }


  public BatchWriterConfig setMaxWriteThreads(int maxWriteThreads) {
    this.maxWriteThreads = maxWriteThreads;
    return this;
  }
}

{code}

and the following methods to Connector

{code:java}
class Connector {
    .
    .
    .
  public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, BatchWriterConfig config);
  public BatchWriter createBatchWriter(String tableName, BatchWriterConfig config){}
  public MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config){}

    .
    .
    .
}
{code}


This would allow the user to set the timeout and hopefully future batch writer configuration changes would not require a change to connector.   The current methods for creating batch writers could be deprecated.

I thought about adding a setTimeout() method to the BatchWriter interface instead of changing Connector.  I did not like this because setTimeout() would have to be called before any mutations were added to the batch writer.

                
> Batch Writer needs timeout
> --------------------------
>
>                 Key: ACCUMULO-706
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-706
>             Project: Accumulo
>          Issue Type: New Feature
>          Components: client
>            Reporter: Keith Turner
>            Assignee: Keith Turner
>             Fix For: 1.5.0
>
>
> The BatchWriter needs a user configurable timeout.  The current behavior when a tablet or tablet server can not be successfully written to is that it will hang indefinitely retrying.  The timeout could default to max long to preserve current behavior.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira