import com.findwise.hydra.mongodb.MongoConnector;
public class StraightPipelineSetup {
public static void main(String[] args) throws Exception {
MongoConnector mdc = new MongoConnector(new TestConfiguration());
mdc.connect();
Object outId = addFile(mdc, "hydra-out-jar-with-dependencies.jar");
Object basicId = addFile(mdc, "basic-stages-jar-with-dependencies.jar");
Pipeline c = new Pipeline();
Stage s = getStage(c, basicId, "copyStage1", "stage.CopyStage");
Map<String, Object> map = s.getProperties();
map.put("map", getSingleMap("in", "out1"));
s.setProperties(map);
s = getStage(c, basicId, "copyStage2", "stage.CopyStage", "copyStage1");
map = s.getProperties();
map.put("map", getSingleMap("out1", "out2"));
s.setProperties(map);
s = getStage(c, basicId, "copyStage3", "stage.CopyStage", "copyStage2");
map = s.getProperties();
map.put("map", getSingleMap("out2", "out3"));
s.setProperties(map);
s = getStage(c, outId, "solrOutput", "output.solr.SolrOutputStage", "copyStage3");
map = s.getProperties();
HashMap<String, String> fieldMap = new HashMap<String, String>();
fieldMap.put("out1", "out1_s");
fieldMap.put("out2", "out2_s");
fieldMap.put("out3", "out3_s");
fieldMap.put("in", "in_s");
fieldMap.put("id", "id");
map.put("fieldMappings", fieldMap);
map.put("solrDeployPath", "http://127.0.0.1:8983/solr");
s.setProperties(map);
mdc.getPipelineWriter().write(c);
System.out.println("Posted your stages into Hydra");
}