Search in sources :

Example 1 with ElasticConnection

use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection in project jackrabbit-oak by apache.

the class ElasticIndexImporterSupport method createElasticEditorProvider.

private IndexEditorProvider createElasticEditorProvider() {
    final ElasticConnection.Builder.BuildStep buildStep = ElasticConnection.newBuilder().withIndexPrefix(indexPrefix).withConnectionParameters(scheme, host, port);
    final ElasticConnection connection;
    if (apiKeyId != null && apiSecretId != null) {
        connection = buildStep.withApiKeys(apiKeyId, apiSecretId).build();
    } else {
        connection = buildStep.build();
    }
    closer.register(connection);
    ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
    ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
    return editorProvider;
}
Also used : ExtractedTextCache(org.apache.jackrabbit.oak.plugins.index.search.ExtractedTextCache) ElasticIndexTracker(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexTracker) ElasticConnection(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection) ElasticMetricHandler(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler) ElasticIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticIndexEditorProvider)

Example 2 with ElasticConnection

use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection in project jackrabbit-oak by apache.

the class ElasticOutOfBandIndexer method createElasticEditorProvider.

private IndexEditorProvider createElasticEditorProvider() {
    final ElasticConnection.Builder.BuildStep buildStep = ElasticConnection.newBuilder().withIndexPrefix(indexPrefix).withConnectionParameters(scheme, host, port);
    final ElasticConnection connection;
    if (apiKeyId != null && apiSecretId != null) {
        connection = buildStep.withApiKeys(apiKeyId, apiSecretId).build();
    } else {
        connection = buildStep.build();
    }
    closer.register(connection);
    ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
    return new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
}
Also used : ExtractedTextCache(org.apache.jackrabbit.oak.plugins.index.search.ExtractedTextCache) ElasticIndexTracker(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexTracker) ElasticConnection(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection) ElasticMetricHandler(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler) ElasticIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticIndexEditorProvider)

Example 3 with ElasticConnection

use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection in project jackrabbit-oak by apache.

the class ElasticDocumentStoreIndexer method createElasticIndexerProvider.

private NodeStateIndexerProvider createElasticIndexerProvider() {
    final ElasticConnection.Builder.BuildStep buildStep = ElasticConnection.newBuilder().withIndexPrefix(indexPrefix).withConnectionParameters(scheme, host, port);
    final ElasticConnection coordinate;
    if (apiKeyId != null && apiSecretId != null) {
        coordinate = buildStep.withApiKeys(apiKeyId, apiSecretId).build();
    } else {
        coordinate = buildStep.build();
    }
    closer.register(coordinate);
    return new ElasticIndexerProvider(indexHelper, coordinate);
}
Also used : ElasticConnection(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection)

Example 4 with ElasticConnection

use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection in project jackrabbit-oak by apache.

the class AsyncIndexerElastic method getIndexEditorProvider.

@Override
public IndexEditorProvider getIndexEditorProvider() {
    final ElasticConnection.Builder.BuildStep buildStep = ElasticConnection.newBuilder().withIndexPrefix(indexOpts.getIndexPrefix()).withConnectionParameters(indexOpts.getElasticScheme(), indexOpts.getElasticHost(), indexOpts.getElasticPort());
    final ElasticConnection connection;
    if (indexOpts.getApiKeyId() != null && indexOpts.getApiKeySecret() != null) {
        connection = buildStep.withApiKeys(indexOpts.getApiKeyId(), indexOpts.getApiKeySecret()).build();
    } else {
        connection = buildStep.build();
    }
    closer.register(connection);
    ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
    return new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
}
Also used : ExtractedTextCache(org.apache.jackrabbit.oak.plugins.index.search.ExtractedTextCache) ElasticIndexTracker(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexTracker) ElasticConnection(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection) ElasticMetricHandler(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler) ElasticIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticIndexEditorProvider)

Aggregations

ElasticConnection (org.apache.jackrabbit.oak.plugins.index.elastic.ElasticConnection)4 ElasticIndexTracker (org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexTracker)3 ElasticMetricHandler (org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler)3 ElasticIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticIndexEditorProvider)3 ExtractedTextCache (org.apache.jackrabbit.oak.plugins.index.search.ExtractedTextCache)3