摘要:
背景: Sparkstreaming计算完成的数据封装成对象后需要转换成json并输出到Redis 问题: 1、scala对象无法序列化 2、sclaa对象序列化后为空 解决方案: 1、样例类必须加上注解@BeanProperty,这样scala的类中的属性就有了get,set方法 case cla 阅读全文
摘要:
文件需要放在resource下,打成jar包后仍然可以读取到1. 各种环境都能读取。(通用) ClassPathResource classPathResource = new ClassPathResource("word.txt");InputStream inputStream =classP 阅读全文