You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Jean-Marc Spaggiari <je...@spaggiari.org> on 2014/07/29 23:54:56 UTC

HColumnDescriptor.setMaxFileSize not working as expected?

Hi,

I just did a quick test and faced this situation.

hbase(main):017:0> create 'crc', 'c', { MAX_FILESIZE =>  '21474836480' }
hbase(main):018:0> describe 'crc'
DESCRIPTION
 'crc', {TABLE_ATTRIBUTES => {MAX_FILESIZE => '21474836480'}, {NAME => 'c',
DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE =>
'0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =>
'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
=> 'false', BLOCKCACHE =>
'true'}

1 row(s) in 0.0320 seconds


Here you can see MAX_FILESIZE is correct.

hbase(main):019:0> disable 'crc'
hbase(main):020:0> drop 'crc'

Java API call:
    Configuration conf = HBaseConfiguration.create();
    HBaseAdmin hbase = new HBaseAdmin(conf);
    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("crc"));
    desc.setMaxFileSize(20*1024*1024*1024);
    HColumnDescriptor family = new HColumnDescriptor("c");
    desc.addFamily(family);
    hbase.createTable(desc);


hbase(main):021:0> describe 'crc'
DESCRIPTION
 'crc', {TABLE_ATTRIBUTES => {MAX_FILESIZE => '0'}, {NAME => 'c',
DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE =>
'0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =>
'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
=> 'false', BLOCKCACHE =>
'true'}

1 row(s) in 0.0320 seconds


Here MAX_FILESIZE is 0.

Tried with HBase 0.98.5-SNAPSHOT. I'm doing something wrong? Or it's an
issue (and I will open a JIRA)?

JM

Re: HColumnDescriptor.setMaxFileSize not working as expected?

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
Ok. Figured it.

desc.setMaxFileSize(20*1024*1024*1024); should be
desc.setMaxFileSize((long)20*1024*1024*1024); ....

I was surprise this did not worked the first run ;)

Thanks,

JM


2014-07-29 18:06 GMT-04:00 Ted Yu <yu...@gmail.com>:

> I used the shell where following 'drop' command I issued "create 'crc',
> 'c', { MAX_FILESIZE =>  '21474836480' }" one more time.
>
> MAX_FILESIZE was correct.
>
> If Java API exhibits the inconsistency, that should be a bug (I haven't
> verified).
>
> Please check your master log to confirm.
>
> Cheers
>
>
> On Tue, Jul 29, 2014 at 2:54 PM, Jean-Marc Spaggiari <
> jean-marc@spaggiari.org> wrote:
>
> > Hi,
> >
> > I just did a quick test and faced this situation.
> >
> > hbase(main):017:0> create 'crc', 'c', { MAX_FILESIZE =>  '21474836480' }
> > hbase(main):018:0> describe 'crc'
> > DESCRIPTION
> >  'crc', {TABLE_ATTRIBUTES => {MAX_FILESIZE => '21474836480'}, {NAME =>
> 'c',
> > DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE =>
> > '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =>
> > 'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
> > => 'false', BLOCKCACHE =>
> > 'true'}
> >
> > 1 row(s) in 0.0320 seconds
> >
> >
> > Here you can see MAX_FILESIZE is correct.
> >
> > hbase(main):019:0> disable 'crc'
> > hbase(main):020:0> drop 'crc'
> >
> > Java API call:
> >     Configuration conf = HBaseConfiguration.create();
> >     HBaseAdmin hbase = new HBaseAdmin(conf);
> >     HTableDescriptor desc = new
> HTableDescriptor(TableName.valueOf("crc"));
> >     desc.setMaxFileSize(20*1024*1024*1024);
> >     HColumnDescriptor family = new HColumnDescriptor("c");
> >     desc.addFamily(family);
> >     hbase.createTable(desc);
> >
> >
> > hbase(main):021:0> describe 'crc'
> > DESCRIPTION
> >  'crc', {TABLE_ATTRIBUTES => {MAX_FILESIZE => '0'}, {NAME => 'c',
> > DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE =>
> > '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =>
> > 'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
> > => 'false', BLOCKCACHE =>
> > 'true'}
> >
> > 1 row(s) in 0.0320 seconds
> >
> >
> > Here MAX_FILESIZE is 0.
> >
> > Tried with HBase 0.98.5-SNAPSHOT. I'm doing something wrong? Or it's an
> > issue (and I will open a JIRA)?
> >
> > JM
> >
>

Re: HColumnDescriptor.setMaxFileSize not working as expected?

Posted by Ted Yu <yu...@gmail.com>.
I used the shell where following 'drop' command I issued "create 'crc',
'c', { MAX_FILESIZE =>  '21474836480' }" one more time.

MAX_FILESIZE was correct.

If Java API exhibits the inconsistency, that should be a bug (I haven't
verified).

Please check your master log to confirm.

Cheers


On Tue, Jul 29, 2014 at 2:54 PM, Jean-Marc Spaggiari <
jean-marc@spaggiari.org> wrote:

> Hi,
>
> I just did a quick test and faced this situation.
>
> hbase(main):017:0> create 'crc', 'c', { MAX_FILESIZE =>  '21474836480' }
> hbase(main):018:0> describe 'crc'
> DESCRIPTION
>  'crc', {TABLE_ATTRIBUTES => {MAX_FILESIZE => '21474836480'}, {NAME => 'c',
> DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE =>
> '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =>
> 'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
> => 'false', BLOCKCACHE =>
> 'true'}
>
> 1 row(s) in 0.0320 seconds
>
>
> Here you can see MAX_FILESIZE is correct.
>
> hbase(main):019:0> disable 'crc'
> hbase(main):020:0> drop 'crc'
>
> Java API call:
>     Configuration conf = HBaseConfiguration.create();
>     HBaseAdmin hbase = new HBaseAdmin(conf);
>     HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("crc"));
>     desc.setMaxFileSize(20*1024*1024*1024);
>     HColumnDescriptor family = new HColumnDescriptor("c");
>     desc.addFamily(family);
>     hbase.createTable(desc);
>
>
> hbase(main):021:0> describe 'crc'
> DESCRIPTION
>  'crc', {TABLE_ATTRIBUTES => {MAX_FILESIZE => '0'}, {NAME => 'c',
> DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE =>
> '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =>
> 'FOREVER', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
> => 'false', BLOCKCACHE =>
> 'true'}
>
> 1 row(s) in 0.0320 seconds
>
>
> Here MAX_FILESIZE is 0.
>
> Tried with HBase 0.98.5-SNAPSHOT. I'm doing something wrong? Or it's an
> issue (and I will open a JIRA)?
>
> JM
>