public static Map < String , String > getEnvironmentVariables ( String envPrefix , org . apache . flink . configuration . Configuration flinkConfiguration ) { Map < String , String > result = new HashMap <> ( ) ; for ( Map . Entry < String , String > entry : flinkConfiguration . toMap ( ) . entrySet ( ) ) { if ( entry . getKey ( ) . startsWith ( envPrefix ) && entry . getKey ( ) . length ( ) > envPrefix . length ( ) ) { // remove prefix String key = entry . getKey ( ) . substring ( envPrefix . length ( ) ) ; result . put ( key , entry . getValue ( ) ) ; } } return result ; }
Method to extract environment variables from the flinkConfiguration based on the given prefix String .