public int size() { return getPropertyKeys().size(); }
private List<String> getProvenanceRepositoryEncryptionKeyProperties() { // Filter all the property keys that define a key return getPropertyKeys().stream().filter(k -> k.startsWith(PROVENANCE_REPO_ENCRYPTION_KEY_ID + ".") || k.equalsIgnoreCase(PROVENANCE_REPO_ENCRYPTION_KEY) ).collect(Collectors.toList()); }
/** * Returns the complete set of property keys, including any protection keys (i.e. 'x.y.z.protected'). * * @return the set of property keys */ Set<String> getPropertyKeysIncludingProtectionSchemes() { return getInternalNiFiProperties().getPropertyKeys(); }
public List<Path> getNarLibraryDirectories() { List<Path> narLibraryPaths = new ArrayList<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a nar library path if (StringUtils.startsWith(propertyName, NAR_LIBRARY_DIRECTORY_PREFIX) || NAR_LIBRARY_DIRECTORY.equals(propertyName) || NAR_LIBRARY_AUTOLOAD_DIRECTORY.equals(propertyName)) { // attempt to resolve the path specified String narLib = getProperty(propertyName); if (!StringUtils.isBlank(narLib)) { narLibraryPaths.add(Paths.get(narLib)); } } } if (narLibraryPaths.isEmpty()) { narLibraryPaths.add(Paths.get(DEFAULT_NAR_LIBRARY_DIR)); } return narLibraryPaths; }
/** * Returns the provenance repository paths. This method returns a mapping of * file repository name to file repository paths. It simply returns the * values configured. No directories will be created as a result of this * operation. * * @return the name and paths of all provenance repository locations */ public Map<String, Path> getProvenanceRepositoryPaths() { final Map<String, Path> provenanceRepositoryPaths = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a file repository path if (StringUtils.startsWith(propertyName, PROVENANCE_REPO_DIRECTORY_PREFIX)) { // get the repository key final String key = StringUtils.substringAfter(propertyName, PROVENANCE_REPO_DIRECTORY_PREFIX); // attempt to resolve the path specified provenanceRepositoryPaths.put(key, Paths.get(getProperty(propertyName))); } } return provenanceRepositoryPaths; }
/** * Returns the network interface list to use for HTTP. This method returns a mapping of * network interface property names to network interface names. * * @return the property name and network interface name of all HTTP network interfaces */ public Map<String, String> getHttpNetworkInterfaces() { final Map<String, String> networkInterfaces = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a network interface name if (StringUtils.startsWith(propertyName, WEB_HTTP_NETWORK_INTERFACE_PREFIX)) { // get the network interface property key final String key = StringUtils.substringAfter(propertyName, WEB_HTTP_NETWORK_INTERFACE_PREFIX); networkInterfaces.put(key, getProperty(propertyName)); } } return networkInterfaces; }
/** * Returns the content repository paths. This method returns a mapping of * file repository name to file repository paths. It simply returns the * values configured. No directories will be created as a result of this * operation. * * @return file repositories paths * @throws InvalidPathException If any of the configured paths are invalid */ public Map<String, Path> getContentRepositoryPaths() { final Map<String, Path> contentRepositoryPaths = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a file repository path if (StringUtils.startsWith(propertyName, REPOSITORY_CONTENT_PREFIX)) { // get the repository key final String key = StringUtils.substringAfter(propertyName, REPOSITORY_CONTENT_PREFIX); // attempt to resolve the path specified contentRepositoryPaths.put(key, Paths.get(getProperty(propertyName))); } } return contentRepositoryPaths; }
/** * Returns the network interface list to use for HTTPS. This method returns a mapping of * network interface property names to network interface names. * * @return the property name and network interface name of all HTTPS network interfaces */ public Map<String, String> getHttpsNetworkInterfaces() { final Map<String, String> networkInterfaces = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a network interface name if (StringUtils.startsWith(propertyName, WEB_HTTPS_NETWORK_INTERFACE_PREFIX)) { // get the network interface property key final String key = StringUtils.substringAfter(propertyName, WEB_HTTPS_NETWORK_INTERFACE_PREFIX); networkInterfaces.put(key, getProperty(propertyName)); } } return networkInterfaces; }
for (String propertyName : properties.getPropertyKeys()) { if (StringUtils.startsWith(propertyName, patternPrefix)) { final String key = StringUtils.substringAfter(propertyName, patternPrefix);
public WriteAheadFlowFileRepository(final NiFiProperties nifiProperties) { alwaysSync = Boolean.parseBoolean(nifiProperties.getProperty(NiFiProperties.FLOWFILE_REPOSITORY_ALWAYS_SYNC, "false")); this.nifiProperties = nifiProperties; // determine the database file path and ensure it exists String writeAheadLogImpl = nifiProperties.getProperty(WRITE_AHEAD_LOG_IMPL); if (writeAheadLogImpl == null) { writeAheadLogImpl = DEFAULT_WAL_IMPLEMENTATION; } this.walImplementation = writeAheadLogImpl; // We used to use one implementation of the write-ahead log, but we now want to use the other, we must address this. Since the // MinimalLockingWriteAheadLog supports multiple partitions, we need to ensure that we recover records from all // partitions, so we build up a List of Files for the recovery files. for (final String propertyName : nifiProperties.getPropertyKeys()) { if (propertyName.startsWith(FLOWFILE_REPOSITORY_DIRECTORY_PREFIX)) { final String dirName = nifiProperties.getProperty(propertyName); recoveryFiles.add(new File(dirName)); } } if (walImplementation.equals(SEQUENTIAL_ACCESS_WAL)) { final String directoryName = nifiProperties.getProperty(FLOWFILE_REPOSITORY_DIRECTORY_PREFIX); flowFileRepositoryPaths.add(new File(directoryName)); } else { flowFileRepositoryPaths.addAll(recoveryFiles); } numPartitions = nifiProperties.getFlowFileRepositoryPartitions(); checkpointDelayMillis = FormatUtils.getTimeDuration(nifiProperties.getFlowFileRepositoryCheckpointInterval(), TimeUnit.MILLISECONDS); checkpointExecutor = Executors.newSingleThreadScheduledExecutor(); }
public PeerDescriptionModifier(final NiFiProperties properties) { final Map<Tuple<String, String>, List<Tuple<String, String>>> routeDefinitions = properties.getPropertyKeys().stream() .filter(propertyKey -> propertyKey.startsWith(PROPERTY_PREFIX)) .map(propertyKey -> {
public int size() { return getPropertyKeys().size(); }
private List<String> getProvenanceRepositoryEncryptionKeyProperties() { // Filter all the property keys that define a key return getPropertyKeys().stream().filter(k -> k.startsWith(PROVENANCE_REPO_ENCRYPTION_KEY_ID + ".") || k.equalsIgnoreCase(PROVENANCE_REPO_ENCRYPTION_KEY) ).collect(Collectors.toList()); }
/** * Returns the complete set of property keys, including any protection keys (i.e. 'x.y.z.protected'). * * @return the set of property keys */ Set<String> getPropertyKeysIncludingProtectionSchemes() { return getInternalNiFiProperties().getPropertyKeys(); }
public List<Path> getNarLibraryDirectories() { List<Path> narLibraryPaths = new ArrayList<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a nar library path if (StringUtils.startsWith(propertyName, NAR_LIBRARY_DIRECTORY_PREFIX) || NAR_LIBRARY_DIRECTORY.equals(propertyName)) { // attempt to resolve the path specified String narLib = getProperty(propertyName); if (!StringUtils.isBlank(narLib)) { narLibraryPaths.add(Paths.get(narLib)); } } } if (narLibraryPaths.isEmpty()) { narLibraryPaths.add(Paths.get(DEFAULT_NAR_LIBRARY_DIR)); } return narLibraryPaths; }
/** * Returns the provenance repository paths. This method returns a mapping of * file repository name to file repository paths. It simply returns the * values configured. No directories will be created as a result of this * operation. * * @return the name and paths of all provenance repository locations */ public Map<String, Path> getProvenanceRepositoryPaths() { final Map<String, Path> provenanceRepositoryPaths = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a file repository path if (StringUtils.startsWith(propertyName, PROVENANCE_REPO_DIRECTORY_PREFIX)) { // get the repository key final String key = StringUtils.substringAfter(propertyName, PROVENANCE_REPO_DIRECTORY_PREFIX); // attempt to resolve the path specified provenanceRepositoryPaths.put(key, Paths.get(getProperty(propertyName))); } } return provenanceRepositoryPaths; }
/** * Returns the content repository paths. This method returns a mapping of * file repository name to file repository paths. It simply returns the * values configured. No directories will be created as a result of this * operation. * * @return file repositories paths * @throws InvalidPathException If any of the configured paths are invalid */ public Map<String, Path> getContentRepositoryPaths() { final Map<String, Path> contentRepositoryPaths = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a file repository path if (StringUtils.startsWith(propertyName, REPOSITORY_CONTENT_PREFIX)) { // get the repository key final String key = StringUtils.substringAfter(propertyName, REPOSITORY_CONTENT_PREFIX); // attempt to resolve the path specified contentRepositoryPaths.put(key, Paths.get(getProperty(propertyName))); } } return contentRepositoryPaths; }
/** * Returns the network interface list to use for HTTPS. This method returns a mapping of * network interface property names to network interface names. * * @return the property name and network interface name of all HTTPS network interfaces */ public Map<String, String> getHttpsNetworkInterfaces() { final Map<String, String> networkInterfaces = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a network interface name if (StringUtils.startsWith(propertyName, WEB_HTTPS_NETWORK_INTERFACE_PREFIX)) { // get the network interface property key final String key = StringUtils.substringAfter(propertyName, WEB_HTTPS_NETWORK_INTERFACE_PREFIX); networkInterfaces.put(key, getProperty(propertyName)); } } return networkInterfaces; }
/** * Returns the network interface list to use for HTTP. This method returns a mapping of * network interface property names to network interface names. * * @return the property name and network interface name of all HTTP network interfaces */ public Map<String, String> getHttpNetworkInterfaces() { final Map<String, String> networkInterfaces = new HashMap<>(); // go through each property for (String propertyName : getPropertyKeys()) { // determine if the property is a network interface name if (StringUtils.startsWith(propertyName, WEB_HTTP_NETWORK_INTERFACE_PREFIX)) { // get the network interface property key final String key = StringUtils.substringAfter(propertyName, WEB_HTTP_NETWORK_INTERFACE_PREFIX); networkInterfaces.put(key, getProperty(propertyName)); } } return networkInterfaces; }
public PeerDescriptionModifier(final NiFiProperties properties) { final Map<Tuple<String, String>, List<Tuple<String, String>>> routeDefinitions = properties.getPropertyKeys().stream() .filter(propertyKey -> propertyKey.startsWith(PROPERTY_PREFIX)) .map(propertyKey -> {