35
35
import java .io .OutputStream ;
36
36
import java .net .BindException ;
37
37
import java .net .ServerSocket ;
38
+ import java .net .URLDecoder ;
38
39
import java .nio .ByteBuffer ;
39
40
import java .nio .channels .Channels ;
40
41
import java .nio .channels .WritableByteChannel ;
42
+ import java .nio .charset .StandardCharsets ;
41
43
import java .security .Principal ;
42
44
import java .util .ArrayList ;
43
45
import java .util .Arrays ;
@@ -4717,26 +4719,27 @@ public ComponentPageInfo getComponentPageInfo(String topoId, String componentId,
4717
4719
nodeToHost = Collections .emptyMap ();
4718
4720
}
4719
4721
4722
+ String sanitizedComponentId = URLDecoder .decode (componentId , StandardCharsets .UTF_8 );
4720
4723
ComponentPageInfo compPageInfo = StatsUtil .aggCompExecsStats (exec2HostPort , info .taskToComponent , info .beats , window ,
4721
- includeSys , topoId , topology , componentId );
4724
+ includeSys , topoId , topology , sanitizedComponentId );
4722
4725
if (compPageInfo .get_component_type () == ComponentType .SPOUT ) {
4723
- NormalizedResourceRequest spoutResources = ResourceUtils .getSpoutResources (topology , topoConf , componentId );
4726
+ NormalizedResourceRequest spoutResources = ResourceUtils .getSpoutResources (topology , topoConf , sanitizedComponentId );
4724
4727
if (spoutResources == null ) {
4725
- spoutResources = new NormalizedResourceRequest (topoConf , componentId );
4728
+ spoutResources = new NormalizedResourceRequest (topoConf , sanitizedComponentId );
4726
4729
}
4727
4730
compPageInfo .set_resources_map (spoutResources .toNormalizedMap ());
4728
4731
} else { //bolt
4729
- NormalizedResourceRequest boltResources = ResourceUtils .getBoltResources (topology , topoConf , componentId );
4732
+ NormalizedResourceRequest boltResources = ResourceUtils .getBoltResources (topology , topoConf , sanitizedComponentId );
4730
4733
if (boltResources == null ) {
4731
- boltResources = new NormalizedResourceRequest (topoConf , componentId );
4734
+ boltResources = new NormalizedResourceRequest (topoConf , sanitizedComponentId );
4732
4735
}
4733
4736
compPageInfo .set_resources_map (boltResources .toNormalizedMap ());
4734
4737
}
4735
4738
compPageInfo .set_topology_name (info .topoName );
4736
- compPageInfo .set_errors (stormClusterState .errors (topoId , componentId ));
4739
+ compPageInfo .set_errors (stormClusterState .errors (topoId , sanitizedComponentId ));
4737
4740
compPageInfo .set_topology_status (extractStatusStr (info .base ));
4738
4741
if (info .base .is_set_component_debug ()) {
4739
- DebugOptions debug = info .base .get_component_debug ().get (componentId );
4742
+ DebugOptions debug = info .base .get_component_debug ().get (sanitizedComponentId );
4740
4743
if (debug != null ) {
4741
4744
compPageInfo .set_debug_options (debug );
4742
4745
}
@@ -4747,7 +4750,7 @@ public ComponentPageInfo getComponentPageInfo(String topoId, String componentId,
4747
4750
List <Integer > tasks = compToTasks .get (StormCommon .EVENTLOGGER_COMPONENT_ID );
4748
4751
tasks .sort (null );
4749
4752
// Find the task the events from this component route to.
4750
- int taskIndex = TupleUtils .chooseTaskIndex (Collections .singletonList (componentId ), tasks .size ());
4753
+ int taskIndex = TupleUtils .chooseTaskIndex (Collections .singletonList (sanitizedComponentId ), tasks .size ());
4751
4754
int taskId = tasks .get (taskIndex );
4752
4755
String host = null ;
4753
4756
Integer port = null ;
0 commit comments