Search in sources :

Example 1 with Plugin

use of com.yelp.nrtsearch.server.plugins.Plugin in project nrtsearch by Yelp.

the class SimilarityCreator method initialize.

/**
 * Initialize singleton instance of {@link SimilarityCreator}. Registers all the standard
 * similarity implementations and any additional provided by {@link SimilarityPlugin}s.
 *
 * @param configuration service configuration
 * @param plugins list of loaded plugins
 */
public static void initialize(LuceneServerConfiguration configuration, Iterable<Plugin> plugins) {
    instance = new SimilarityCreator(configuration);
    for (Plugin plugin : plugins) {
        if (plugin instanceof SimilarityPlugin) {
            SimilarityPlugin similarityPlugin = (SimilarityPlugin) plugin;
            instance.register(similarityPlugin.getSimilarities());
        }
    }
}
Also used : SimilarityPlugin(com.yelp.nrtsearch.server.plugins.SimilarityPlugin) Plugin(com.yelp.nrtsearch.server.plugins.Plugin) SimilarityPlugin(com.yelp.nrtsearch.server.plugins.SimilarityPlugin)

Example 2 with Plugin

use of com.yelp.nrtsearch.server.plugins.Plugin in project nrtsearch by Yelp.

the class CollectorCreator method initialize.

/**
 * Initialize singleton instance of {@link CollectorCreator}. Registers any standard tasks and any
 * additional tasks provided by {@link com.yelp.nrtsearch.server.grpc.PluginCollector}s.
 *
 * @param configuration service configuration
 * @param plugins list of loaded plugins
 */
public static void initialize(LuceneServerConfiguration configuration, Iterable<Plugin> plugins) {
    instance = new CollectorCreator(configuration);
    for (Plugin plugin : plugins) {
        if (plugin instanceof CollectorPlugin) {
            CollectorPlugin collectorPlugin = (CollectorPlugin) plugin;
            instance.register(collectorPlugin.getCollectors());
        }
    }
}
Also used : CollectorPlugin(com.yelp.nrtsearch.server.plugins.CollectorPlugin) CollectorPlugin(com.yelp.nrtsearch.server.plugins.CollectorPlugin) Plugin(com.yelp.nrtsearch.server.plugins.Plugin)

Example 3 with Plugin

use of com.yelp.nrtsearch.server.plugins.Plugin in project nrtsearch by Yelp.

the class FetchTaskCreator method initialize.

/**
 * Initialize singleton instance of {@link FetchTaskCreator}. Registers any standard tasks and any
 * additional tasks provided by {@link FetchTaskPlugin}s.
 *
 * @param configuration service configuration
 * @param plugins list of loaded plugins
 */
public static void initialize(LuceneServerConfiguration configuration, Iterable<Plugin> plugins) {
    instance = new FetchTaskCreator(configuration);
    for (Plugin plugin : plugins) {
        if (plugin instanceof FetchTaskPlugin) {
            FetchTaskPlugin fetchTaskPlugin = (FetchTaskPlugin) plugin;
            instance.register(fetchTaskPlugin.getFetchTasks());
        }
    }
}
Also used : FetchTaskPlugin(com.yelp.nrtsearch.server.plugins.FetchTaskPlugin) Plugin(com.yelp.nrtsearch.server.plugins.Plugin) FetchTaskPlugin(com.yelp.nrtsearch.server.plugins.FetchTaskPlugin)

Example 4 with Plugin

use of com.yelp.nrtsearch.server.plugins.Plugin in project nrtsearch by Yelp.

the class RescorerCreator method initialize.

/**
 * Initialize singleton instance of {@link RescorerCreator}. Registers any additional {@link
 * RescoreOperation} implementations provided by {@link RescorerPlugin}s.
 *
 * @param configuration service configuration
 * @param plugins list of loaded plugins
 */
public static void initialize(LuceneServerConfiguration configuration, Iterable<Plugin> plugins) {
    instance = new RescorerCreator(configuration);
    for (Plugin plugin : plugins) {
        if (plugin instanceof RescorerPlugin) {
            RescorerPlugin rescorePlugin = (RescorerPlugin) plugin;
            instance.register(rescorePlugin.getRescorers());
        }
    }
}
Also used : RescorerPlugin(com.yelp.nrtsearch.server.plugins.RescorerPlugin) Plugin(com.yelp.nrtsearch.server.plugins.Plugin) RescorerPlugin(com.yelp.nrtsearch.server.plugins.RescorerPlugin)

Example 5 with Plugin

use of com.yelp.nrtsearch.server.plugins.Plugin in project nrtsearch by Yelp.

the class BackendGlobalStateTest method setup.

@BeforeClass
public static void setup() {
    String configFile = "nodeName: \"lucene_server_foo\"";
    LuceneServerConfiguration dummyConfig = new LuceneServerConfiguration(new ByteArrayInputStream(configFile.getBytes()));
    List<Plugin> dummyPlugins = Collections.emptyList();
    // these must be initialized to create an IndexState
    FieldDefCreator.initialize(dummyConfig, dummyPlugins);
    SimilarityCreator.initialize(dummyConfig, dummyPlugins);
}
Also used : LuceneServerConfiguration(com.yelp.nrtsearch.server.config.LuceneServerConfiguration) ByteArrayInputStream(java.io.ByteArrayInputStream) Plugin(com.yelp.nrtsearch.server.plugins.Plugin) BeforeClass(org.junit.BeforeClass)

Aggregations

Plugin (com.yelp.nrtsearch.server.plugins.Plugin)9 ByteString (com.google.protobuf.ByteString)1 LuceneServerConfiguration (com.yelp.nrtsearch.server.config.LuceneServerConfiguration)1 AnalysisPlugin (com.yelp.nrtsearch.server.plugins.AnalysisPlugin)1 CollectorPlugin (com.yelp.nrtsearch.server.plugins.CollectorPlugin)1 FetchTaskPlugin (com.yelp.nrtsearch.server.plugins.FetchTaskPlugin)1 FieldTypePlugin (com.yelp.nrtsearch.server.plugins.FieldTypePlugin)1 RescorerPlugin (com.yelp.nrtsearch.server.plugins.RescorerPlugin)1 ScriptPlugin (com.yelp.nrtsearch.server.plugins.ScriptPlugin)1 SimilarityPlugin (com.yelp.nrtsearch.server.plugins.SimilarityPlugin)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 BeforeClass (org.junit.BeforeClass)1