0%

map vs foreach

  • map: 逐行计算,返回一个新的集合
  • foreach: 逐行计算,无返回结果

入门教程

给java工程师的scala入门教程

scala隐式转换

scala隐式转换

future

https://docs.scala-lang.org/zh-cn/overviews/core/futures.html

Akka在并发程序中使用Future

future 组合

  • map: 将 前一个Future的成功执行的结果 应用到 f函数后,重新生成一个新的Future对象

  • flatMap

homebrew 代理

在 bash 环境变量中配置:

1
alias brews='all_proxy=socks5://127.0.0.1:1086 brew '

pwdx

在 bash 环境变量中配置:

1
function pwdx()   { L=$(lsof -a  -d cwd -p $1 | tail -1); echo /${L#*/}; }

tailf

在 bash 环境变量中配置:

1
alias tailf='tail -f'

sed

在 bash 环境变量中配置:

1
alias sed=gsed

  • github.com/jpmml/sklearn2pmml
  • github.com/combust/mleap

jpmml-spark

项目地址: https://github.com/jpmml/jpmml-sparkml

项目特点:

相关博客:

Converting Apache Spark ML pipeline models to PMML documents

MLEAP

项目地址: https://github.com/combust/mleap

项目特点:

MLeap is a common serialization format and execution engine for machine learning pipelines.
It supports Spark, Scikit-learn and Tensorflow for training pipelines and exporting them to an MLeap Bundle.
Serialized pipelines (bundles) can be deserialized back into Spark for batch-mode scoring or the MLeap runtime to power realtime API services.

标榜: transform 耗时比传统的spark少1000倍以上。

相关博客:

docker启动mleap

  • Linear Regression: 0.0062 milliseconds with mleap vs 106 milliseconds with Spark LocalRelation
  • Random Forest: 0.0068 milliseconds with mleap vs 101 milliseconds with Spark LocalRelation

spark_streaming

由于 spark_streaming 是基于时间窗口进行的微批处理,

在实时环境使用模型

在本地运行 spark-web

spark-jetty-server

spark-as-service-using-embedded-server

我们在编写代码的时候,有时候需要获取当前线程的request变量。本文简单介绍下,我目前已知的方式。

阅读全文 »