throws IOException, SharderException {
Configuration conf = context.getConfiguration();
if (conf.getBoolean(INDEX_DIRECT_WRITE_CONF_KEY, false)) {
String solrMode = getSolrMode(indexConnectionParams);
if (solrMode.equals("cloud")) {
DirectSolrInputDocumentWriter writer = createCloudSolrWriter(context, indexConnectionParams);
solrDocWriter = wrapInBufferedWriter(context, writer);
return Indexer.createIndexer(indexName, indexerConf, tableName, mapper, null, null, solrDocWriter);
} else if (solrMode.equals("classic")) {
DirectSolrClassicInputDocumentWriter classicSolrWriter = createClassicSolrWriter(context, indexConnectionParams);
Sharder sharder = createSharder(indexConnectionParams, classicSolrWriter.getNumServers());