简体   繁体   中英

How to store pdf/images to HBase Table

I am new to HBase. Below is what i am trying to achieve: 1. How to convert .pdf or .png to hbase readable format? 2. How to import these files in hbase table? (store metadata in one cf and object in another cf)

Can anyone share example on this? Any other suggestions are helpful.

For an image See my answer . For PDF also this will work since we are trying to store in most primitive way that is byte array. Suggest you to use Serialization Utils for pdf as described in my example in the answer.

OR

Use Apache Commons IO org.apache.commons.io.FileUtils.readFileToByteArray(File file) which return data of type byte[] .

Also check this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM