[ https://issues.apache.org/jira/browse/TWILL-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15549812#comment-15549812 ]
ASF GitHub Bot commented on TWILL-195: -------------------------------------- Github user chtyim commented on a diff in the pull request: https://github.com/apache/twill/pull/13#discussion_r82059853 --- Diff: twill-core/src/main/java/org/apache/twill/internal/TwillRuntimeSpecification.java --- @@ -0,0 +1,94 @@ +/* + * 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.twill.internal; + +import org.apache.twill.api.RunId; +import org.apache.twill.api.TwillApplication; +import org.apache.twill.api.TwillSpecification; +import org.apache.twill.api.logging.LogEntry; + +import java.net.URI; +import javax.annotation.Nullable; + +/** + * Represents runtime specification of a {@link TwillApplication}. + */ +public class TwillRuntimeSpecification { + + private final TwillSpecification twillSpecification; + + private final String fsUser; + private final URI twillAppDir; + private final String zkConnectStr; + private final RunId twillRunId; + private final String twillAppName; + private final int reservedMemory; + private final String rmSchedulerAddr; + private final LogEntry.Level logLevel; + + public TwillRuntimeSpecification(TwillSpecification twillSpecification, @Nullable String fsUser, URI twillAppDir, + String zkConnectStr, RunId twillRunId, String twillAppName, + int reservedMemory, @Nullable String rmSchedulerAddr, + @Nullable LogEntry.Level logLevel) { + this.twillSpecification = twillSpecification; + this.fsUser = fsUser; + this.twillAppDir = twillAppDir; + this.zkConnectStr = zkConnectStr; + this.twillRunId = twillRunId; + this.twillAppName = twillAppName; + this.reservedMemory = reservedMemory; + this.rmSchedulerAddr = rmSchedulerAddr; + this.logLevel = logLevel; + } + + public TwillSpecification getTwillSpecification() { + return twillSpecification; + } + + public String getFsUser() { + return fsUser; + } + + public URI getTwillAppDir() { + return twillAppDir; + } + + public String getZkConnectStr() { + return zkConnectStr; + } + + public RunId getTwillRunId() { + return twillRunId; + } + + public String getTwillAppName() { + return twillAppName; + } + + public int getReservedMemory() { + return reservedMemory; + } + + public String getRmSchedulerAddr() { --- End diff -- For those that can be null, annotate the method with `@Nullable` as well. > Add TwillRuntimeSpecification for twill application > --------------------------------------------------- > > Key: TWILL-195 > URL: https://issues.apache.org/jira/browse/TWILL-195 > Project: Apache Twill > Issue Type: Improvement > Components: core > Reporter: Yaojie Feng > > Now we have RuntimeSpecification for twill runnable. We should also have a > TwillRuntimeSpecification to pass runtime requirements for twill applications. -- This message was sent by Atlassian JIRA (v6.3.4#6332)