public class ListedEntityTracker<T extends ListableEntity> extends Object
| Modifier and Type | Field and Description |
|---|---|
private Map<String,ListedEntity> |
alreadyListedEntities |
private static String |
CACHE_KEY_PREFIX |
private String |
componentId |
private Supplier<Long> |
currentTimestampSupplier |
(package private) static Supplier<Long> |
DEFAULT_CURRENT_TIMESTAMP_SUPPLIER |
static PropertyDescriptor |
INITIAL_LISTING_TARGET |
private static AllowableValue |
INITIAL_LISTING_TARGET_ALL |
private static AllowableValue |
INITIAL_LISTING_TARGET_WINDOW |
private Deserializer<Map<String,ListedEntity>> |
listedEntitiesDeserializer |
private Serializer<Map<String,ListedEntity>> |
listedEntitiesSerializer |
private ComponentLog |
logger |
private DistributedMapCacheClient |
mapCacheClient |
static PropertyDescriptor |
NODE_IDENTIFIER |
private String |
nodeId |
private static String |
NOTE |
private com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
private Scope |
scope |
private Serializer<String> |
stringSerializer |
static PropertyDescriptor |
TRACKING_STATE_CACHE |
static PropertyDescriptor |
TRACKING_TIME_WINDOW |
| Constructor and Description |
|---|
ListedEntityTracker(String componentId,
ComponentLog logger) |
ListedEntityTracker(String componentId,
ComponentLog logger,
Supplier<Long> currentTimestampSupplier)
This constructor is used by unit test code so that it can produce the consistent result by controlling current timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
clearListedEntities() |
private Map<String,ListedEntity> |
fetchListedEntities() |
private String |
getCacheKey() |
private void |
persistListedEntities(Map<String,ListedEntity> listedEntities) |
void |
trackEntities(ProcessContext context,
ProcessSession session,
boolean justElectedPrimaryNode,
Scope scope,
Function<Long,Collection<T>> listEntities,
Function<T,Map<String,String>> createAttributes) |
(package private) static void |
validateProperties(ValidationContext context,
Collection<ValidationResult> results,
Scope scope) |
private static void |
validateRequiredProperty(ValidationContext context,
Collection<ValidationResult> results,
PropertyDescriptor property) |
private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
private volatile Map<String,ListedEntity> alreadyListedEntities
private static final String NOTE
public static final PropertyDescriptor TRACKING_STATE_CACHE
public static final PropertyDescriptor TRACKING_TIME_WINDOW
private static final AllowableValue INITIAL_LISTING_TARGET_ALL
private static final AllowableValue INITIAL_LISTING_TARGET_WINDOW
public static final PropertyDescriptor INITIAL_LISTING_TARGET
public static final PropertyDescriptor NODE_IDENTIFIER
private final Serializer<String> stringSerializer
private final Serializer<Map<String,ListedEntity>> listedEntitiesSerializer
private final Deserializer<Map<String,ListedEntity>> listedEntitiesDeserializer
private final String componentId
private final ComponentLog logger
private Scope scope
private String nodeId
private DistributedMapCacheClient mapCacheClient
private static final String CACHE_KEY_PREFIX
ListedEntityTracker(String componentId, ComponentLog logger)
ListedEntityTracker(String componentId, ComponentLog logger, Supplier<Long> currentTimestampSupplier)
currentTimestampSupplier - a function to return current timestamp.static void validateProperties(ValidationContext context, Collection<ValidationResult> results, Scope scope)
private static void validateRequiredProperty(ValidationContext context, Collection<ValidationResult> results, PropertyDescriptor property)
private String getCacheKey()
private void persistListedEntities(Map<String,ListedEntity> listedEntities) throws IOException
IOExceptionprivate Map<String,ListedEntity> fetchListedEntities() throws IOException
IOExceptionvoid clearListedEntities()
throws IOException
IOExceptionpublic void trackEntities(ProcessContext context, ProcessSession session, boolean justElectedPrimaryNode, Scope scope, Function<Long,Collection<T>> listEntities, Function<T,Map<String,String>> createAttributes) throws ProcessException
ProcessExceptionCopyright © 2019 Apache NiFi Project. All rights reserved.