/** * {@inheritDoc} */ @Override public void connect(PipeTasks pipeTasks) { // A multi sink receives multiple streams of data, so we must connect // them up one by one. for (int i = 0; i < task.getChangeSinkCount(); i++) { ChangeSink sink; ChangeSource source; // Retrieve the next sink. sink = task.getChangeSink(i); // Retrieve the appropriate source. source = (ChangeSource) getInputTask(pipeTasks, i, ChangeSource.class); // Connect the tasks. source.setChangeSink(sink); } // Register the source as an output task. setOutputTask(pipeTasks, task, 0); }
/** * {@inheritDoc} */ @Override protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { String conflictResolutionMethod; conflictResolutionMethod = getStringArgument( taskConfig, ARG_CONFLICT_RESOLUTION_METHOD, DEFAULT_CONFLICT_RESOLUTION_METHOD); if (!CONFLICT_RESOLUTION_METHOD_MAP.containsKey(conflictResolutionMethod)) { throw new OsmosisRuntimeException( "Argument " + ARG_CONFLICT_RESOLUTION_METHOD + " for task " + taskConfig.getId() + " has value \"" + conflictResolutionMethod + "\" which is unrecognised."); } int bufferCapacity = getIntegerArgument( taskConfig, ARG_BUFFER_CAPACITY, getDefaultIntegerArgument(taskConfig, DEFAULT_BUFFER_CAPACITY) ); return new MultiChangeSinkRunnableChangeSourceManager( taskConfig.getId(), new ChangeMerger(CONFLICT_RESOLUTION_METHOD_MAP.get(conflictResolutionMethod), bufferCapacity), taskConfig.getPipeArgs() ); } }
/** * {@inheritDoc} */ @Override protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { String conflictResolutionMethod; conflictResolutionMethod = getStringArgument( taskConfig, ARG_CONFLICT_RESOLUTION_METHOD, DEFAULT_CONFLICT_RESOLUTION_METHOD); if (!CONFLICT_RESOLUTION_METHOD_MAP.containsKey(conflictResolutionMethod)) { throw new OsmosisRuntimeException( "Argument " + ARG_CONFLICT_RESOLUTION_METHOD + " for task " + taskConfig.getId() + " has value \"" + conflictResolutionMethod + "\" which is unrecognised."); } int bufferCapacity = getIntegerArgument( taskConfig, ARG_BUFFER_CAPACITY, getDefaultIntegerArgument(taskConfig, DEFAULT_BUFFER_CAPACITY) ); return new MultiChangeSinkRunnableChangeSourceManager( taskConfig.getId(), new ChangeMerger(CONFLICT_RESOLUTION_METHOD_MAP.get(conflictResolutionMethod), bufferCapacity), taskConfig.getPipeArgs() ); } }
/** * {@inheritDoc} */ @Override public void connect(PipeTasks pipeTasks) { // A multi sink receives multiple streams of data, so we must connect // them up one by one. for (int i = 0; i < task.getChangeSinkCount(); i++) { ChangeSink sink; ChangeSource source; // Retrieve the next sink. sink = task.getChangeSink(i); // Retrieve the appropriate source. source = (ChangeSource) getInputTask(pipeTasks, i, ChangeSource.class); // Connect the tasks. source.setChangeSink(sink); } // Register the source as an output task. setOutputTask(pipeTasks, task, 0); }
/** * {@inheritDoc} */ @Override protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { int sourceCount; sourceCount = getIntegerArgument(taskConfig, ARG_SOURCE_COUNT, DEFAULT_SOURCE_COUNT); int bufferCapacity = getIntegerArgument( taskConfig, ARG_BUFFER_CAPACITY, getDefaultIntegerArgument(taskConfig, DEFAULT_BUFFER_CAPACITY) ); return new MultiChangeSinkRunnableChangeSourceManager( taskConfig.getId(), new ChangeAppender(sourceCount, bufferCapacity), taskConfig.getPipeArgs() ); } }
/** * {@inheritDoc} */ @Override protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { int sourceCount; sourceCount = getIntegerArgument(taskConfig, ARG_SOURCE_COUNT, DEFAULT_SOURCE_COUNT); int bufferCapacity = getIntegerArgument( taskConfig, ARG_BUFFER_CAPACITY, getDefaultIntegerArgument(taskConfig, DEFAULT_BUFFER_CAPACITY) ); return new MultiChangeSinkRunnableChangeSourceManager( taskConfig.getId(), new ChangeAppender(sourceCount, bufferCapacity), taskConfig.getPipeArgs() ); } }