Java 类org.apache.lucene.index.IndexDeletionPolicy 实例源码

项目:search    文件:IndexAndTaxonomyRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
    throws IOException {
  IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.indexWriter = indexWriter;
  this.taxoWriter = taxoWriter;
  this.indexSDP = (SnapshotDeletionPolicy) delPolicy;
  this.taxoSDP = taxoWriter.getDeletionPolicy();
  this.indexCommit = indexSDP.snapshot();
  this.taxoCommit = taxoSDP.snapshot();
  this.version = revisionVersion(indexCommit, taxoCommit);
  this.sourceFiles = revisionFiles(indexCommit, taxoCommit);
}
项目:read-open-source-code    文件:IndexAndTaxonomyRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
    throws IOException {
  IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.indexWriter = indexWriter;
  this.taxoWriter = taxoWriter;
  this.indexSDP = (SnapshotDeletionPolicy) delPolicy;
  this.taxoSDP = taxoWriter.getDeletionPolicy();
  this.indexCommit = indexSDP.snapshot();
  this.taxoCommit = taxoSDP.snapshot();
  this.version = revisionVersion(indexCommit, taxoCommit);
  this.sourceFiles = revisionFiles(indexCommit, taxoCommit);
}
项目:read-open-source-code    文件:IndexAndTaxonomyRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
    throws IOException {
  IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.indexWriter = indexWriter;
  this.taxoWriter = taxoWriter;
  this.indexSDP = (SnapshotDeletionPolicy) delPolicy;
  this.taxoSDP = taxoWriter.getDeletionPolicy();
  this.indexCommit = indexSDP.snapshot();
  this.taxoCommit = taxoSDP.snapshot();
  this.version = revisionVersion(indexCommit, taxoCommit);
  this.sourceFiles = revisionFiles(indexCommit, taxoCommit);
}
项目:read-open-source-code    文件:IndexAndTaxonomyRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
    throws IOException {
  IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.indexWriter = indexWriter;
  this.taxoWriter = taxoWriter;
  this.indexSDP = (SnapshotDeletionPolicy) delPolicy;
  this.taxoSDP = taxoWriter.getDeletionPolicy();
  this.indexCommit = indexSDP.snapshot();
  this.taxoCommit = taxoSDP.snapshot();
  this.version = revisionVersion(indexCommit, taxoCommit);
  this.sourceFiles = revisionFiles(indexCommit, taxoCommit);
}
项目:Maskana-Gestor-de-Conocimiento    文件:IndexAndTaxonomyRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
    throws IOException {
  IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.indexWriter = indexWriter;
  this.taxoWriter = taxoWriter;
  this.indexSDP = (SnapshotDeletionPolicy) delPolicy;
  this.taxoSDP = taxoWriter.getDeletionPolicy();
  this.indexCommit = indexSDP.snapshot();
  this.taxoCommit = taxoSDP.snapshot();
  this.version = revisionVersion(indexCommit, taxoCommit);
  this.sourceFiles = revisionFiles(indexCommit, taxoCommit);
}
项目:t4f-data    文件:SnapshotIndex.java   
public void test() throws Exception {

        Directory dir = null;

        IndexDeletionPolicy policy = new KeepOnlyLastCommitDeletionPolicy();
        SnapshotDeletionPolicy snapshotter = new SnapshotDeletionPolicy(policy);
        IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_41,
                AosAnalyser.NO_LIMIT_TOKEN_COUNT_SIMPLE_ANALYSER);
        conf.setIndexDeletionPolicy(snapshotter);
        IndexWriter writer = new IndexWriter(dir, conf);

        try {
            IndexCommit commit = snapshotter.snapshot("unique-id");
            Collection<String> fileNames = commit.getFileNames();
            /* <iterate over & copy files from fileNames> */
        }
        finally {
            snapshotter.release("unique-id");
        }
    }
