Skip to main content

ListBoxFile

Description

Lists files in a Box folder. Each listed file may result in one FlowFile, the metadata being written as FlowFile attributes. Or - in case the 'Record Writer' property is set - the entire result is written as records to a single FlowFile. This Processor is designed to run on Primary Node only in a cluster. If the primary node changes, the new Primary Node will pick up where the previous node left off without duplicating all of the data.

Tags

box, storage

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Box Client Service *box-client-serviceController Service:
BoxClientService

Implementations:
JsonConfigBasedBoxClientService
Controller Service used to obtain a Box API connection.
Folder ID *box-folder-idThe ID of the folder from which to pull list of files.

Supports Expression Language, using Environment variables.
Search Recursively *recursive-searchtrue
  • true
  • false
When 'true', will include list of files from sub-folders. Otherwise, will return only files that are within the folder defined by the 'Folder ID' property.
Minimum File Age *min-age0 secThe minimum age a file must be in order to be considered; any files younger than this will be ignored.
Listing Strategy *listing-strategyTracking Timestamps
  • Tracking Timestamps
  • Tracking Entities
  • Time Window
  • No Tracking
Specify how to determine new/updated entities. See each strategy descriptions for detail.
Entity Tracking State Cacheet-state-cacheController Service:
DistributedMapCacheClient

Implementations:
HazelcastMapCacheClient
MapCacheClientService
RedisDistributedMapCacheClientService
SimpleRedisDistributedMapCacheClientService
Listed entities are stored in the specified cache storage so that this processor can resume listing across NiFi restart or in case of primary node change. 'Tracking Entities' strategy require tracking information of all listed entities within the last 'Tracking Time Window'. To support large number of entities, the strategy uses DistributedMapCache instead of managed state. Cache key format is 'ListedEntities::{processorId}(::{nodeId})'. If it tracks per node listed entities, then the optional '::{nodeId}' part is added to manage state separately. E.g. cluster wide cache key = 'ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b', per node cache key = 'ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b::nifi-node3' The stored cache content is Gzipped JSON string. The cache key will be deleted when target listing configuration is changed. Used by 'Tracking Entities' strategy.

This property is only considered if:
  • the property Listing Strategy has a value of entities
Entity Tracking Time Windowet-time-window3 hoursSpecify how long this processor should track already-listed entities. 'Tracking Entities' strategy can pick any entity whose timestamp is inside the specified time window. For example, if set to '30 minutes', any entity having timestamp in recent 30 minutes will be the listing target when this processor runs. A listed entity is considered 'new/updated' and a FlowFile is emitted if one of following condition meets: 1. does not exist in the already-listed entities, 2. has newer timestamp than the cached entity, 3. has different size than the cached entity. If a cached entity's timestamp becomes older than specified time window, that entity will be removed from the cached already-listed entities. Used by 'Tracking Entities' strategy.

Supports Expression Language, using Environment variables.

This property is only considered if:
  • the property Listing Strategy has a value of entities
Entity Tracking Initial Listing Targetet-initial-listing-targetAll Available
  • Tracking Time Window
  • All Available
Specify how initial listing should be handled. Used by 'Tracking Entities' strategy.

This property is only considered if:
  • the property Listing Strategy has a value of entities
Record Writerrecord-writerController Service:
RecordSetWriterFactory

Implementations:
AvroRecordSetWriter
CSVRecordSetWriter
FreeFormTextRecordSetWriter
JsonRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
Specifies the Record Writer to use for creating the listing. If not specified, one FlowFile will be created for each entity that is listed. If the Record Writer is specified, all entities will be written to a single FlowFile instead of adding attributes to individual FlowFiles.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
successAll FlowFiles that are received are routed to success

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
box.idThe id of the file
box.sizeThe size of the file
box.timestampThe last modified time of the file
filenameThe name of the file
pathThe folder path where the file is located

State Management

ScopeDescription
CLUSTERThe processor stores necessary data to be able to keep track what files have been listed already. What exactly needs to be stored depends on the 'Listing Strategy'.

Restricted

This component is not restricted.

Input Requirement

This component does not allow an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also

FetchBoxFile, PutBoxFile