File tree 4 files changed +12
-4
lines changed
libs/x-content/src/main/java/org/opensearch/common/xcontent 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ public class CborXContent implements XContent {
63
63
System .getProperty ("opensearch.xcontent.string.length.max" , Integer .toString (Integer .MAX_VALUE ) /* no limit */ )
64
64
);
65
65
66
+ public static final boolean USE_FAST_DOUBLE_WRITER = Boolean .getBoolean ("opensearch.xcontent.use_fast_double_writer" );
67
+
66
68
public static XContentBuilder contentBuilder () throws IOException {
67
69
return XContentBuilder .builder (cborXContent );
68
70
}
@@ -78,7 +80,7 @@ public static XContentBuilder contentBuilder() throws IOException {
78
80
cborFactory .configure (JsonParser .Feature .STRICT_DUPLICATE_DETECTION , true );
79
81
cborFactory .setStreamReadConstraints (StreamReadConstraints .builder ().maxStringLength (DEFAULT_MAX_STRING_LEN ).build ());
80
82
cborFactory .configure (StreamReadFeature .USE_FAST_DOUBLE_PARSER .mappedFeature (), true );
81
- cborFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), Boolean . getBoolean ( "fast_double_writer.enabled" ) );
83
+ cborFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), USE_FAST_DOUBLE_WRITER );
82
84
cborXContent = new CborXContent ();
83
85
}
84
86
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ public class JsonXContent implements XContent {
62
62
System .getProperty ("opensearch.xcontent.string.length.max" , Integer .toString (Integer .MAX_VALUE ) /* no limit */ )
63
63
);
64
64
65
+ public static final boolean USE_FAST_DOUBLE_WRITER = Boolean .getBoolean ("opensearch.xcontent.use_fast_double_writer" );
66
+
65
67
public static XContentBuilder contentBuilder () throws IOException {
66
68
return XContentBuilder .builder (jsonXContent );
67
69
}
@@ -80,7 +82,7 @@ public static XContentBuilder contentBuilder() throws IOException {
80
82
jsonFactory .configure (JsonParser .Feature .STRICT_DUPLICATE_DETECTION , true );
81
83
jsonFactory .setStreamReadConstraints (StreamReadConstraints .builder ().maxStringLength (DEFAULT_MAX_STRING_LEN ).build ());
82
84
jsonFactory .configure (StreamReadFeature .USE_FAST_DOUBLE_PARSER .mappedFeature (), true );
83
- jsonFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), Boolean . getBoolean ( "fast_double_writer.enabled" ) );
85
+ jsonFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), USE_FAST_DOUBLE_WRITER );
84
86
jsonXContent = new JsonXContent ();
85
87
}
86
88
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ public class SmileXContent implements XContent {
63
63
System .getProperty ("opensearch.xcontent.string.length.max" , Integer .toString (Integer .MAX_VALUE ) /* no limit */ )
64
64
);
65
65
66
+ public static final boolean USE_FAST_DOUBLE_WRITER = Boolean .getBoolean ("opensearch.xcontent.use_fast_double_writer" );
67
+
66
68
public static XContentBuilder contentBuilder () throws IOException {
67
69
return XContentBuilder .builder (smileXContent );
68
70
}
@@ -80,7 +82,7 @@ public static XContentBuilder contentBuilder() throws IOException {
80
82
smileFactory .configure (JsonParser .Feature .STRICT_DUPLICATE_DETECTION , true );
81
83
smileFactory .setStreamReadConstraints (StreamReadConstraints .builder ().maxStringLength (DEFAULT_MAX_STRING_LEN ).build ());
82
84
smileFactory .configure (StreamReadFeature .USE_FAST_DOUBLE_PARSER .mappedFeature (), true );
83
- smileFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), Boolean . getBoolean ( "fast_double_writer.enabled" ) );
85
+ smileFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), USE_FAST_DOUBLE_WRITER );
84
86
smileXContent = new SmileXContent ();
85
87
}
86
88
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ public class YamlXContent implements XContent {
61
61
System .getProperty ("opensearch.xcontent.string.length.max" , Integer .toString (Integer .MAX_VALUE ) /* no limit */ )
62
62
);
63
63
64
+ public static final boolean USE_FAST_DOUBLE_WRITER = Boolean .getBoolean ("opensearch.xcontent.use_fast_double_writer" );
65
+
64
66
public static XContentBuilder contentBuilder () throws IOException {
65
67
return XContentBuilder .builder (yamlXContent );
66
68
}
@@ -73,7 +75,7 @@ public static XContentBuilder contentBuilder() throws IOException {
73
75
yamlFactory .configure (JsonParser .Feature .STRICT_DUPLICATE_DETECTION , true );
74
76
yamlFactory .setStreamReadConstraints (StreamReadConstraints .builder ().maxStringLength (DEFAULT_MAX_STRING_LEN ).build ());
75
77
yamlFactory .configure (StreamReadFeature .USE_FAST_DOUBLE_PARSER .mappedFeature (), true );
76
- yamlFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), Boolean . getBoolean ( "fast_double_writer.enabled" ) );
78
+ yamlFactory .configure (StreamWriteFeature .USE_FAST_DOUBLE_WRITER .mappedFeature (), USE_FAST_DOUBLE_WRITER );
77
79
yamlXContent = new YamlXContent ();
78
80
}
79
81
You can’t perform that action at this time.
0 commit comments