@CapabilityDescription(value="Lookup a record from Elasticsearch Server associated with the specified document ID. The coordinates that are passed to the lookup must contain the key \'id\'.") @Tags(value={"lookup","enrich","record","elasticsearch"}) public class ElasticSearchLookupService extends JsonInferenceSchemaRegistryService implements LookupService<Record>
| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
CLIENT_SERVICE |
private ElasticSearchClientService |
clientService |
private List<PropertyDescriptor> |
DESCRIPTORS |
private String |
index |
static PropertyDescriptor |
INDEX |
private com.fasterxml.jackson.databind.ObjectMapper |
mapper |
private ConcurrentHashMap<String,RecordPath> |
mappings |
private String |
type |
static PropertyDescriptor |
TYPE |
schemaAccessStrategy| Constructor and Description |
|---|
ElasticSearchLookupService() |
| Modifier and Type | Method and Description |
|---|---|
private Record |
applyMappings(Record record,
Map<String,Object> source) |
private Map<String,Object> |
buildQuery(Map<String,Object> coordinates) |
private Record |
getById(String _id,
Map<String,String> context) |
private Record |
getByQuery(Map<String,Object> query,
Map<String,String> context) |
(package private) Map<String,Object> |
getNested(String key,
Object value) |
Set<String> |
getRequiredKeys() |
PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String name) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
Class<?> |
getValueType() |
Optional<Record> |
lookup(Map<String,Object> coordinates) |
Optional<Record> |
lookup(Map<String,Object> coordinates,
Map<String,String> context) |
void |
onEnabled(ConfigurationContext context) |
private void |
validateCoordinates(Map coordinates) |
getDefaultSchemaAccessStrategy, getSchema, getSchemaAccessStrategybuildStrategyProperty, customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAccessStrategyValues, getSchemaAcessStrategyDescriptor, getSuppliedSchemaFields, storeSchemaAccessStrategyabstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitinitializegetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor CLIENT_SERVICE
public static final PropertyDescriptor INDEX
public static final PropertyDescriptor TYPE
private ElasticSearchClientService clientService
private String index
private String type
private com.fasterxml.jackson.databind.ObjectMapper mapper
private final List<PropertyDescriptor> DESCRIPTORS
private volatile ConcurrentHashMap<String,RecordPath> mappings
@OnEnabled public void onEnabled(ConfigurationContext context)
onEnabled in class JsonInferenceSchemaRegistryServiceprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class JsonInferenceSchemaRegistryServicepublic PropertyDescriptor getSupportedDynamicPropertyDescriptor(String name)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentpublic Optional<Record> lookup(Map<String,Object> coordinates) throws LookupFailureException
lookup in interface LookupService<Record>LookupFailureExceptionpublic Optional<Record> lookup(Map<String,Object> coordinates, Map<String,String> context) throws LookupFailureException
lookup in interface LookupService<Record>LookupFailureExceptionprivate void validateCoordinates(Map coordinates) throws LookupFailureException
LookupFailureExceptionprivate Record getById(String _id, Map<String,String> context) throws IOException, LookupFailureException, SchemaNotFoundException
private Record getByQuery(Map<String,Object> query, Map<String,String> context) throws LookupFailureException
LookupFailureExceptionpublic Class<?> getValueType()
getValueType in interface LookupService<Record>public Set<String> getRequiredKeys()
getRequiredKeys in interface LookupService<Record>Copyright © 2021 Apache NiFi Project. All rights reserved.