public class UnassignedInfo extends Object implements ToXContent, Writeable<UnassignedInfo>
Modifier and Type | Class and Description |
---|---|
static class |
UnassignedInfo.Reason
Reason why the shard is in unassigned state.
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static FormatDateTimeFormatter |
DATE_TIME_FORMATTER |
static String |
INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING |
EMPTY_PARAMS
Constructor and Description |
---|
UnassignedInfo(UnassignedInfo.Reason reason,
String message)
creates an UnassingedInfo object based **current** time
|
UnassignedInfo(UnassignedInfo.Reason reason,
String message,
Throwable failure,
long unassignedTimeNanos,
long unassignedTimeMillis) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static long |
findNextDelayedAllocationIn(ClusterState state)
Finds the next (closest) delay expiration of an unassigned shard in nanoseconds.
|
static long |
findSmallestDelayedAllocationSettingNanos(Settings settings,
ClusterState state)
Finds the smallest delay expiration setting in nanos of all unassigned shards that are still delayed.
|
long |
getAllocationDelayTimeoutSettingNanos(Settings settings,
Settings indexSettings)
The allocation delay value in nano seconds associated with the index (defaulting to node settings if not set).
|
String |
getDetails()
Builds a string representation of the message and the failure if exists.
|
Throwable |
getFailure()
Returns additional failure exception details if exists.
|
long |
getLastComputedLeftDelayNanos()
The delay in nanoseconds until this unassigned shard can be reassigned.
|
String |
getMessage()
Returns optional details explaining the reasons.
|
static int |
getNumberOfDelayedUnassigned(ClusterState state)
Returns the number of shards that are unassigned and currently being delayed.
|
UnassignedInfo.Reason |
getReason()
The reason why the shard is unassigned.
|
long |
getUnassignedTimeInMillis()
The timestamp in milliseconds when the shard became unassigned, based on System.currentTimeMillis().
|
long |
getUnassignedTimeInNanos()
The timestamp in nanoseconds when the shard became unassigned, based on System.nanoTime().
|
int |
hashCode() |
UnassignedInfo |
readFrom(StreamInput in)
Reads a copy of an object with the same type form the stream input
The caller object remains unchanged.
|
String |
shortSummary() |
String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
long |
updateDelay(long nanoTimeNow,
Settings settings,
Settings indexSettings)
Updates delay left based on current time (in nanoseconds) and index/node settings.
|
void |
writeTo(StreamOutput out)
Writes the current object into the output stream out
|
public static final FormatDateTimeFormatter DATE_TIME_FORMATTER
public static final String INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING
public UnassignedInfo(UnassignedInfo.Reason reason, String message)
reason
- the cause for making this shard unassigned. See UnassignedInfo.Reason
for more information.message
- more information about cause.public UnassignedInfo(UnassignedInfo.Reason reason, @Nullable String message, @Nullable Throwable failure, long unassignedTimeNanos, long unassignedTimeMillis)
reason
- the cause for making this shard unassigned. See UnassignedInfo.Reason
for more information.message
- more information about cause.failure
- the shard level failure that caused this shard to be unassigned, if exists.unassignedTimeNanos
- the time to use as the base for any delayed re-assignment calculationunassignedTimeMillis
- the time of unassignment used to display to in our reporting.public void writeTo(StreamOutput out) throws IOException
Writeable
writeTo
in interface Writeable<UnassignedInfo>
IOException
public UnassignedInfo readFrom(StreamInput in) throws IOException
StreamableReader
readFrom
in interface StreamableReader<UnassignedInfo>
IOException
public UnassignedInfo.Reason getReason()
public long getUnassignedTimeInMillis()
public long getUnassignedTimeInNanos()
@Nullable public Throwable getFailure()
@Nullable public String getDetails()
public long getAllocationDelayTimeoutSettingNanos(Settings settings, Settings indexSettings)
public long getLastComputedLeftDelayNanos()
updateDelay(long, Settings, Settings)
method.public long updateDelay(long nanoTimeNow, Settings settings, Settings indexSettings)
public static int getNumberOfDelayedUnassigned(ClusterState state)
public static long findSmallestDelayedAllocationSettingNanos(Settings settings, ClusterState state)
public static long findNextDelayedAllocationIn(ClusterState state)
public String shortSummary()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
Copyright © 2009–2017. All rights reserved.