创建 Codebuild 项目时,可以在 Artifacts 部分配置缓存以加快后续构建。
Docker layer cache是那里的选择之一。AWS 文档说:
LOCAL_DOCKER_LAYER_CACHE 模式缓存现有的 Docker 层。对于构建或拉取大型 Docker 镜像的项目,此模式是一个不错的选择。它可以防止由于从网络中拉下大型 Docker 镜像而导致的性能问题。
笔记
您只能在 Linux 环境中使用 Docker 层缓存。
必须设置特权标志,以便您的项目具有所需的 Docker 权限。
在使用 Docker 层缓存之前,您应该考虑安全隐患。
问题是:这些安全隐患是什么?
ElasticSearch版本:0.90.2
我正在尝试使custom_score查询工作,以便按新近度对文档进行评分,但到目前为止我所得到的只是一个
ClassCastException[org.elasticsearch.index.fielddata.ScriptDocValues$Longs cannot be cast to java.lang.Integer]
Run Code Online (Sandbox Code Playgroud)
我们的想法是使用具有整数类型时间戳的字段索引文档,然后比较它在查询中传递当前时间戳参数.为什么索引的整数值变长?
以下是重现的命令:
curl -XPUT 'http://localhost:9200/test_longs_problem/'
curl -XPUT 'http://localhost:9200/test_longs_problem/albums/_mapping' -d '
{
"albums" : {
"properties" : {
"date" : {"type" : "integer", "analyzed" : false}
}
}
}'
curl -XPUT 'http://localhost:9200/test_longs_problem/albums/1' -d '
{
"date" : 1376823903
}'
curl -XGET 'http://localhost:9200/test_longs_problem/albums/_search?pretty' -d '{
"query": {
"custom_score": {
"query": {
"match_all": {}
},
"params": {
"now": 1376823903
},
"script": "_score * 0.2 / (3.16 * pow(10, -9) * abs(now - doc[\"date\"]) + 0.05) …Run Code Online (Sandbox Code Playgroud)