Java Code Examples for org.elasticsearch.common.io.stream.NamedWriteableRegistry#Entry

The following examples show how to use org.elasticsearch.common.io.stream.NamedWriteableRegistry#Entry . 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: EnterpriseUsersExtension.java    From crate with Apache License 2.0 6 votes vote down vote up
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(4);
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        UsersMetaData.TYPE,
        UsersMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        UsersMetaData.TYPE,
        in -> UsersMetaData.readDiffFrom(MetaData.Custom.class, UsersMetaData.TYPE, in)
    ));

    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        UsersPrivilegesMetaData.TYPE,
        UsersPrivilegesMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        UsersPrivilegesMetaData.TYPE,
        in -> UsersPrivilegesMetaData.readDiffFrom(MetaData.Custom.class, UsersPrivilegesMetaData.TYPE, in)
    ));
    return entries;
}
 
Example 2
Source File: Elasticsearch6Client.java    From presto-connectors with Apache License 2.0 5 votes vote down vote up
static NamedWriteableRegistry getNamedWriteableRegistry()
{
    IndicesModule indicesModule = new IndicesModule(Collections.emptyList());
    SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.addAll(indicesModule.getNamedWriteables());
    entries.addAll(searchModule.getNamedWriteables());
    return new NamedWriteableRegistry(entries);
}
 
Example 3
Source File: Elasticsearch5Client.java    From presto-connectors with Apache License 2.0 5 votes vote down vote up
static NamedWriteableRegistry getNamedWriteableRegistry()
{
    IndicesModule indicesModule = new IndicesModule(Collections.emptyList());
    SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.addAll(indicesModule.getNamedWriteables());
    entries.addAll(searchModule.getNamedWriteables());
    return new NamedWriteableRegistry(entries);
}
 
Example 4
Source File: BundlePlugin.java    From elasticsearch-plugin-bundle with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> extra = new ArrayList<>();
    if (settings.getAsBoolean("plugins.xbib.icu.enabled", true)) {
        extra.add(new NamedWriteableRegistry.Entry(
                        DocValueFormat.class,
                        IcuCollationKeyFieldMapper.CollationFieldType.COLLATE_FORMAT.getWriteableName(),
                        in -> IcuCollationKeyFieldMapper.CollationFieldType.COLLATE_FORMAT
                )
        );
    }
    return extra;
}
 
Example 5
Source File: SQLPlugin.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        UserDefinedFunctionsMetaData.TYPE,
        UserDefinedFunctionsMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        ViewsMetaData.TYPE,
        ViewsMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        UserDefinedFunctionsMetaData.TYPE,
        in -> UserDefinedFunctionsMetaData.readDiffFrom(MetaData.Custom.class, UserDefinedFunctionsMetaData.TYPE, in)
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        ViewsMetaData.TYPE,
        in -> ViewsMetaData.readDiffFrom(MetaData.Custom.class, ViewsMetaData.TYPE, in)
    ));
    if (userExtension != null) {
        entries.addAll(userExtension.getNamedWriteables());
    }
    if (licenseExtension != null) {
        entries.addAll(licenseExtension.getNamedWriteables());
    }
    return entries;
}
 
Example 6
Source File: EnterpriseLicenseExtension.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        LicenseKey.WRITEABLE_TYPE,
        LicenseKey::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        LicenseKey.WRITEABLE_TYPE,
        in -> LicenseKey.readDiffFrom(MetaData.Custom.class, LicenseKey.WRITEABLE_TYPE, in)
    ));
    return entries;
}
 
Example 7
Source File: PluginLoaderPlugin.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    return sqlPlugin.getNamedWriteables();
}
 
Example 8
Source File: IndicesModule.java    From crate with Apache License 2.0 4 votes vote down vote up
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    return namedWritables;
}
 
Example 9
Source File: NetworkModule.java    From crate with Apache License 2.0 4 votes vote down vote up
public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    return Collections.unmodifiableList(NAMED_WRITEABLES);
}
 
Example 10
Source File: Plugin.java    From crate with Apache License 2.0 2 votes vote down vote up
/**
 * Returns parsers for {@link NamedWriteable} this plugin will use over the transport protocol.
 * @see NamedWriteableRegistry
 */
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    return Collections.emptyList();
}
 
Example 11
Source File: LicenseExtension.java    From crate with Apache License 2.0 votes vote down vote up
List<NamedWriteableRegistry.Entry> getNamedWriteables(); 
Example 12
Source File: UserExtension.java    From crate with Apache License 2.0 votes vote down vote up
List<NamedWriteableRegistry.Entry> getNamedWriteables();