Package com.senseidb.indexing.hadoop.keyvalueformat

Examples of com.senseidb.indexing.hadoop.keyvalueformat.IntermediateForm


                      doc.add(new Field(AbstractZoieIndexable.DOCUMENT_STORE_FIELD,bytes));
                    }
                  }
             
              //now we have uid and lucene Doc;
              IntermediateForm form = new IntermediateForm();
              form.configure(_conf);
              form.process(doc, analyzer);
              form.closeWriter();

              int chosenShard = -1;
          try {
            chosenShard = _shardingStategy.caculateShard(_shards.length, json);
          } catch (JSONException e) {
View Full Code Here


  public void reduce(Shard key, Iterator<IntermediateForm> values,
      OutputCollector<Shard, IntermediateForm> output, Reporter reporter)
      throws IOException {

    String message = key.toString();
    IntermediateForm form = null;

    while (values.hasNext()) {
      IntermediateForm singleDocForm = values.next();
      long formSize = form == null ? 0 : form.totalSizeInBytes();
      long singleDocFormSize = singleDocForm.totalSizeInBytes();

      if (form != null && formSize + singleDocFormSize > maxSizeInBytes) {
        closeForm(form, message);
        output.collect(key, form);
        form = null;
View Full Code Here

    }
  }

  private IntermediateForm createForm(String message) throws IOException {
  logger.info("Construct a form writer for " + message);
    IntermediateForm form = new IntermediateForm();
    form.configure(iconf);
    return form;
  }
View Full Code Here

        logger.info("mapredTempDir is: "+ mapredTempDir);
        final ShardWriter writer = new ShardWriter(fs, key, temp, iconf);

        // update the shard
        while (values.hasNext()) {
          IntermediateForm form = values.next();
          writer.process(form);
          reporter.progress();
        }

        // close the shard
View Full Code Here

TOP

Related Classes of com.senseidb.indexing.hadoop.keyvalueformat.IntermediateForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.