@ SuppressWarnings ( "unchecked" ) private SimpleOrderedMap < Object > createSpan ( ComponentSpan span , Boolean encode ) throws IOException { // System.out.println("Create stats span " + span.dataType + " " // + span.statsType + " " + span.statsItems + " --- " + encode); SimpleOrderedMap < Object > mtasSpanResponse = new SimpleOrderedMap <> ( ) ; mtasSpanResponse . add ( "key" , span . key ) ; HashMap < MtasDataCollector < ? , ? > , HashMap < String , MtasSolrMtasResult > > functionData = new HashMap <> ( ) ; HashMap < String , MtasSolrMtasResult > functionDataItem = new HashMap <> ( ) ; functionData . put ( span . dataCollector , functionDataItem ) ; if ( span . functions != null ) { for ( SubComponentFunction function : span . functions ) { function . dataCollector . close ( ) ; functionDataItem . put ( function . key , new MtasSolrMtasResult ( function . dataCollector , new String [ ] { function . dataType } , new String [ ] { function . statsType } , new SortedSet [ ] { function . statsItems } , new List [ ] { null } , new String [ ] { null } , new String [ ] { null } , new Integer [ ] { 0 } , new Integer [ ] { Integer . MAX_VALUE } , null ) ) ; } } MtasSolrMtasResult data = new MtasSolrMtasResult ( span . dataCollector , span . dataType , span . statsType , span . statsItems , null , functionData ) ; if ( encode ) { mtasSpanResponse . add ( "_encoded_data" , MtasSolrResultUtil . encode ( data ) ) ; } else { mtasSpanResponse . add ( span . dataCollector . getCollectorType ( ) , data ) ; MtasSolrResultUtil . rewrite ( mtasSpanResponse , searchComponent ) ; } return mtasSpanResponse ; }
Creates the span .