Java Code Examples for org.elasticsearch.cluster.ClusterModule#getNamedXWriteables()

The following examples show how to use org.elasticsearch.cluster.ClusterModule#getNamedXWriteables() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ESIntegTestCase.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
protected NamedXContentRegistry xContentRegistry() {
    if (isInternalCluster() && cluster().size() > 0) {
        // If it's internal cluster - using existing registry in case plugin registered custom data
        return internalCluster().getInstance(NamedXContentRegistry.class);
    } else {
        // If it's external cluster - fall back to the standard set
        return new NamedXContentRegistry(ClusterModule.getNamedXWriteables());
    }
}
 
Example 2
Source File: ElasticsearchJavaAPIScriptTest.java    From syncer with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private NamedXContentRegistry xContentRegistry() {
  return new NamedXContentRegistry(ClusterModule.getNamedXWriteables());
}
 
Example 3
Source File: ElasticsearchNodeCommand.java    From crate with Apache License 2.0 4 votes vote down vote up
public ElasticsearchNodeCommand(String description) {
    super(description);
    nodeOrdinalOption = parser.accepts("ordinal", "Optional node ordinal, 0 if not specified")
            .withRequiredArg().ofType(Integer.class);
    namedXContentRegistry = new NamedXContentRegistry(ClusterModule.getNamedXWriteables());
}
 
Example 4
Source File: ESTestCase.java    From crate with Apache License 2.0 4 votes vote down vote up
/**
 * The {@link NamedXContentRegistry} to use for this test. Subclasses should override and use liberally.
 */
protected NamedXContentRegistry xContentRegistry() {
    return new NamedXContentRegistry(ClusterModule.getNamedXWriteables());
}