-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Remove types from Monitoring plugin "backend" code #37745
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
Changes from all commits
2cd4b9b
d824964
9d00b79
f691585
da1a299
abd8699
33fe139
669f294
b7eaeb8
ab9c7ae
8876abe
9bcc095
df335e3
8f41a4b
79e7eed
c6d1c10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ | |
import org.elasticsearch.license.License; | ||
import org.elasticsearch.plugins.Plugin; | ||
import org.elasticsearch.rest.RestStatus; | ||
import org.elasticsearch.rest.action.document.RestBulkAction; | ||
import org.elasticsearch.search.SearchHit; | ||
import org.elasticsearch.search.SearchHits; | ||
import org.elasticsearch.search.collapse.CollapseBuilder; | ||
|
@@ -104,11 +103,11 @@ protected Collection<Class<? extends Plugin>> getPlugins() { | |
} | ||
|
||
private String createBulkEntity() { | ||
return "{\"index\":{\"_type\":\"test\"}}\n" + | ||
return "{\"index\":{}}\n" + | ||
"{\"foo\":{\"bar\":0}}\n" + | ||
"{\"index\":{\"_type\":\"test\"}}\n" + | ||
"{\"index\":{}}\n" + | ||
"{\"foo\":{\"bar\":1}}\n" + | ||
"{\"index\":{\"_type\":\"test\"}}\n" + | ||
"{\"index\":{}}\n" + | ||
"{\"foo\":{\"bar\":2}}\n" + | ||
"\n"; | ||
} | ||
|
@@ -127,7 +126,7 @@ public void testMonitoringBulk() throws Exception { | |
|
||
final MonitoringBulkResponse bulkResponse = | ||
new MonitoringBulkRequestBuilder(client()) | ||
.add(system, null, new BytesArray(createBulkEntity().getBytes("UTF-8")), XContentType.JSON, | ||
.add(system, "monitoring_data_type", new BytesArray(createBulkEntity().getBytes("UTF-8")), XContentType.JSON, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add in a default type here ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pickypg can correct me if I'm wrong but I believe this argument is the monitoring data type, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are. We use that as a mechanism for routing the document to the right index. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks, i see now. |
||
System.currentTimeMillis(), interval.millis()) | ||
.get(); | ||
|
||
|
@@ -178,10 +177,9 @@ public void testMonitoringBulk() throws Exception { | |
equalTo(1L)); | ||
|
||
for (final SearchHit hit : hits.getHits()) { | ||
assertMonitoringDoc(toMap(hit), system, "test", interval); | ||
assertMonitoringDoc(toMap(hit), system, "monitoring_data_type", interval); | ||
} | ||
}); | ||
assertWarnings(RestBulkAction.TYPES_DEPRECATION_MESSAGE); | ||
} | ||
|
||
/** | ||
|
@@ -264,7 +262,6 @@ private void assertMonitoringDoc(final Map<String, Object> document, | |
|
||
final String index = (String) document.get("_index"); | ||
assertThat(index, containsString(".monitoring-" + expectedSystem.getSystem() + "-" + TEMPLATE_VERSION + "-")); | ||
assertThat(document.get("_type"), equalTo("doc")); | ||
assertThat((String) document.get("_id"), not(isEmptyOrNullString())); | ||
|
||
final Map<String, Object> source = (Map<String, Object>) document.get("_source"); | ||
|
Uh oh!
There was an error while loading. Please reload this page.