Sparkローカルデバッグで発生したCheckPointシーケンス化の問題とorg.apache.hadoop.nativeio.NativeIO$windows.createFilewithMode0
938 ワード
最初の質問
Dstream checkpointing has been enabled but the Dstreams with their functions are not serializable
なぜならJSSCを作成する関数はsetパラメータに使用され、オリジナルのmapは使用できないからである.keysetはシーケンス化がサポートされていないため
kafkaはsparkで消費され、メタデータはcheckpointで保存されます.
問題は、作成関数にredisで保存するtopic-partition map情報を読み取ることで直接使用するmapが用いられることである.だが...keysetはシーケンス化できません
解決策
new HashSet<>(map.keyset())
2番目の質問
org.apache.hadoop.nativeio.NativeIO$windows.createFilewithMode0
解決する
解決策hadoopを除去する.dll
参照先:
https://stackoverflow.com/questions/51680277/java-lang-unsatisfiedlinkerror-org-apache-hadoop-io-nativeio-nativeiowindows-c
Dstream checkpointing has been enabled but the Dstreams with their functions are not serializable
なぜならJSSCを作成する関数はsetパラメータに使用され、オリジナルのmapは使用できないからである.keysetはシーケンス化がサポートされていないため
kafkaはsparkで消費され、メタデータはcheckpointで保存されます.
Function0 createContextFunc= () -> createContext(conf);
JavaStreamingContext jssc = CommonUtil.getJavaStreamingContext(
ConfigurationManager.getProperty("spark.CheckPointPath"), createContextFunc);
問題は、作成関数にredisで保存するtopic-partition map情報を読み取ることで直接使用するmapが用いられることである.だが...keysetはシーケンス化できません
解決策
new HashSet<>(map.keyset())
2番目の質問
org.apache.hadoop.nativeio.NativeIO$windows.createFilewithMode0
解決する
解決策hadoopを除去する.dll
参照先:
https://stackoverflow.com/questions/51680277/java-lang-unsatisfiedlinkerror-org-apache-hadoop-io-nativeio-nativeiowindows-c