EMMA Coverage Report (generated Tue Aug 23 05:57:12 CDT 2011)
[all classes][felix.main]

COVERAGE SUMMARY FOR SOURCE FILE [OnlineFelix.java]

nameclass, %method, %block, %line, %
OnlineFelix.java0%   (0/1)0%   (0/5)0%   (0/193)0%   (0/44)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OnlineFelix0%   (0/1)0%   (0/5)0%   (0/193)0%   (0/44)
OnlineFelix (): void 0%   (0/1)0%   (0/6)0%   (0/2)
getFelixQuery (): FelixQuery 0%   (0/1)0%   (0/3)0%   (0/1)
init (): void 0%   (0/1)0%   (0/10)0%   (0/4)
parseFelixQuery (): void 0%   (0/1)0%   (0/122)0%   (0/23)
run (String []): String 0%   (0/1)0%   (0/52)0%   (0/14)

1package felix.main;
2 
3 
4import java.util.HashMap;
5import java.util.HashSet;
6 
7 
8 
9import tuffy.db.RDB;
10import tuffy.mln.Clause;
11import tuffy.mln.Predicate;
12import tuffy.ra.ConjunctiveQuery;
13import tuffy.util.ExceptionMan;
14import tuffy.util.Timer;
15import felix.compiler.StaticAnalyzer;
16import felix.dstruct.ExecutionPlan;
17import felix.dstruct.FelixQuery;
18import felix.dstruct.OperatorBucketGraph;
19import felix.dstruct.StatOperator;
20import felix.executor.Executor;
21import felix.optimizer.Scheduler;
22import felix.parser.FelixCommandOptions;
23import felix.util.FelixConfig;
24import felix.util.FelixUIMan;
25 
26/**
27 * 
28 * 
29 * @deprecated
30 * @author Ce Zhang
31 *
32 */
33public class OnlineFelix {
34 
35        /**
36         * Felix's query, which consists of program, query and evidence.
37         */
38        FelixQuery fq;
39        
40        /**
41         * Static Analyzer, which analyzes the property of each predicates according to rules.
42         */
43        StaticAnalyzer sa;
44        
45        /**
46         * Database connection.
47         */
48        RDB db;
49        
50        /**
51         * Command line option.
52         */
53        FelixCommandOptions options;
54        
55        /**
56         * Whether this Felix object run has loaded evidences.
57         */
58        public boolean hasLoadedEvidence = false;
59        
60        /**
61         * Return Felix's query.
62         * @return
63         */
64        public FelixQuery getFelixQuery(){
65                return fq;
66        }
67        
68        /**
69         * Clear static parameters and initialize variables.
70         */
71        public void init(){
72                
73                ConjunctiveQuery.clearIndexHistory();
74                
75                Clause.mappingFromID2Const = new HashMap<Integer, String>();
76                Clause.mappingFromID2Desc = new HashMap<String, String>();
77 
78        }
79        
80        /**
81         * Load Felix query from program and query file. If -useEvid
82         * is used, evidence file will also be loaded by this function.
83         */
84        public void parseFelixQuery(){
85 
86                FelixUIMan.println(">>> Connecting to RDBMS at " + FelixConfig.db_url);
87                
88                fq = new FelixQuery();
89                
90                if(options.fquery == null && options.queryAtoms == null){
91                        System.err.println("Please specify queries with -q or -queryFiles");
92                        return;
93                }
94                
95                FelixConfig.verbose_level = options.verboseLevel;
96 
97                String prog = options.fprog;
98                fq.parseProgFromString(prog);
99 
100                if(options.fquery != null){
101                        String[] queryFiles = options.fquery.split(",");
102                        fq.loadQueries(queryFiles);
103                }
104                
105                if(options.queryAtoms != null){
106                        FelixUIMan.println(">>> Parsing query atoms in command line");
107                        fq.parseQueryCommaList(options.queryAtoms);
108                }
109 
110                if(options.cwaPreds != null){
111                        String[] preds = options.cwaPreds.split(",");
112                        for(String ps : preds){
113                                Predicate p = fq.getPredByName(ps);
114                                if(p == null){
115                                        fq.closeFiles();
116                                        ExceptionMan.die("COMMAND LINE: Unknown predicate name -- " + ps);
117                                }else{
118                                        p.setClosedWorld(true);
119                                }
120                        }
121                }
122                
123        }
124        
125        /**
126         * Run Felix!
127         * @param args Command line options.
128         */
129        public String run(String[] args){
130                
131                FelixConfig.overrideID();
132                String ret = "";
133                
134                Timer.start("Felix-Timer");
135                
136                init();
137                
138                options = FelixUIMan.parseCommand(args);
139 
140                this.parseFelixQuery();
141                
142                sa = new StaticAnalyzer(this.fq, options);
143                sa.parse();
144                        
145                //for(int j=0;j<2;j++){
146                //
147                Scheduler sc = new Scheduler(null, this.fq, options);
148                
149                // decompose the whole MLN into different operators
150                HashSet<StatOperator> ops = sc.ruleDecomposition(null);
151 
152                // decompose each operators into smaller operators dealing
153                // with different portion of data.
154                OperatorBucketGraph obg = sc.dataDecomposition(ops, null);
155                
156                ExecutionPlan ep = sc.orderOperators(obg);
157 
158                ret = ep.toHTMLString();
159                
160                return ret;
161                
162        }
163        
164}
165 
166 
167 
168 

[all classes][felix.main]
EMMA 2.0.5312 EclEmma Fix 2 (C) Vladimir Roubtsov