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

Aihua Xu commented on HIVE-15166:
---------------------------------

[~ericlin] Thanks for working on it. I was working on a FileHistory with 
limited file size, but I feel your simple approach would work nicely.

A couple of comments:
* Is the change in .gitignore what you intend to make? If not, can you remove 
that change?
* Seems you are not using the latest code? Can you sync to the latest and apply 
the change?
* Seems it makes sense to call ((FileHistory) 
h).setMaxSize(getOpts().getMaxHistoryRows()); when you create the FileHistory 
so we won't cache too many history in the memory as well.

{noformat}   
private void setupHistory() throws IOException {
    if (this.history != null) {
       return;
    }

    this.history = new FileHistory(new File(getOpts().getHistoryFile()));
    *** Set the maxSize here ***
    // add shutdown hook to flush the history to history file
    ShutdownHookManager.addShutdownHook(new Runnable() {
      @Override
      public void run() {
        try {
          history.flush();
        } catch (IOException e) {
          error(e);
        }
      }
    });
  }
{noformat}

> Provide beeline option to set the jline history max size
> --------------------------------------------------------
>
>                 Key: HIVE-15166
>                 URL: https://issues.apache.org/jira/browse/HIVE-15166
>             Project: Hive
>          Issue Type: Improvement
>          Components: Beeline
>    Affects Versions: 2.1.0
>            Reporter: Eric Lin
>            Assignee: Eric Lin
>            Priority: Minor
>         Attachments: HIVE-15166.patch
>
>
> Currently Beeline does not provide an option to limit the max size for 
> beeline history file, in the case that each query is very big, it will flood 
> the history file and slow down beeline on start up and shutdown.



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

Reply via email to