private static String extractTagSource ( Map < String , String > tag_map ) { return Optional . ofNullable ( tag_map . remove ( "source" ) ) . orElseGet ( ( ) -> { return Optional . ofNullable ( tag_map . get ( "cluster" ) ) . map ( WavefrontStrings :: escapeTagValue ) . orElseGet ( ( ) -> tag_map . getOrDefault ( "moncluster" , "monsoon" ) ) ; } ) ; }
Extract the source tag from the tag_map .