@Tags(value={"lookup","cache","enrich","join","csv","reloadable","key","value"}) @CapabilityDescription(value="A reloadable CSV file-based lookup service") public class SimpleCsvFileLookupService extends AbstractControllerService implements StringLookupService
| Modifier and Type | Field and Description |
|---|---|
private ConcurrentMap<String,String> |
cache |
private String |
charset |
static PropertyDescriptor |
CHARSET |
static PropertyDescriptor |
CSV_FILE |
(package private) static PropertyDescriptor |
CSV_FORMAT |
private String |
csvFile |
private org.apache.commons.csv.CSVFormat |
csvFormat |
static PropertyDescriptor |
IGNORE_DUPLICATES |
private boolean |
ignoreDuplicates |
private static String |
KEY |
private ReentrantLock |
lock |
static PropertyDescriptor |
LOOKUP_KEY_COLUMN |
static PropertyDescriptor |
LOOKUP_VALUE_COLUMN |
private String |
lookupKeyColumn |
private String |
lookupValueColumn |
private List<PropertyDescriptor> |
properties |
private static Set<String> |
REQUIRED_KEYS |
private SynchronousFileWatcher |
watcher |
| Constructor and Description |
|---|
SimpleCsvFileLookupService() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getRequiredKeys() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ControllerServiceInitializationContext context) |
private void |
loadCache() |
Optional<String> |
lookup(Map<String,Object> coordinates) |
void |
onEnabled(ConfigurationContext context) |
abstractClearConfigContext, 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, waitgetValueTypelookupinitializegetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprivate static final String KEY
public static final PropertyDescriptor CSV_FILE
static final PropertyDescriptor CSV_FORMAT
public static final PropertyDescriptor CHARSET
public static final PropertyDescriptor LOOKUP_KEY_COLUMN
public static final PropertyDescriptor LOOKUP_VALUE_COLUMN
public static final PropertyDescriptor IGNORE_DUPLICATES
private List<PropertyDescriptor> properties
private volatile ConcurrentMap<String,String> cache
private volatile String csvFile
private volatile org.apache.commons.csv.CSVFormat csvFormat
private volatile String charset
private volatile String lookupKeyColumn
private volatile String lookupValueColumn
private volatile boolean ignoreDuplicates
private volatile SynchronousFileWatcher watcher
private final ReentrantLock lock
private void loadCache()
throws IllegalStateException,
IOException
IllegalStateExceptionIOExceptionprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentprotected void init(ControllerServiceInitializationContext context) throws InitializationException
init in class AbstractControllerServiceInitializationException@OnEnabled public void onEnabled(ConfigurationContext context) throws InitializationException, IOException, FileNotFoundException
public Optional<String> lookup(Map<String,Object> coordinates) throws LookupFailureException
lookup in interface LookupService<String>LookupFailureExceptionpublic Set<String> getRequiredKeys()
getRequiredKeys in interface LookupService<String>Copyright © 2020 Apache NiFi Project. All rights reserved.