public void write(StageGroup stageGroup) throws IOException { writeProperties(stageGroup); for (Stage s : stageGroup.getStages()) { write(s, stageGroup.getName()); } }
public static Object addFile(MongoConnector dbc, String jar) throws FileNotFoundException, URISyntaxException { URL path = ClassLoader.getSystemResource(jar); File f = new File(path.toURI()); return dbc.getPipelineWriter().save(f.getName(), new FileInputStream(f)); } }
@Override public void write(Pipeline p) throws IOException { Pipeline old = reader.getPipeline(); for(Stage s : old.getStages()) { inactivate(s); } for(StageGroup g : p.getStageGroups()) { write(g); } }
public static void removeStage(MongoConnector mdc, CommandLine cmd) throws IOException { if(!cmd.hasOption("n")) { System.out.println("No stage name specified\n"); printUsage(cmd); return; } String name = cmd.getOptionValue("n"); Pipeline pipeline = mdc.getPipelineReader().getPipeline(); if(pipeline.getStage(name) == null) { System.out.println("Specified stage '"+name+"' did not exist\n"); return; } boolean found = false; for(StageGroup g : pipeline.getStageGroups()) { if(g.hasStage(name)) { g.removeStage(name); found = true; break; } } if(found) { mdc.getPipelineWriter().write(pipeline); System.out.println("Successfully removed stage '"+name+"'"); } else { System.out.println("Unable to delete '"+name+"'. Stage did not exist."); } }
mdc.getPipelineWriter().write(pipeline); System.out.println("Removed "+stagesToDelete.size()+" stages from the pipeline"); boolean res = mdc.getPipelineWriter().deleteFile(cmd.getOptionValue("i")); if(res) { System.out.println("Removed library file with id "+cmd.getOptionValue("i"));
pipelineWriter = new MongoPipelineWriter(pipelineReader, concern); MongoDocumentIO.DOCUMENT_FS)); documentIO.prepare(); pipelineWriter.prepare();
private void writeProperties(StageGroup stageGroup) { DBObject q = reader.getGroupQuery(stageGroup.getName()); WriteResult result = stages.update(q, getGroupDBObject(stageGroup), true, false, concern); if (logger.isDebugEnabled()) { logger.debug("Wrote properties for group '{}', operation updated '{}' objects, got message '{}'", stageGroup.getName(), result.getN(), result); } }
public void write(Stage stage, String group) throws IOException { DBObject q = reader.getStageQuery(stage.getName()); WriteResult result = stages.update(q, getStageDBObject(stage, group), true, false, concern); if (logger.isDebugEnabled()) { logger.debug("Wrote stage '{}' in group '{}', operation updated '{}' objects, got message '{}'", stage.getName(), group, result.getN(), result); } }
g.addStage(s); pipeline.addGroup(g); mdc.getPipelineWriter().write(pipeline); System.out.println("Added stage " + name + " to the pipeline.");
s.setProperties(map); mdc.getPipelineWriter().write(c);
public static Object addFile(MongoConnector dbc, String jar, String id) throws FileNotFoundException, URISyntaxException { URL path = ClassLoader.getSystemResource(jar); File f; if (path == null) { f = new File(jar); if (!f.exists()) { System.out.println("Unable to locate file " + jar); return null; } } else { f = new File(path.toURI()); } if (id == null) { return dbc.getPipelineWriter().save(f.getName(), new FileInputStream(f)); } dbc.getPipelineWriter().save(id, f.getName(), new FileInputStream(f)); return id; } }