简体   繁体   English

如何将pdf /图像存储到HBase表

[英]How to store pdf/images to HBase Table

I am new to HBase. 我是HBase的新手。 Below is what i am trying to achieve: 1. How to convert .pdf or .png to hbase readable format? 以下是我要实现的目标:1.如何将.pdf或.png转换为hbase可读格式? 2. How to import these files in hbase table? 2.如何将这些文件导入hbase表? (store metadata in one cf and object in another cf) (将元数据存储在一个cf中,将对象存储在另一个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. 对于PDF,这也将起作用,因为我们试图以最原始的方式存储字节数组。 Suggest you to use Serialization Utils for pdf as described in my example in the answer. 建议您使用答案中我的示例中所述的pdf 序列化实用程序。

OR 要么

Use Apache Commons IO org.apache.commons.io.FileUtils.readFileToByteArray(File file) which return data of type byte[] . 使用Apache Commons IO org.apache.commons.io.FileUtils.readFileToByteArray(File file)返回byte[]类型的数据。

Also check this 也检查一下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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