@Override public SolrInputDocumentWritable next() { return new SolrInputDocumentWritable(parent.next()); }
@Override public SolrInputDocumentWritable next() { return new SolrInputDocumentWritable(parent.next()); }
@Override public void add(int shard, Map<String, SolrInputDocument> inputDocumentMap) throws SolrServerException, IOException { for (Entry<String, SolrInputDocument> documentEntry : inputDocumentMap.entrySet()) { try { context.write( new Text(documentEntry.getKey()), new SolrInputDocumentWritable(documentEntry.getValue())); context.getCounter(HBaseIndexerCounters.OUTPUT_INDEX_DOCUMENTS).increment(1L); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } } }
@Override public void add(int shard, Map<String, SolrInputDocument> inputDocumentMap) throws SolrServerException, IOException { for (Entry<String, SolrInputDocument> documentEntry : inputDocumentMap.entrySet()) { try { context.write( new Text(documentEntry.getKey()), new SolrInputDocumentWritable(documentEntry.getValue())); context.getCounter(HBaseIndexerCounters.OUTPUT_INDEX_DOCUMENTS).increment(1L); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } } }
@Override public void load(SolrInputDocument doc) throws IOException, SolrServerException { String uniqueKeyFieldName = getSchema().getUniqueKeyField().getName(); Object id = doc.getFieldValue(uniqueKeyFieldName); if (id == null) { throw new IllegalArgumentException("Missing value for (required) unique document key: " + uniqueKeyFieldName + " (see Solr schema.xml)"); } try { context.write(new Text(id.toString()), new SolrInputDocumentWritable(doc)); } catch (InterruptedException e) { throw new IOException("Interrupted while writing " + doc, e); } if (LOG.isDebugEnabled()) { long numParserOutputBytes = 0; for (SolrInputField field : doc.values()) { numParserOutputBytes += sizeOf(field.getValue()); } context.getCounter(MorphlineCounters.class.getName(), MorphlineCounters.PARSER_OUTPUT_BYTES.toString()).increment(numParserOutputBytes); } context.getCounter(MorphlineCounters.class.getName(), MorphlineCounters.DOCS_READ.toString()).increment(1); }
@Override public void load(SolrInputDocument doc) throws IOException, SolrServerException { String uniqueKeyFieldName = getSchema().getUniqueKeyField().getName(); Object id = doc.getFieldValue(uniqueKeyFieldName); if (id == null) { throw new IllegalArgumentException("Missing value for (required) unique document key: " + uniqueKeyFieldName + " (see Solr schema.xml)"); } try { context.write(new Text(id.toString()), new SolrInputDocumentWritable(doc)); } catch (InterruptedException e) { throw new IOException("Interrupted while writing " + doc, e); } if (LOG.isDebugEnabled()) { long numParserOutputBytes = 0; for (SolrInputField field : doc.values()) { numParserOutputBytes += sizeOf(field.getValue()); } context.getCounter(MorphlineCounters.class.getName(), MorphlineCounters.PARSER_OUTPUT_BYTES.toString()).increment(numParserOutputBytes); } context.getCounter(MorphlineCounters.class.getName(), MorphlineCounters.DOCS_READ.toString()).increment(1); }