You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jianshi Huang <ji...@gmail.com> on 2015/01/06 08:00:58 UTC

setCompactionEnabled(false) seems ignored by HBase (0.98)

Hi,

Firstly, I found it strange that when I added a new split to a table and do
admin.move, it will trigger a MAJOR compaction for the whole table.

So I tried to disable compaction before adding splits,

        admin.getTableDescriptor(tableNameBytes).setCompactionEnabled(false)

However, MAJOR compaction is still triggered, looks like the flag is
ignored by HBase? Do I need to (have to) disable the table first?

Cheers,
-- 
Jianshi Huang

LinkedIn: jianshi
Twitter: @jshuang
Github & Blog: http://huangjs.github.com/

Re: setCompactionEnabled(false) seems ignored by HBase (0.98)

Posted by Jianshi Huang <ji...@gmail.com>.
Ah! I need run

  admin.modifyTable(tableNameBytes, tableDescriptor)

Will try it soon...

Jianshi

On Tue, Jan 6, 2015 at 11:12 PM, Ted Yu <yu...@gmail.com> wrote:

> This is what setCompactionEnabled() does:
>
>   public HTableDescriptor setCompactionEnabled(final boolean isEnable) {
>
>     setValue(COMPACTION_ENABLED_KEY, isEnable ? TRUE : FALSE);
>
>     return this;
>
> FYI
>
> On Mon, Jan 5, 2015 at 11:00 PM, Jianshi Huang <ji...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Firstly, I found it strange that when I added a new split to a table and
> do
> > admin.move, it will trigger a MAJOR compaction for the whole table.
> >
> > So I tried to disable compaction before adding splits,
> >
> >
> > admin.getTableDescriptor(tableNameBytes).setCompactionEnabled(false)
> >
> > However, MAJOR compaction is still triggered, looks like the flag is
> > ignored by HBase? Do I need to (have to) disable the table first?
> >
> > Cheers,
> > --
> > Jianshi Huang
> >
> > LinkedIn: jianshi
> > Twitter: @jshuang
> > Github & Blog: http://huangjs.github.com/
> >
>



-- 
Jianshi Huang

LinkedIn: jianshi
Twitter: @jshuang
Github & Blog: http://huangjs.github.com/

Re: setCompactionEnabled(false) seems ignored by HBase (0.98)

Posted by Ted Yu <yu...@gmail.com>.
This is what setCompactionEnabled() does:

  public HTableDescriptor setCompactionEnabled(final boolean isEnable) {

    setValue(COMPACTION_ENABLED_KEY, isEnable ? TRUE : FALSE);

    return this;

FYI

On Mon, Jan 5, 2015 at 11:00 PM, Jianshi Huang <ji...@gmail.com>
wrote:

> Hi,
>
> Firstly, I found it strange that when I added a new split to a table and do
> admin.move, it will trigger a MAJOR compaction for the whole table.
>
> So I tried to disable compaction before adding splits,
>
>
> admin.getTableDescriptor(tableNameBytes).setCompactionEnabled(false)
>
> However, MAJOR compaction is still triggered, looks like the flag is
> ignored by HBase? Do I need to (have to) disable the table first?
>
> Cheers,
> --
> Jianshi Huang
>
> LinkedIn: jianshi
> Twitter: @jshuang
> Github & Blog: http://huangjs.github.com/
>

Re: setCompactionEnabled(false) seems ignored by HBase (0.98)

Posted by Jianshi Huang <ji...@gmail.com>.
Thanks Stack,

Will check the logs for reason. I'm only disabling compaction during
dynamic splits (~10 mins), so it's acceptable in my case.

Thanks,
Jianshi

On Wed, Jan 7, 2015 at 1:37 AM, Stack <st...@duboce.net> wrote:

> On Mon, Jan 5, 2015 at 11:00 PM, Jianshi Huang <ji...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Firstly, I found it strange that when I added a new split to a table and
> do
> > admin.move, it will trigger a MAJOR compaction for the whole table.
> >
>
> Usually, a compactions says what provoked it in the log and why it a major
> compaction.
>
> Splits and moves are not hooked up to force a major compaction so check
> logs to see what brought on the compaction.  Rather than wholesale disable
> compactions -- probably a bad idea -- you are probably better off trying to
> tune what triggers compactions in your workload.
>
> St.Ack
>



-- 
Jianshi Huang

LinkedIn: jianshi
Twitter: @jshuang
Github & Blog: http://huangjs.github.com/

Re: setCompactionEnabled(false) seems ignored by HBase (0.98)

Posted by Stack <st...@duboce.net>.
On Mon, Jan 5, 2015 at 11:00 PM, Jianshi Huang <ji...@gmail.com>
wrote:

> Hi,
>
> Firstly, I found it strange that when I added a new split to a table and do
> admin.move, it will trigger a MAJOR compaction for the whole table.
>

Usually, a compactions says what provoked it in the log and why it a major
compaction.

Splits and moves are not hooked up to force a major compaction so check
logs to see what brought on the compaction.  Rather than wholesale disable
compactions -- probably a bad idea -- you are probably better off trying to
tune what triggers compactions in your workload.

St.Ack