[ https://issues.apache.org/jira/browse/MINIFI-277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15988873#comment-15988873 ]
ASF GitHub Bot commented on MINIFI-277: --------------------------------------- Github user brosander commented on a diff in the pull request: https://github.com/apache/nifi-minifi/pull/80#discussion_r113939300 --- Diff: minifi-commons/minifi-commons-schema/src/main/java/org/apache/nifi/minifi/commons/schema/v2/CorePropertiesSchemaV2.java --- @@ -0,0 +1,95 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.minifi.commons.schema.v2; + +import static org.apache.nifi.minifi.commons.schema.common.CommonPropertyKeys.CORE_PROPS_KEY; +import static org.apache.nifi.minifi.commons.schema.common.CommonPropertyKeys.MAX_CONCURRENT_THREADS_KEY; + +import java.util.Map; + +import org.apache.nifi.minifi.commons.schema.common.BaseSchema; +import org.apache.nifi.minifi.commons.schema.common.WritableSchema; + +/** + * + */ +public class CorePropertiesSchemaV2 extends BaseSchema implements WritableSchema { + + public static final String FLOW_CONTROLLER_SHUTDOWN_PERIOD_KEY = "flow controller graceful shutdown period"; + public static final String FLOW_SERVICE_WRITE_DELAY_INTERVAL_KEY = "flow service write delay interval"; + public static final String ADMINISTRATIVE_YIELD_DURATION_KEY = "administrative yield duration"; + public static final String BORED_YIELD_DURATION_KEY = "bored yield duration"; + + public static final String DEFAULT_FLOW_CONTROLLER_GRACEFUL_SHUTDOWN_PERIOD = "10 sec"; + public static final String DEFAULT_FLOW_SERVICE_WRITE_DELAY_INTERVAL = "500 ms"; + public static final String DEFAULT_ADMINISTRATIVE_YIELD_DURATION = "30 sec"; + public static final String DEFAULT_BORED_YIELD_DURATION = "10 millis"; + public static final int DEFAULT_MAX_CONCURRENT_THREADS = 1; + + private String flowControllerGracefulShutdownPeriod = DEFAULT_FLOW_CONTROLLER_GRACEFUL_SHUTDOWN_PERIOD; + private String flowServiceWriteDelayInterval = DEFAULT_FLOW_SERVICE_WRITE_DELAY_INTERVAL; + private String administrativeYieldDuration = DEFAULT_ADMINISTRATIVE_YIELD_DURATION; + private String boredYieldDuration = DEFAULT_BORED_YIELD_DURATION; + private Number maxConcurrentThreads = DEFAULT_MAX_CONCURRENT_THREADS; + + public CorePropertiesSchemaV2() { + } + + public CorePropertiesSchemaV2(Map map) { + flowControllerGracefulShutdownPeriod = getOptionalKeyAsType(map, FLOW_CONTROLLER_SHUTDOWN_PERIOD_KEY, String.class, + CORE_PROPS_KEY, DEFAULT_FLOW_CONTROLLER_GRACEFUL_SHUTDOWN_PERIOD); + flowServiceWriteDelayInterval = getOptionalKeyAsType(map, FLOW_SERVICE_WRITE_DELAY_INTERVAL_KEY, String.class, + CORE_PROPS_KEY, DEFAULT_FLOW_SERVICE_WRITE_DELAY_INTERVAL); + administrativeYieldDuration = getOptionalKeyAsType(map, ADMINISTRATIVE_YIELD_DURATION_KEY, String.class, + CORE_PROPS_KEY, DEFAULT_ADMINISTRATIVE_YIELD_DURATION); + boredYieldDuration = getOptionalKeyAsType(map, BORED_YIELD_DURATION_KEY, String.class, CORE_PROPS_KEY, DEFAULT_BORED_YIELD_DURATION); + maxConcurrentThreads = getOptionalKeyAsType(map, MAX_CONCURRENT_THREADS_KEY, Number.class, + CORE_PROPS_KEY, DEFAULT_MAX_CONCURRENT_THREADS); + } + + @Override + public Map<String, Object> toMap() { --- End diff -- Then in ConfigSchemaV2, you'd want something like ``` putIfNotNull(result, CORE_PROPS_KEY, coreProperties.convert()); ``` > Write nifi.variable.registry.properties to nifi.properties > ---------------------------------------------------------- > > Key: MINIFI-277 > URL: https://issues.apache.org/jira/browse/MINIFI-277 > Project: Apache NiFi MiNiFi > Issue Type: Task > Affects Versions: 0.1.0 > Reporter: Jeff Zemerick > Assignee: Jeff Zemerick > > When MiNiFi writes the nifi.properties the > "nifi.variable.registry.properties" is not written to the file. -- This message was sent by Atlassian JIRA (v6.3.15#6346)