在做spark时,有些时候需要加载资源文件,需要在driver或者worker端访问.在client模式下可以使用IO流直接读取,但是在cluster模式下却不能直接读取,需要如下代码: val is: InputStream = this.getClass.getResourceAsStream(“./xxx.sql”) val bufferSource = Source.fromInputStream(is) 这是直接读取classPath路径下的文件,但是cluster模式下,driver
原理:maven加载jar包过程,默认的是先扫描本地仓库,若本地仓库没有,则扫描远程仓库下载.默认的conf/settings.xml文件没有配置远程仓库,所以扫描的是maven的中央仓库(在国外),所以慢. 解决方法:配置国内镜像(如阿里云的镜像) 修改conf/settings.xml文件,配置阿里云镜像代码 <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given rep
AssetBundles are files which you can export from Unity to contain assets of your choice. These files use a proprietary compressed format and can be loaded on demand in your application. This allows you to stream content like models, textures, audio c