1
1
package backtype .storm .task ;
2
2
3
- import backtype .storm .Config ;
4
- import backtype .storm .generated .ComponentCommon ;
5
3
import backtype .storm .generated .GlobalStreamId ;
6
4
import backtype .storm .generated .Grouping ;
7
5
import backtype .storm .generated .StormTopology ;
8
- import backtype .storm .generated .StreamInfo ;
9
6
import backtype .storm .hooks .ITaskHook ;
10
7
import backtype .storm .state .ISubscribedState ;
11
8
import backtype .storm .tuple .Fields ;
12
- import backtype .storm .utils .ThriftTopologyUtils ;
13
9
import backtype .storm .utils .Utils ;
10
+ import java .io .File ;
11
+ import java .io .IOException ;
14
12
import java .util .ArrayList ;
15
13
import java .util .Collection ;
16
14
import java .util .Collections ;
17
- import java .util .HashMap ;
18
15
import java .util .List ;
19
16
import java .util .Map ;
20
17
import java .util .Set ;
21
18
import org .apache .commons .lang .NotImplementedException ;
22
- import org .json .simple .JSONValue ;
23
19
24
20
/**
25
21
* A TopologyContext is given to bolts and spouts in their "prepare" and "open"
@@ -45,7 +41,11 @@ public TopologyContext(StormTopology topology, Map stormConf,
45
41
super (topology , stormConf , taskToComponent , stormId );
46
42
_workerPort = workerPort ;
47
43
_taskId = taskId ;
48
- _pidDir = pidDir ;
44
+ try {
45
+ _pidDir = new File (pidDir ).getCanonicalPath ();
46
+ } catch (IOException e ) {
47
+ throw new RuntimeException ("Could not get canonical path for " + _pidDir , e );
48
+ }
49
49
_codeDir = codeDir ;
50
50
_workerTasks = new ArrayList <Integer >(workerTasks );
51
51
Collections .sort (_workerTasks );
0 commit comments