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

Add shadow indicator when using shadow replicas #12399

Merged
merged 1 commit into from Jul 23, 2015

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Jul 22, 2015

Very simple PR that changes:

[2015-07-22 09:42:44,088][INFO ][org.elasticsearch.cluster.metadata] [node_t0] [test] creating index, cause [api], templates [], shards [1]/[1], mappings [doc]

Into:

[2015-07-22 09:42:44,088][INFO ][org.elasticsearch.cluster.metadata] [node_t0] [test] creating index, cause [api], templates [], shards [1]/[1s], mappings [doc]

When shadow replicas are used.

String maybeShadowIndicator = IndexMetaData.isIndexUsingShadowReplicas(indexMetaData.settings()) ? "s" : "";
logger.info("[{}] creating index, cause [{}], templates {}, shards [{}]/[{}], mappings {}",
request.index(), request.cause(), templateNames, indexMetaData.numberOfShards(),
indexMetaData.numberOfReplicas() + maybeShadowIndicator,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't you do {}{} and indexMetaData.numberOfReplicas(), maybeShadowIndicator instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, that's probably better than string concatenation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed another commit for this

@kimchy
Copy link
Member

kimchy commented Jul 23, 2015

LGTM

@bleskes
Copy link
Contributor

bleskes commented Jul 23, 2015

+1

@clintongormley clintongormley added >enhancement :Core/Infra/Logging Log management and logging utilities labels Jul 23, 2015
@dakrone dakrone merged commit 1807916 into elastic:master Jul 23, 2015
@dakrone dakrone deleted the log-shadow-replicas branch August 7, 2015 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants