@Tags(value={"lookup","cache","enrich","join","rdbms","database","reloadable","key","value","record"}) @CapabilityDescription(value="A relational-database-based lookup service. When the lookup key is found in the database, the specified columns (or all if Lookup Value Columns are not specified) are returned as a Record. Only one row will be returned for each lookup, duplicate database entries are ignored.") public class DatabaseRecordLookupService extends AbstractDatabaseLookupService implements RecordLookupService
| Modifier and Type | Field and Description |
|---|---|
private com.github.benmanes.caffeine.cache.Cache<Tuple<String,Object>,Record> |
cache |
(package private) static PropertyDescriptor |
LOOKUP_VALUE_COLUMNS |
CACHE_EXPIRATION, CACHE_SIZE, CLEAR_CACHE_ON_ENABLED, DBCP_SERVICE, dbcpService, KEY, LOOKUP_KEY_COLUMN, lookupKeyColumn, properties, REQUIRED_KEYS, TABLE_NAME| Constructor and Description |
|---|
DatabaseRecordLookupService() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getRequiredKeys() |
protected void |
init(ControllerServiceInitializationContext context) |
private static boolean |
isNotBlank(String value) |
Optional<Record> |
lookup(Map<String,Object> coordinates) |
Optional<Record> |
lookup(Map<String,Object> coordinates,
Map<String,String> context) |
void |
onEnabled(ConfigurationContext context) |
getSupportedPropertyDescriptorsabstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, initialize, isEnabledcustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetValueTypeinitialize, isStatefulgetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final PropertyDescriptor LOOKUP_VALUE_COLUMNS
protected void init(ControllerServiceInitializationContext context)
init in class AbstractControllerService@OnEnabled public void onEnabled(ConfigurationContext context)
public 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 static boolean isNotBlank(String value)
public Set<String> getRequiredKeys()
getRequiredKeys in interface LookupService<Record>Copyright © 2022 Apache NiFi Project. All rights reserved.