Examples of DocumentMap


Examples of com.alimama.mdrill.index.utils.DocumentMap

          }
         
        }
      }
     
      context.write(new PairWriteable(this.Index++), new DocumentMap(res));

     
      if(this.isuniqcheck&&uniqfieldIndex>0&&res[uniqfieldIndex]!=null)
      {
        String notempty=res[uniqfieldIndex];
        if(notempty.length()>0&&!notempty.equals("_"))
        {
          context.write(new PairWriteable(new Text("uniq_"+notempty)), new DocumentMap());
        }
      }
     
      return true;
       
View Full Code Here

Examples of com.alimama.mdrill.index.utils.DocumentMap

    if(!key.isNum())
    {
      int dumps=0;
      Iterator<DocumentMap> iterator = values.iterator();
      while (iterator.hasNext()) {
        DocumentMap doclist = iterator.next();
        dumps++;
      }
      if(dumps>1)
      {
        context.getCounter("higo", "dumpcount").increment(1);;
        if(debuglines<100)
          {
            debuglines++;
              System.out.println("dumpcount: " + key.toString()   + "");
          }
      }
      return ;
    }
   
    lastkey = new IntWritable(key.getIndex());
   
    Iterator<DocumentMap> iterator = values.iterator();
    while (iterator.hasNext()) {
      if(doccount>maxDocCount||debugInfo>maxDocCount_l)
      {
        LOG.info("count over:"+debugInfo);

        break ;
      }
     
      DocumentMap map=iterator.next();
     
      int addcnt=doclistcache.add(map,this.fields);
      if(addcnt<=0)
      {
        context.getCounter("higo", "addempty").increment(1);
View Full Code Here

Examples of com.intersys.gds.DocumentMap

    DocumentType locationType = DocumentType.createDocumentType("Location", jugLocation);
    locationType.setReference("venue", ElementType.TYPE_BACK_REFERENCE, "WorldJUGs", "NONE");
    connection.saveDocumentType(locationType);
   
    //4.Create the db object handle
    DocumentMap dbDocHandle = connection.getDocumentMap("WorldJUGs");
   
    //5. Store the data in the database
    for(int j=0; j<documentCount; j++){
      Document ljug = worldJugs.get(j);
      dbDocHandle.store(Integer.toString(j), ljug);
    }
    //6. Close the connection
    connection.close();
  }
View Full Code Here

Examples of nux.xom.pool.DocumentMap

        }
      }
    };
   
    return new DocumentPool(
      new DocumentMap(
        new PoolConfig().
          setCompressionLevel(docPoolCompression).
          setCapacity(docPoolCapacity)),
        docFactory);
  }
View Full Code Here

Examples of nux.xom.pool.DocumentMap

   
    if (args.length > ++k) config.setMaxIdleTime(Long.parseLong(args[k]));
   
    if (args.length > ++k) config.setMaxLifeTime(Long.parseLong(args[k]));
   
    final DocumentMap pool = new DocumentMap(config);
   
    final File[] files = new File[numFiles];
    new File("tmp").mkdir();
    for (int j=0; j < numFiles; j++) {
      files[j] = new File("tmp/file" + j + ".xml");
      System.out.println("writing " + files[j]);
      FileWriter out = new FileWriter(files[j]);
      out.write("<hello/>");
      out.flush();
      out.close();
    }
   
    for (int j=0; j < threads; j++) {
      final int t = j;
      Runnable runner = new Runnable() {
        public void run() {
          try {
            Builder builder = new Builder();
            int i = 0;
            while (i < files.length) {
              System.out.println("t="+ t + ", index="+i);
              Document doc = builder.build(files[i]);
              Object key = files[i];
              pool.putDocument(key, doc);
              i++;
            }
            System.out.println("done");
          }
          catch (Throwable t) {
View Full Code Here

Examples of nux.xom.pool.DocumentMap

    if (args.length > ++k) config.setMaxLifeTime(Long.parseLong(args[k]));
   
    int printStep = 10;
    if (args.length > ++k) printStep = Math.max(1, Integer.parseInt(args[k]));
   
    final DocumentMap pool = new DocumentMap(config);
   
    for (int j=0; j < threads; j++) {
      final int t = j;
      final Document xmlDoc = doc;
      final int step = printStep;
      Runnable runner = new Runnable() {
        public void run() {
          try {
            int i = 0;
            while (true) {
              if (i % step == 0) System.out.println("t="+ t + ", index=" + i);
              Document doc;
              if (xmlDoc == null) {
                Element root = new Element("root");
                Element child = new Element("child");
                root.appendChild(child);
                for (int j=0; j < 10000; j++) child.appendChild("xxxxxxxxxxxxxxxxxx" + j);
                doc = new Document(root);
              }
              else {
                doc = xmlDoc;
                if (config.getCompressionLevel() == -1) doc = new Document(doc);
              }
             
              Object key = new Integer(i + t*100);
//              Object key = new Integer(-1);
              pool.putDocument(key, doc);
             
//              // simulate hot cache items (gc should bias against collecting these)
              pool.getDocument(new Integer(8));
             
//              pool.getDocument(key);
              i++;
            }
          }
View Full Code Here

Examples of org.apache.tuscany.sca.domain.search.DocumentMap

    }

    private void contributionAdded(Contribution contribution, IndexWriter indexWriter) throws IndexException {
        DomainSearchDocumentProcessorsMap docProcessors = new DomainSearchDocumentProcessorsMap();
        DocumentMap docs = new DocumentMap();

        try {
            docProcessors.process(docProcessors, docs, contribution, null, "");

        } catch (Exception e) {
            e.printStackTrace();
        }

        // FileWriter writer = new FileWriter("indexed.txt");
        for (Document doc : docs.values()) {
            org.apache.lucene.document.Document luceneDoc = doc.createLuceneDocument();
            // writer.write(luceneDoc.toString());
            // writer.write('\n');
            // writer.write('\n');
           
View Full Code Here

Examples of org.apache.tuscany.sca.domain.search.DocumentMap

    }

    private void contributionAdded(Contribution contribution, IndexWriter indexWriter) throws IndexException {
        DomainSearchDocumentProcessorsMap docProcessors = new DomainSearchDocumentProcessorsMap();
        DocumentMap docs = new DocumentMap();

        try {
            docProcessors.process(docProcessors, docs, contribution, null, "");

        } catch (Exception e) {
            e.printStackTrace();
        }

        // FileWriter writer = new FileWriter("indexed.txt");
        for (Document doc : docs.values()) {
            org.apache.lucene.document.Document luceneDoc = doc.createLuceneDocument();
            // writer.write(luceneDoc.toString());
            // writer.write('\n');
            // writer.write('\n');
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.