[ https://issues.apache.org/jira/browse/FLINK-10046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16579643#comment-16579643 ]
ASF GitHub Bot commented on FLINK-10046: ---------------------------------------- zentol commented on a change in pull request #6552: [FLINK-10046] [Startup Shell Scripts] .bat script to start a Flink service as a console application URL: https://github.com/apache/flink/pull/6552#discussion_r209908074 ########## File path: flink-dist/src/main/flink-bin/bin/flink-console.bat ########## @@ -0,0 +1,87 @@ +::############################################################################### +:: 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. +::############################################################################### + +@echo off +rem Start a Flink service as a console application. + +setlocal + +rem Get first argument +SET SERVICE=%1 +rem Get remaining arguments +SET _all=%* +IF NOT "%~2"=="" ( + CALL SET ARGS=%%_all:*%1=%% +) ELSE ( + SET ARGS= +) + +SET bin=%~dp0 +SET FLINK_ROOT_DIR=%bin%.. +SET FLINK_LIB_DIR=%FLINK_ROOT_DIR%\lib +SET FLINK_CLASSPATH=%FLINK_LIB_DIR%\* +SET FLINK_CONF_DIR=%FLINK_ROOT_DIR%\conf +SET FLINK_LOG_DIR=%FLINK_ROOT_DIR%\log +SET JVM_ARGS=-Xms1024m -Xmx1024m + +SET logname_tm=flink-%username%-taskmanager.log +SET log_tm=%FLINK_LOG_DIR%\%logname_tm% +SET outname_tm=flink-%username%-taskmanager.out +SET out_tm=%FLINK_LOG_DIR%\%outname_tm% +SET log_setting_tm=-Dlog.file="%log_tm%" -Dlogback.configurationFile=file:"%FLINK_CONF_DIR%\logback.xml" -Dlog4j.configuration=file:"%FLINK_CONF_DIR%\log4j.properties" + +:: Log rotation (quick and dirty) +CD "%FLINK_LOG_DIR%" +for /l %%x in (5, -1, 1) do ( +SET /A y = %%x+1 +RENAME "%logname_jm%.%%x" "%logname_jm%.!y!" 2> nul +RENAME "%logname_tm%.%%x" "%logname_tm%.!y!" 2> nul +RENAME "%outname_jm%.%%x" "%outname_jm%.!y!" 2> nul +RENAME "%outname_tm%.%%x" "%outname_tm%.!y!" 2> nul +) +RENAME "%logname_jm%" "%logname_jm%.0" 2> nul +RENAME "%logname_tm%" "%logname_tm%.0" 2> nul +RENAME "%outname_jm%" "%outname_jm%.0" 2> nul +RENAME "%outname_tm%" "%outname_tm%.0" 2> nul +DEL "%logname_jm%.6" 2> nul +DEL "%logname_tm%.6" 2> nul +DEL "%outname_jm%.6" 2> nul +DEL "%outname_tm%.6" 2> nul + +IF "%SERVICE%"=="jobmanager" ( Review comment: input validation should always be done first to fail early. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > .bat script to start a Flink service as a console application > ------------------------------------------------------------- > > Key: FLINK-10046 > URL: https://issues.apache.org/jira/browse/FLINK-10046 > Project: Flink > Issue Type: Sub-task > Components: Startup Shell Scripts > Reporter: Pavel Shvetsov > Assignee: Pavel Shvetsov > Priority: Major > Labels: pull-request-available > Original Estimate: 72h > Remaining Estimate: 72h > > Create .bat script to start a Flink service as a console application on > Windows -- This message was sent by Atlassian JIRA (v7.6.3#76005)