Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store index creation time in index metadata #7218

Merged
merged 1 commit into from Aug 12, 2014

Conversation

Projects
None yet
4 participants
@colings86
Copy link
Member

commented Aug 11, 2014

This change stores the index creation time in the index metadata when an index is created. The creation time cannot be changed but can be set as part of the create index request to allow for correct creation times for historical data.

Closes #7119

@dadoonet

This comment has been minimized.

Copy link
Member

commented Aug 11, 2014

Although my comment is not directly related to the PR, I think that if we can also support last_update metadata, it would give us some new features to detect cold indices for examples and create some rules in the future such as:

  • Automatically close indices which has not been updated for 2 months
  • Automatically optimize cold indices (no update in the last 3 days)

Related to #3933

@colings86 colings86 added the review label Aug 12, 2014

@colings86 colings86 self-assigned this Aug 12, 2014

@jpountz

View changes

src/main/java/org/elasticsearch/cluster/ClusterState.java Outdated
@@ -363,6 +363,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws

builder.field("state", indexMetaData.state().toString().toLowerCase(Locale.ENGLISH));

builder.field("creation_date", indexMetaData.creationDate());

This comment has been minimized.

Copy link
@jpountz

jpountz Aug 12, 2014

Contributor

I think it should rather be part of the index meta data settings? (like the created version and the uuid?)

@jpountz jpountz removed the review label Aug 12, 2014

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2014

Left one comment but other than that it looks good to me.

@jpountz

View changes

src/main/java/org/elasticsearch/cluster/metadata/IndexMetaData.java Outdated
@@ -556,6 +574,7 @@ public static void toXContent(IndexMetaData indexMetaData, XContentBuilder build
builder.startObject(indexMetaData.index(), XContentBuilder.FieldCaseConversion.NONE);

builder.field("version", indexMetaData.version());
builder.field("creation_date", indexMetaData.creationDate());

This comment has been minimized.

Copy link
@jpountz

jpountz Aug 12, 2014

Contributor

I don't think it is needed, it will be serialized as part of the settings?

Core: Store index creation time in index metadata
This change stores the index creation time in the index metadata when an index is created.  The creation time cannot be changed but can be set as part of the create index request to allow for correct creation times for historical data.

Closes #7119

@colings86 colings86 merged commit 2906d3e into elastic:master Aug 12, 2014

@colings86 colings86 deleted the colings86:fix/7119 branch Aug 13, 2014

@jpountz jpountz removed the review label Aug 18, 2014

@colings86 colings86 assigned colings86 and unassigned colings86 Aug 21, 2014

@clintongormley clintongormley changed the title Core: Store index creation time in index metadata Internal: Store index creation time in index metadata Sep 10, 2014

@clintongormley clintongormley changed the title Internal: Store index creation time in index metadata Store index creation time in index metadata Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.