Skip to content

Commit

Permalink
Turn off the formatter for all sections which were
Browse files Browse the repository at this point in the history
wrapped for better doc display
  • Loading branch information
olcbean committed Feb 15, 2018
1 parent 432b659 commit dda7951
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void testClusterPutSettings() throws IOException {
ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest();
// end::put-settings-request

// @formatter:off
// tag::put-settings-create-settings
String transientSettingKey =
RecoverySettings.INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey();
Expand All @@ -81,34 +82,41 @@ public void testClusterPutSettings() throws IOException {
.put(persistentSettingKey, persistentSettingValue)
.build(); // <2>
// end::put-settings-create-settings
// @formatter:on

// tag::put-settings-request-cluster-settings
request.transientSettings(transientSettings); // <1>
request.persistentSettings(persistentSettings); // <2>
// end::put-settings-request-cluster-settings

{
// @formatter:off
// tag::put-settings-settings-builder
Settings.Builder transientSettingsBuilder =
Settings.builder()
.put(transientSettingKey, transientSettingValue, ByteSizeUnit.BYTES);
request.transientSettings(transientSettingsBuilder); // <1>
// end::put-settings-settings-builder
// @formatter:on
}
{
// @formatter:off
// tag::put-settings-settings-map
Map<String, Object> map = new HashMap<>();
map.put(transientSettingKey
, transientSettingValue + ByteSizeUnit.BYTES.getSuffix());
request.transientSettings(map); // <1>
// end::put-settings-settings-map
// @formatter:on
}
{
// @formatter:off
// tag::put-settings-settings-source
request.transientSettings(
"{\"indices.recovery.max_bytes_per_sec\": \"10b\"}"
, XContentType.JSON); // <1>
// end::put-settings-settings-source
// @formatter:on
}

// tag::put-settings-request-timeout
Expand Down Expand Up @@ -151,6 +159,7 @@ public void testClusterUpdateSettingsAsync() throws Exception {
{
ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest();

//@formatter:off
// tag::put-settings-execute-listener
ActionListener<ClusterUpdateSettingsResponse> listener =
new ActionListener<ClusterUpdateSettingsResponse>() {
Expand All @@ -165,6 +174,7 @@ public void onFailure(Exception e) {
}
};
// end::put-settings-execute-listener
//@formatter:on

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
Expand Down

0 comments on commit dda7951

Please sign in to comment.