protected String toTagParameterArray ( Map < String , String > tags ) throws UnsupportedEncodingException { if ( tags == null || tags . isEmpty ( ) ) { return "" ; } StringBuilder sb = new StringBuilder ( encode ( "{" , "UTF-8" ) ) ; for ( Map . Entry < String , String > tagEntry : tags . entrySet ( ) ) { sb . append ( tagEntry . getKey ( ) ) . append ( "=" ) ; String tagV = tagEntry . getValue ( ) . replaceAll ( "\\|" , encode ( "|" , "UTF-8" ) ) ; sb . append ( tagV ) . append ( "," ) ; } sb . replace ( sb . length ( ) - 1 , sb . length ( ) , encode ( "}" , "UTF-8" ) ) ; return sb . toString ( ) ; }
Returns the tags in TSDB query string format .