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;
}
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));
}
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);
}
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));
}
Aggregations