@Tags(value={"lookup","cache","enrich","join","csv","reloadable","key","value","record"}) @CapabilityDescription(value="A reloadable CSV file-based lookup service. When the lookup key is found in the CSV file, the columns are returned as a Record. All returned fields will be strings. The first line of the csv file is considered as header.") public class CSVRecordLookupService extends AbstractCSVLookupService implements RecordLookupService
| Modifier and Type | Field and Description |
|---|---|
private ConcurrentMap<String,Record> |
cache |
(package private) static PropertyDescriptor |
CSV_FORMAT |
private static Set<String> |
REQUIRED_KEYS |
charset, CHARSET, CSV_FILE, csvFile, csvFormat, DEFAULT, IGNORE_DUPLICATES, ignoreDuplicates, KEY, lock, LOOKUP_KEY_COLUMN, lookupKeyColumn, properties, RFC4180, watcher| Constructor and Description |
|---|
CSVRecordLookupService() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getRequiredKeys() |
(package private) boolean |
isCaching() |
protected void |
loadCache() |
Optional<Record> |
lookup(Map<String,Object> coordinates) |
void |
onDisabled() |
void |
onEnabled(ConfigurationContext context) |
getSupportedPropertyDescriptors, initabstractClearConfigContext, 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, waitgetValueTypelookupinitialize, isStatefulgetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final PropertyDescriptor CSV_FORMAT
private volatile ConcurrentMap<String,Record> cache
protected void loadCache()
throws IllegalStateException,
IOException
loadCache in class AbstractCSVLookupServiceIllegalStateExceptionIOException@OnEnabled public void onEnabled(ConfigurationContext context) throws InitializationException, IOException
onEnabled in class AbstractCSVLookupServiceInitializationExceptionIOExceptionpublic Optional<Record> lookup(Map<String,Object> coordinates) throws LookupFailureException
lookup in interface LookupService<Record>LookupFailureExceptionpublic Set<String> getRequiredKeys()
getRequiredKeys in interface LookupService<Record>@OnDisabled public void onDisabled()
boolean isCaching()
Copyright © 2022 Apache NiFi Project. All rights reserved.