hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anoop John <anoop.hb...@gmail.com>
Subject Re: Writing visibility labels with HFileOutputFormat2
Date Wed, 08 Jun 2016 10:58:15 GMT
Thanks Ram.. Ya that seems the best way as CellCreator is public
exposed class. May be we should explain abt this in hbase book under
the Visibility labels area.  Good to know you have Visibility labels
based usecase. Let us know in case of any trouble.  Thanks.

-Anoop-

On Wed, Jun 8, 2016 at 1:43 PM, ramkrishna vasudevan
<ramkrishna.s.vasudevan@gmail.com> wrote:
> Hi
>
> It can be done. See the class CellCreator which is Public facing interface.
> When you create your spark job to create the hadoop files that produces the
> HFileOutputformat2 data. While creating the KeyValues you can use the
> CellCreator to create your KeyValues and use the
> CellCreator.getVisibilityExpressionResolver() to map your String Visibility
> tags with the system generated ordinals.
>
> For eg, you can see how TextSortReducer works.  I think this should help
> you solve your problem. Let us know if you need further information.
>
> Regards
> Ram
>
> On Tue, Jun 7, 2016 at 3:58 PM, Ellis, Tom (Financial Markets IT) <
> Tom.Ellis@lloydsbanking.com.invalid> wrote:
>
>> Hi Ram,
>>
>> We're attempting to do it programmatically so:
>>
>> The HFile is created by a Spark job using saveAsNewAPIHadoopFile, and
>> using ImmutableBytesWritable as the key (rowkey) with KeyValue as the
>> value, and using the HFilOutputFormat2 format.
>> This HFile is then loaded using HBase client's
>> LoadIncrementalHFiles.doBulkLoad
>>
>> Is there a way to do this programmatically without using the ImportTsv
>> tool? I was taking a look at VisibilityUtils.createVisibilityExpTags and
>> maybe being able to just create the Tags myself that way (although it's
>> obviously @InterfaceAudience.Private) but it seems to be able to use that
>> I'd need to know Label ordinality client side..
>>
>> Thanks for your help,
>>
>> Tom
>>
>> -----Original Message-----
>> From: ramkrishna vasudevan [mailto:ramkrishna.s.vasudevan@gmail.com]
>> Sent: 07 June 2016 11:19
>> To: user@hbase.apache.org
>> Subject: Re: Writing visibility labels with HFileOutputFormat2
>>
>> -- This email has reached the Bank via an external source --
>>
>>
>> Hi Ellis
>>
>> How is the HFileOutputFormat2 files created?  Are you using the ImportTsv
>> tool?  If you are using the ImportTsv tool then yes there is a way to
>> specify visibility tags while loading from the ImportTsv tool and those
>> visibility tags are also bulk loaded as HFile.
>>
>> There is an attribute CELL_VISIBILITY_COLUMN_SPEC that can be used to
>> indicate that the data will have Visibility Tags and the tool will
>> automatically parse the specified field as Visibility Tag.
>>
>> In case you have access to the code you can see the test case
>> TestImportTSVWithVisibilityLabels to get an initial idea of how it is being
>> done. If not get back to us, happy to help .
>>
>> Regards
>> Ram
>>
>>
>>
>> On Tue, Jun 7, 2016 at 3:36 PM, Ellis, Tom (Financial Markets IT) <
>> Tom.Ellis@lloydsbanking.com.invalid> wrote:
>>
>> > Hi,
>> >
>> > I was wondering if it's possible/how to write Visibility Labels to an
>> > HFileOutputFormat2? I believe Visibility Labels are just implemented
>> > as Tags, but with the normal way of writing them with
>> > Mutation#setCellVisibility these are formally written as Tags to the
>> > cells during the VisibilityController coprocessor as we need to assert
>> > the expression is valid for the labels configured.
>> >
>> > How can we add visibility labels to cells if we have a job that
>> > creates an HFile with HFileOutputFormat2 which is then subsequently
>> > loaded using LoadIncrementalHFiles?
>> >
>> > Cheers,
>> >
>> > Tom Ellis
>> > Consultant Developer - Excelian
>> > Data Lake | Financial Markets IT
>> > LLOYDS BANK COMMERCIAL BANKING
>> > ________________________________
>> >
>> > E: Tom.Ellis@LloydsBanking.com<mailto:Tom.Ellis@LloydsBanking.com>
>> > Website:
>> > www.lloydsbankcommercial.com<http://www.lloydsbankcommercial.com/
>> > >
>> > , , ,
>> > Reduce printing. Lloyds Banking Group is helping to build the low
>> > carbon economy.
>> > Corporate Responsibility Report:
>> > www.lloydsbankinggroup-cr.com/downloads<
>> > http://www.lloydsbankinggroup-cr.com/downloads>
>> >
>> >
>> >
>> > Lloyds Banking Group plc. Registered Office: The Mound, Edinburgh EH1
>> 1YZ.
>> > Registered in Scotland no. SC95000. Telephone: 0131 225 4555. Lloyds
>> > Bank plc. Registered Office: 25 Gresham Street, London EC2V 7HN.
>> > Registered in England and Wales no. 2065. Telephone 0207626 1500. Bank
>> of Scotland plc.
>> > Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland
>> no.
>> > SC327000. Telephone: 03457 801 801. Cheltenham & Gloucester plc.
>> > Registered
>> > Office: Barnett Way, Gloucester GL4 3RL. Registered in England and
>> > Wales 2299428. Telephone: 0345 603 1637
>> >
>> > Lloyds Bank plc, Bank of Scotland plc are authorised by the Prudential
>> > Regulation Authority and regulated by the Financial Conduct Authority
>> > and Prudential Regulation Authority.
>> >
>> > Cheltenham & Gloucester plc is authorised and regulated by the
>> > Financial Conduct Authority.
>> >
>> > Halifax is a division of Bank of Scotland plc. Cheltenham & Gloucester
>> > Savings is a division of Lloyds Bank plc.
>> >
>> > HBOS plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered
>> > in Scotland no. SC218813.
>> >
>> > This e-mail (including any attachments) is private and confidential
>> > and may contain privileged material. If you have received this e-mail
>> > in error, please notify the sender and delete it (including any
>> > attachments) immediately. You must not copy, distribute, disclose or
>> > use any of the information in it or any attachments. Telephone calls
>> > may be monitored or recorded.
>> >
>>
>>
>> Lloyds Banking Group plc. Registered Office: The Mound, Edinburgh EH1 1YZ.
>> Registered in Scotland no. SC95000. Telephone: 0131 225 4555. Lloyds Bank
>> plc. Registered Office: 25 Gresham Street, London EC2V 7HN. Registered in
>> England and Wales no. 2065. Telephone 0207626 1500. Bank of Scotland plc.
>> Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no.
>> SC327000. Telephone: 03457 801 801. Cheltenham & Gloucester plc. Registered
>> Office: Barnett Way, Gloucester GL4 3RL. Registered in England and Wales
>> 2299428. Telephone: 0345 603 1637
>>
>> Lloyds Bank plc, Bank of Scotland plc are authorised by the Prudential
>> Regulation Authority and regulated by the Financial Conduct Authority and
>> Prudential Regulation Authority.
>>
>> Cheltenham & Gloucester plc is authorised and regulated by the Financial
>> Conduct Authority.
>>
>> Halifax is a division of Bank of Scotland plc. Cheltenham & Gloucester
>> Savings is a division of Lloyds Bank plc.
>>
>> HBOS plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in
>> Scotland no. SC218813.
>>
>> This e-mail (including any attachments) is private and confidential and
>> may contain privileged material. If you have received this e-mail in error,
>> please notify the sender and delete it (including any attachments)
>> immediately. You must not copy, distribute, disclose or use any of the
>> information in it or any attachments. Telephone calls may be monitored or
>> recorded.
>>

Mime
View raw message