项目:Elasticsearch    文件:DeletionPolicyModule.java   
@Override
protected void configure() {
    bind(IndexDeletionPolicy.class)
            .annotatedWith(Names.named("actual"))
            .to(KeepOnlyLastDeletionPolicy.class)
            .asEagerSingleton();

    bind(SnapshotDeletionPolicy.class)
            .asEagerSingleton();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:hadoop-EAR    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:search    文件:CreateIndexTask.java   
public static IndexDeletionPolicy getIndexDeletionPolicy(Config config) {
  String deletionPolicyName = config.get("deletion.policy", "org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy");
  if (deletionPolicyName.equals(NoDeletionPolicy.class.getName())) {
    return NoDeletionPolicy.INSTANCE;
  } else {
    try {
      return Class.forName(deletionPolicyName).asSubclass(IndexDeletionPolicy.class).newInstance();
    } catch (Exception e) {
      throw new RuntimeException("unable to instantiate class '" + deletionPolicyName + "' as IndexDeletionPolicy", e);
    }
  }
}
项目:search    文件:IndexRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexRevision(IndexWriter writer) throws IOException {
  IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.writer = writer;
  this.sdp = (SnapshotDeletionPolicy) delPolicy;
  this.commit = sdp.snapshot();
  this.version = revisionVersion(commit);
  this.sourceFiles = revisionFiles(commit);
}
项目:search    文件:SolrIndexWriter.java   
private SolrIndexWriter(String name, String path, Directory directory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy, Codec codec) throws IOException {
  super(directory,
        config.toIndexWriterConfig(schema).
        setOpenMode(create ? IndexWriterConfig.OpenMode.CREATE : IndexWriterConfig.OpenMode.APPEND).
        setIndexDeletionPolicy(delPolicy).setCodec(codec)
        );
  log.debug("Opened Writer " + name);
  this.name = name;
  infoStream = getConfig().getInfoStream();
  this.directory = directory;
  numOpens.incrementAndGet();
}
项目:search    文件:SolrCore.java   
private void initDeletionPolicy() {
  PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
  IndexDeletionPolicy delPolicy = null;
  if(info != null){
    delPolicy = createInstance(info.className,IndexDeletionPolicy.class,"Deletion Policy for SOLR");
    if (delPolicy instanceof NamedListInitializedPlugin) {
      ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
    }
  } else {
    delPolicy = new SolrDeletionPolicy();
  }     
  solrDelPolicy = new IndexDeletionPolicyWrapper(delPolicy);
}
项目:NYBC    文件:CreateIndexTask.java   
public static IndexDeletionPolicy getIndexDeletionPolicy(Config config) {
  String deletionPolicyName = config.get("deletion.policy", "org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy");
  if (deletionPolicyName.equals(NoDeletionPolicy.class.getName())) {
    return NoDeletionPolicy.INSTANCE;
  } else {
    try {
      return Class.forName(deletionPolicyName).asSubclass(IndexDeletionPolicy.class).newInstance();
    } catch (Exception e) {
      throw new RuntimeException("unable to instantiate class '" + deletionPolicyName + "' as IndexDeletionPolicy", e);
    }
  }
}
项目:NYBC    文件:SolrIndexWriter.java   
private SolrIndexWriter(String name, String path, Directory directory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy, Codec codec) throws IOException {
  super(directory,
        config.toIndexWriterConfig(schema).
        setOpenMode(create ? IndexWriterConfig.OpenMode.CREATE : IndexWriterConfig.OpenMode.APPEND).
        setIndexDeletionPolicy(delPolicy).setCodec(codec).setInfoStream(toInfoStream(config))
        );
  log.debug("Opened Writer " + name);
  this.name = name;
  numOpens.incrementAndGet();
}
项目:NYBC    文件:SolrCore.java   
private void initDeletionPolicy() {
  PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
  IndexDeletionPolicy delPolicy = null;
  if(info != null){
    delPolicy = createInstance(info.className,IndexDeletionPolicy.class,"Deletion Policy for SOLR");
    if (delPolicy instanceof NamedListInitializedPlugin) {
      ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
    }
  } else {
    delPolicy = new SolrDeletionPolicy();
  }     
  solrDelPolicy = new IndexDeletionPolicyWrapper(delPolicy);
}
项目:hadoop-on-lustre    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:search-core    文件:SolrIndexWriter.java   
private SolrIndexWriter(String name, String path, Directory directory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy, Codec codec) throws IOException {
  super(directory,
        config.toIndexWriterConfig(schema).
        setOpenMode(create ? IndexWriterConfig.OpenMode.CREATE : IndexWriterConfig.OpenMode.APPEND).
        setIndexDeletionPolicy(delPolicy).setCodec(codec).setInfoStream(toInfoStream(config))
        );
  log.debug("Opened Writer " + name);
  this.name = name;
  numOpens.incrementAndGet();
}
项目:search-core    文件:SolrCore.java   
private void initDeletionPolicy() {
    PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
    IndexDeletionPolicy delPolicy = null;
    if(info != null) {
        delPolicy = createInstance(info.className, IndexDeletionPolicy.class, "Deletion Policy for SOLR");
        if(delPolicy instanceof NamedListInitializedPlugin) {
            ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
        }
    } else {
        delPolicy = new SolrDeletionPolicy();
    }
    solrDelPolicy = new IndexDeletionPolicyWrapper(delPolicy);
}
项目:read-open-source-code    文件:CreateIndexTask.java   
public static IndexDeletionPolicy getIndexDeletionPolicy(Config config) {
  String deletionPolicyName = config.get("deletion.policy", "org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy");
  if (deletionPolicyName.equals(NoDeletionPolicy.class.getName())) {
    return NoDeletionPolicy.INSTANCE;
  } else {
    try {
      return Class.forName(deletionPolicyName).asSubclass(IndexDeletionPolicy.class).newInstance();
    } catch (Exception e) {
      throw new RuntimeException("unable to instantiate class '" + deletionPolicyName + "' as IndexDeletionPolicy", e);
    }
  }
}
项目:read-open-source-code    文件:IndexRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexRevision(IndexWriter writer) throws IOException {
  IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.writer = writer;
  this.sdp = (SnapshotDeletionPolicy) delPolicy;
  this.commit = sdp.snapshot();
  this.version = revisionVersion(commit);
  this.sourceFiles = revisionFiles(commit);
}
项目:read-open-source-code    文件:SolrIndexWriter.java   
private SolrIndexWriter(String name, String path, Directory directory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy, Codec codec) throws IOException {
  super(directory,
        config.toIndexWriterConfig(schema).
        setOpenMode(create ? IndexWriterConfig.OpenMode.CREATE : IndexWriterConfig.OpenMode.APPEND).
        setIndexDeletionPolicy(delPolicy).setCodec(codec)
        );
  log.debug("Opened Writer " + name);
  this.name = name;
  numOpens.incrementAndGet();
}
项目:read-open-source-code    文件:SolrCore.java   
private void initDeletionPolicy() {
  PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
  IndexDeletionPolicy delPolicy = null;
  if(info != null){
    delPolicy = createInstance(info.className,IndexDeletionPolicy.class,"Deletion Policy for SOLR");
    if (delPolicy instanceof NamedListInitializedPlugin) {
      ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
    }
  } else {
    delPolicy = new SolrDeletionPolicy();
  }     
  solrDelPolicy = new IndexDeletionPolicyWrapper(delPolicy);
}
项目:read-open-source-code    文件:CreateIndexTask.java   
public static IndexDeletionPolicy getIndexDeletionPolicy(Config config) {
  String deletionPolicyName = config.get("deletion.policy", "org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy");
  if (deletionPolicyName.equals(NoDeletionPolicy.class.getName())) {
    return NoDeletionPolicy.INSTANCE;
  } else {
    try {
      return Class.forName(deletionPolicyName).asSubclass(IndexDeletionPolicy.class).newInstance();
    } catch (Exception e) {
      throw new RuntimeException("unable to instantiate class '" + deletionPolicyName + "' as IndexDeletionPolicy", e);
    }
  }
}
项目:read-open-source-code    文件:IndexRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexRevision(IndexWriter writer) throws IOException {
  IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.writer = writer;
  this.sdp = (SnapshotDeletionPolicy) delPolicy;
  this.commit = sdp.snapshot();
  this.version = revisionVersion(commit);
  this.sourceFiles = revisionFiles(commit);
}
项目:read-open-source-code    文件:IndexRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexRevision(IndexWriter writer) throws IOException {
  IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.writer = writer;
  this.sdp = (SnapshotDeletionPolicy) delPolicy;
  this.commit = sdp.snapshot();
  this.version = revisionVersion(commit);
  this.sourceFiles = revisionFiles(commit);
}
项目:read-open-source-code    文件:SolrIndexWriter.java   
private SolrIndexWriter(String name, String path, Directory directory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy, Codec codec) throws IOException {
  super(directory,
        config.toIndexWriterConfig(schema).
        setOpenMode(create ? IndexWriterConfig.OpenMode.CREATE : IndexWriterConfig.OpenMode.APPEND).
        setIndexDeletionPolicy(delPolicy).setCodec(codec)
        );
  log.debug("Opened Writer " + name);
  this.name = name;
  infoStream = getConfig().getInfoStream();
  this.directory = directory;
  numOpens.incrementAndGet();
}
项目:read-open-source-code    文件:SolrCore.java   
private void initDeletionPolicy() {
  PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
  IndexDeletionPolicy delPolicy = null;
  if(info != null){
    delPolicy = createInstance(info.className,IndexDeletionPolicy.class,"Deletion Policy for SOLR");
    if (delPolicy instanceof NamedListInitializedPlugin) {
      ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
    }
  } else {
    delPolicy = new SolrDeletionPolicy();
  }     
  solrDelPolicy = new IndexDeletionPolicyWrapper(delPolicy);
}
项目:RDFS    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:hadoop-0.20    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:hanoi-hadoop-2.0.0-cdh    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:mapreduce-fork    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:Maskana-Gestor-de-Conocimiento    文件:CreateIndexTask.java   
public static IndexDeletionPolicy getIndexDeletionPolicy(Config config) {
  String deletionPolicyName = config.get("deletion.policy", "org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy");
  if (deletionPolicyName.equals(NoDeletionPolicy.class.getName())) {
    return NoDeletionPolicy.INSTANCE;
  } else {
    try {
      return Class.forName(deletionPolicyName).asSubclass(IndexDeletionPolicy.class).newInstance();
    } catch (Exception e) {
      throw new RuntimeException("unable to instantiate class '" + deletionPolicyName + "' as IndexDeletionPolicy", e);
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:IndexRevision.java   
/**
 * Constructor over the given {@link IndexWriter}. Uses the last
 * {@link IndexCommit} found in the {@link Directory} managed by the given
 * writer.
 */
public IndexRevision(IndexWriter writer) throws IOException {
  IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();
  if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
    throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");
  }
  this.writer = writer;
  this.sdp = (SnapshotDeletionPolicy) delPolicy;
  this.commit = sdp.snapshot();
  this.version = revisionVersion(commit);
  this.sourceFiles = revisionFiles(commit);
}
项目:hortonworks-extension    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:hortonworks-extension    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:hadoop-gpu    文件:TestMixedDirectory.java   
public void updateIndex(Directory dir, int base, int numDocs,
    IndexDeletionPolicy policy) throws IOException {
  IndexWriter writer =
      new IndexWriter(dir, false, new StandardAnalyzer(), policy);
  writer.setMaxBufferedDocs(maxBufferedDocs);
  writer.setMergeFactor(1000);
  for (int i = 0; i < numDocs; i++) {
    addDoc(writer, base + i);
  }
  writer.close();
}
项目:Elasticsearch    文件:SnapshotDeletionPolicy.java   
/**
 * Constructs a new snapshot deletion policy that wraps the provided deletion policy.
 */
@Inject
public SnapshotDeletionPolicy(@Named("actual") IndexDeletionPolicy primary) {
    super(((IndexShardComponent) primary).shardId(), ((IndexShardComponent) primary).indexSettings());
    this.primary = primary;
}
项目:Elasticsearch    文件:SnapshotDeletionPolicy.java   
@Override
public IndexDeletionPolicy clone() {
   // Lucene IW makes a clone internally but since we hold on to this instance 
   // the clone will just be the identity. See InternalEngine recovery why we need this.
   return this;
}
项目:search    文件:IndexDeletionPolicyWrapper.java   
public IndexDeletionPolicyWrapper(IndexDeletionPolicy deletionPolicy) {
  this.deletionPolicy = deletionPolicy;
}