public void sinkPrepare(FlowProcess<Properties> flowProcess, SinkCall<SolrCollector, OutputStream> sinkCall) throws IOException {
if (!(sinkCall.getOutput() instanceof DirectoryFileOutputStream)) {
throw new TapException("SolrScheme can only be used with a DirectoryTap in local mode");
}
DirectoryFileOutputStream os = (DirectoryFileOutputStream)sinkCall.getOutput();
String path = os.asDirectory();
// Set context to be the embedded solr server (or rather a wrapper for it, that handles caching)
// TODO this call gets made BEFORE sinkConfInit, so I don't have the _dataDir set up at this point, which seems wrong.
SolrCollector collector = new SolrCollector(flowProcess, getSinkFields(), _solrCoreDir, _maxSegments, _dataDirPropertyName, path);
sinkCall.setContext(collector);