[ 
https://issues.apache.org/jira/browse/BLUR-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743145#comment-13743145
 ] 

Rahul Challapalli commented on BLUR-132:
----------------------------------------

Hi Aaron,

The code for BlurNRTIndex also looks straight forward except for how to persist 
snapshots during JVM crashes or shard server restarts. We need to persist 
(snapshotname => segmentFileName) map at the shard level. I came across 
PersistentSnapshotDeletionPolicy(PSDP) which stores this info in a Lucene 
Directory. If we want to use this we would require another lucene 
directory(snapshots) per shard. Advise? Pasting code from PSDP which stores 
this map into the new lucene directory.

private void persistSnapshotInfos(String id, String segment) throws IOException 
{
  writer.deleteAll();
  Document d = new Document();
  d.add(new Field(SNAPSHOTS_ID, "", Store.YES, Index.NO));
  for (Entry<String, String> e : super.getSnapshots().entrySet()) {
    d.add(new Field(e.getKey(), e.getValue(), Store.YES, Index.NO));
  }
  if (id != null) {
    d.add(new Field(id, segment, Store.YES, Index.NO));
  }
  writer.addDocument(d);
  writer.commit();
}

- Rahul
                
> Create Index Snapshots
> ----------------------
>
>                 Key: BLUR-132
>                 URL: https://issues.apache.org/jira/browse/BLUR-132
>             Project: Apache Blur
>          Issue Type: New Feature
>    Affects Versions: 0.3.0
>            Reporter: Aaron McCurry
>             Fix For: 0.3.0
>
>         Attachments: Blur-132-part1.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to