Spark serialization error

前端 未结 2 1134
醉酒成梦
醉酒成梦 2020-12-11 11:40

I am trying to learn spark + scala. I want to read from HBase, but without mapreduce. I created a simple HBase table - \"test\" and did 3 puts in it. I want to read it via s

2条回答
  •  清歌不尽
    2020-12-11 12:29

    what happens when you do

    @transient val conf = new HBaseConfiguration

    UPDATE Apparently there are other parts of the HBase submitted task that are also not serializable. Each of these will need to be addressed.

    • Consider whether the entity will have the same meaning/semantics on both sides of the wire. Any connections will certainly not. The HBaseConfiguration should not be serialized. But primitives and simple objects built atop primitives - and not containing context-sensitive data - are fine to include in the serialization

    • For context-sensitive entities - including the HBaseConfiguration and any connection oriented data structures - you should mark them @transient and then in the readObject() method they should be instantiated with values relevant to the client environment.

提交回复
热议问题