Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-16871][Runtime] Make more build time information available at …
…runtime
- Loading branch information
1 parent
e789bb7
commit d215e4d
Showing
7 changed files
with
206 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
flink-runtime/src/main/code-gen/version/Version.java.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* 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.flink.version; | ||
|
||
import java.time.Instant; | ||
import java.time.ZoneId; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public final class Version { | ||
public static final String PROJECT_VERSION = "@project.version@"; | ||
public static final String SCALA_VERSION = "@scala.version@"; | ||
public static final Instant GIT_BUILD_TIME; | ||
public static final String GIT_BUILD_TIME_STR; | ||
public static final String GIT_COMMIT_ID = "@git.commit.id@"; | ||
public static final String GIT_COMMIT_ID_ABBREV = "@git.commit.id.abbrev@"; | ||
public static final Instant GIT_COMMIT_TIME; | ||
public static final String GIT_COMMIT_TIME_STR; | ||
public static final boolean GIT_DIRTY = Boolean.parseBoolean("@git.dirty@"); | ||
|
||
static { | ||
// This is to reliably parse the datetime format configured in the git-commit-id-plugin | ||
DateTimeFormatter GIT_DATE_TIME = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ"); | ||
GIT_BUILD_TIME = GIT_DATE_TIME.parse("@git.build.time@", Instant::from); | ||
GIT_COMMIT_TIME = GIT_DATE_TIME.parse("@git.commit.time@", Instant::from); | ||
|
||
// Default format is in Berlin timezone because that is where Flink originated. | ||
DateTimeFormatter BERLIN_DATE_TIME = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Europe/Berlin")); | ||
GIT_BUILD_TIME_STR = BERLIN_DATE_TIME.format(GIT_BUILD_TIME); | ||
GIT_COMMIT_TIME_STR = BERLIN_DATE_TIME.format(GIT_COMMIT_TIME); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters