# Which class file trigger writing of segments.gen / segments\_1

**URL:** <https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528>\
**Category:** Elasticsearch\
**Created:** [August 29, 2014, 12:38pm UTC](https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528 "2014-08-29T12:38:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [August 29, 2014, 12:38pm UTC](https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528/1 "2014-08-29T12:38:30Z")

</div>

Hello people,

Anybody know which class/component in elastic search trigger writing  
of segments.gen and segments\_1? I'm currently using elastic search version  
1.2.1. It would be great if you can provide link pin point which line in  
the class does that.

Thank you.

/Jason

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 29, 2014, 12:49pm UTC](https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528/2 "2014-08-29T12:49:55Z")

</div>

This is Lucene, when indexing starts. Look at the SegmentsInfo class  
[https://lucene.apache.org/core/4\_9\_0/core/org/apache/lucene/index/SegmentInfos.html](https://lucene.apache.org/core/4_9_0/core/org/apache/lucene/index/SegmentInfos.html)

Jörg

On Fri, Aug 29, 2014 at 2:38 PM, Jason Wee [peichieh@gmail.com](mailto:peichieh@gmail.com) wrote:

> Hello people,
> 
> Anybody know which class/component in Elasticsearch trigger writing  
> of segments.gen and segments\_1? I'm currently using Elasticsearch version  
> 1.2.1. It would be great if you can provide link pin point which line in  
> the class does that.
> 
> Thank you.
> 
> /Jason
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [August 29, 2014, 3:30pm UTC](https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528/3 "2014-08-29T15:30:12Z")

</div>

Thanks Jörg,

read this link  
[https://lucene.apache.org/core/4\_8\_1/core/org/apache/lucene/index/SegmentInfos.html](https://lucene.apache.org/core/4_8_1/core/org/apache/lucene/index/SegmentInfos.html)  
, very informative.

Found a few spots that call the class SegmentInfos, below are them.

> <https://github.com/elastic/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java>

> <https://github.com/elastic/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/common/lucene/Lucene.java>

> <https://github.com/elastic/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java>

> <https://github.com/elastic/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/merge/policy/ElasticsearchMergePolicy.java>

> <https://github.com/elastic/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardRepository.java>

I understand that both segments file are written by Lucene but during  
index, do you know which class in elasticsearch that eventually lead to  
trigger the underlying writing of segments file?

/Jason

On Fri, Aug 29, 2014 at 8:49 PM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
[joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:

> This is Lucene, when indexing starts. Look at the SegmentsInfo class  
> [SegmentInfos (Lucene 4.9.0 API)](https://lucene.apache.org/core/4_9_0/core/org/apache/lucene/index/SegmentInfos.html)
> 
> Jörg
> 
> On Fri, Aug 29, 2014 at 2:38 PM, Jason Wee [peichieh@gmail.com](mailto:peichieh@gmail.com) wrote:
> 
> > Hello people,
> > 
> > Anybody know which class/component in Elasticsearch trigger writing  
> > of segments.gen and segments\_1? I'm currently using Elasticsearch version  
> > 1.2.1. It would be great if you can provide link pin point which line in  
> > the class does that.
> > 
> > Thank you.
> > 
> > /Jason
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHO4itx9BQfQN2f0JLwwUi4kKupohF1Otxh1\_s31t40QeZbcPg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHO4itx9BQfQN2f0JLwwUi4kKupohF1Otxh1_s31t40QeZbcPg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 29, 2014, 4:07pm UTC](https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528/4 "2014-08-29T16:07:38Z")

</div>

All the classes in ES that create documents and indices are able to be  
involved into calling SegmentInfos.

Jörg

On Fri, Aug 29, 2014 at 5:30 PM, Jason Wee [peichieh@gmail.com](mailto:peichieh@gmail.com) wrote:

> Thanks Jörg,
> 
> read this link  
> [SegmentInfos (Lucene 4.8.1 API)](https://lucene.apache.org/core/4_8_1/core/org/apache/lucene/index/SegmentInfos.html)  
> , very informative.
> 
> Found a few spots that call the class SegmentInfos, below are them.
> 
> [https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java](https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java)
> 
> [https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/common/lucene/Lucene.java](https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/common/lucene/Lucene.java)
> 
> [https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java](https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java)
> 
> [https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/merge/policy/ElasticsearchMergePolicy.java](https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/merge/policy/ElasticsearchMergePolicy.java)
> 
> [https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardRepository.java](https://github.com/elasticsearch/elasticsearch/blob/v1.2.1/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardRepository.java)
> 
> I understand that both segments file are written by Lucene but during  
> index, do you know which class in elasticsearch that eventually lead to  
> trigger the underlying writing of segments file?
> 
> /Jason
> 
> On Fri, Aug 29, 2014 at 8:49 PM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
> [joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:
> 
> > This is Lucene, when indexing starts. Look at the SegmentsInfo class  
> > [SegmentInfos (Lucene 4.9.0 API)](https://lucene.apache.org/core/4_9_0/core/org/apache/lucene/index/SegmentInfos.html)
> > 
> > Jörg
> > 
> > On Fri, Aug 29, 2014 at 2:38 PM, Jason Wee [peichieh@gmail.com](mailto:peichieh@gmail.com) wrote:
> > 
> > > Hello people,
> > > 
> > > Anybody know which class/component in Elasticsearch trigger writing  
> > > of segments.gen and segments\_1? I'm currently using Elasticsearch version  
> > > 1.2.1. It would be great if you can provide link pin point which line in  
> > > the class does that.
> > > 
> > > Thank you.
> > > 
> > > /Jason
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bdfc3860-cb26-4f21-9597-4f500eb950e2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG%3Ddauci86-7Y-RaN%2BJW94kqXU%3DwTA3kgxLO5Mj%3DLL0aQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAHO4itx9BQfQN2f0JLwwUi4kKupohF1Otxh1\_s31t40QeZbcPg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHO4itx9BQfQN2f0JLwwUi4kKupohF1Otxh1_s31t40QeZbcPg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAHO4itx9BQfQN2f0JLwwUi4kKupohF1Otxh1\_s31t40QeZbcPg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHO4itx9BQfQN2f0JLwwUi4kKupohF1Otxh1_s31t40QeZbcPg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEeVZS76RDc-goD6C1L04csNc-LiaxfbQsJ5PQvAkUz%2Bg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEeVZS76RDc-goD6C1L04csNc-LiaxfbQsJ5PQvAkUz%2Bg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:05am UTC](https://discuss.elastic.co/t/which-class-file-trigger-writing-of-segments-gen-segments-1/19528/5 "2017-07-06T01:05:27Z")

</div>


