public final class RandomObjects
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static org.elasticsearch.common.collect.Tuple<org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo,org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo> |
randomShardInfo(java.util.Random random)
Returns a tuple that contains a randomized
ReplicationResponse.ShardInfo value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser) . |
static org.elasticsearch.common.collect.Tuple<org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo,org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo> |
randomShardInfo(java.util.Random random,
boolean withShardFailures)
Returns a tuple that contains a randomized
ReplicationResponse.ShardInfo value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser) . |
static org.elasticsearch.common.bytes.BytesReference |
randomSource(java.util.Random random)
Returns a random source containing a random number of fields, objects and array, with maximum depth 5.
|
static org.elasticsearch.common.bytes.BytesReference |
randomSource(java.util.Random random,
org.elasticsearch.common.xcontent.XContentType xContentType)
Returns a random source in a given XContentType containing a random number of fields, objects and array, with maximum depth 5.
|
static org.elasticsearch.common.bytes.BytesReference |
randomSource(java.util.Random random,
org.elasticsearch.common.xcontent.XContentType xContentType,
int minNumFields)
Returns a random source in a given XContentType containing a random number of fields, objects and array, with maximum depth 5.
|
static org.elasticsearch.common.collect.Tuple<java.util.List<java.lang.Object>,java.util.List<java.lang.Object>> |
randomStoredFieldValues(java.util.Random random,
org.elasticsearch.common.xcontent.XContentType xContentType)
Returns a tuple containing random stored field values and their corresponding expected values once printed out
via
ToXContent.toXContent(XContentBuilder, ToXContent.Params) and parsed back via
XContentParser.objectText() . |
public static org.elasticsearch.common.collect.Tuple<java.util.List<java.lang.Object>,java.util.List<java.lang.Object>> randomStoredFieldValues(java.util.Random random, org.elasticsearch.common.xcontent.XContentType xContentType)
ToXContent.toXContent(XContentBuilder, ToXContent.Params)
and parsed back via
XContentParser.objectText()
.
Generates values based on what can get printed out. Stored fields values are retrieved from lucene and converted via
MappedFieldType.valueForDisplay(Object)
to either strings, numbers or booleans.random
- Random generatorxContentType
- the content type, used to determine what the expected values are for float numbers.public static org.elasticsearch.common.bytes.BytesReference randomSource(java.util.Random random)
random
- Random generatorpublic static org.elasticsearch.common.bytes.BytesReference randomSource(java.util.Random random, org.elasticsearch.common.xcontent.XContentType xContentType)
random
- Random generatorpublic static org.elasticsearch.common.bytes.BytesReference randomSource(java.util.Random random, org.elasticsearch.common.xcontent.XContentType xContentType, int minNumFields)
random
- Random generatorpublic static org.elasticsearch.common.collect.Tuple<org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo,org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo> randomShardInfo(java.util.Random random)
ReplicationResponse.ShardInfo
value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent
and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser)
. The ShardInfo randomly contains shard failures.random
- Random generatorpublic static org.elasticsearch.common.collect.Tuple<org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo,org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo> randomShardInfo(java.util.Random random, boolean withShardFailures)
ReplicationResponse.ShardInfo
value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent
and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser)
. A `withShardFailures` parameter indicates if
the randomized ShardInfo must or must not contain shard failures.random
- Random generatorwithShardFailures
- indicates if the generated ShardInfo must contain shard failures