我在徘徊是什么是为elasticsearch中的文档添加自定义元数据的最佳方式.
可以说我有一个类型的文件 Test
"Test": {
"properties": {
"TestName": {
"type": "string"
},
"LastRunTime": {
"type": "string"
},
"id": {
"type": "string"
},
"lastUpdate": {
"type": "string"
}
....
}
Run Code Online (Sandbox Code Playgroud)
我想为每个字段名称添加一个显示名称.例如
"TestName": {
"type": "string"
"display_name": "Test Name"
},
"LastRunTime": {
"type": "string"
"display_name": "Last Run Time"
}
Run Code Online (Sandbox Code Playgroud)
最好的方法是什么?我知道_meta在索引映射中有一个字段,这是要走的路吗?如果我在该索引上执行的每个搜索查询中都可以返回此元数据,我也很乐意.
我正在使用 Intellij 2016.1 和 docker 插件 2.1.4。我正在尝试将一个简单的 java 容器部署到远程机器并出现错误:
无法部署 'gaia-itest Image Id: gaiaadm/gaia-integration-tests': javax.websocket.DeploymentException: 发起 WebSocket 连接的 HTTP 请求失败
这是部署日志的输出:
Deploying 'gaia-itest Image Id: gaiaadm/gaia-integration-tests'...
Creating container...
Container Id: 71afc5f10a0779639543bb7c74235f507d59e24890e66d01fe17a7f90cccc301
Starting container 'gaia-itest'
Attaching to container 'gaia-itest'...
Failed to deploy 'gaia-itest Image Id: gaiaadm/gaia-integration-tests': javax.websocket.DeploymentException: The HTTP request to initiate the WebSocket connection failed
Run Code Online (Sandbox Code Playgroud)
这是我的 Dockerfile:
FROM maven:3.3.3-jdk-8
# Bundle app source
COPY . /src
# Set the working directory
WORKDIR /src
LABEL test=
LABEL test.run.interval=300000
CMD ["mvn","clean","install"]
Run Code Online (Sandbox Code Playgroud)
和容器设置: …
在我们的应用程序中,我们使用Hystrix,因为我们调用了多个外部服务。我们想为我们调用的每个外部服务配置一个线程池(具有特定的大小)。
假设有三个外部服务,分别称为S1,S2,S3。此外,我们有10个扩展类HystrixCommand,称为C1至C10。
C1和C2调用S1,并且应使用具有15个线程的相同线程池。在C1的构造函数中,我们对进行以下调用super:
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("S1"))
.andThreadPoolKey(ThreadPools.S1)
.andThreadPoolPropertiesDefaults(HystrixThreadPoolProperties.Setter().withCoreSize(15))
.andCommandPropertiesDefaults(HystrixCommandProperties.Setter().withExecutionTimeoutInMilliseconds(timeout)));
Run Code Online (Sandbox Code Playgroud)
在一个命令(C1)的构造函数内部,我们将S1的线程池大小指定为15。这ThreadPools是一个自定义类,其中的final static属性S1由
S1 = HystrixThreadPoolKey.Factory.asKey("S1");
Run Code Online (Sandbox Code Playgroud)
现在的实际问题是:(1)为什么在a HystrixCommand而不是中央线程池定义(似乎不是Hystrix的概念)中指定线程池核心大小(对于S1为15 )。
假设在C2(与上面的代码段相同的)构造函数中,我们用一个非15的参数调用withCoreSize。(2)将使用哪个参数?
(3)有没有一种方法可以在一个类中为服务S1,S2和S3定义三个线程池,并从命令类中引用它们?
Hystrix的使用方法指南似乎不包含与此相关的信息。如果有人有时间回答这个问题,那就太好了。