/** * Returns the {@link AllocationDecision} denoting the result of an allocation attempt. * If {@link #isDecisionTaken()} returns {@code false}, then invoking this method will * throw an {@code IllegalStateException}. */ public AllocationDecision getAllocationDecision() { checkDecisionState(); return AllocationDecision.fromAllocationStatus(allocationStatus); }
private XContentBuilder unassignedInfoToXContent(UnassignedInfo unassignedInfo, XContentBuilder builder) throws IOException { builder.startObject("unassigned_info"); builder.field("reason", unassignedInfo.getReason()); builder.field("at", UnassignedInfo.DATE_TIME_FORMATTER.format(Instant.ofEpochMilli(unassignedInfo.getUnassignedTimeInMillis()))); if (unassignedInfo.getNumFailedAllocations() > 0) { builder.field("failed_allocation_attempts", unassignedInfo.getNumFailedAllocations()); } String details = unassignedInfo.getDetails(); if (details != null) { builder.field("details", details); } builder.field("last_allocation_status", AllocationDecision.fromAllocationStatus(unassignedInfo.getLastAllocationStatus())); builder.endObject(); return builder; } }
/** * Returns the {@link AllocationDecision} denoting the result of an allocation attempt. * If {@link #isDecisionTaken()} returns {@code false}, then invoking this method will * throw an {@code IllegalStateException}. */ public AllocationDecision getAllocationDecision() { checkDecisionState(); return AllocationDecision.fromAllocationStatus(allocationStatus); }
/** * Returns the {@link AllocationDecision} denoting the result of an allocation attempt. * If {@link #isDecisionTaken()} returns {@code false}, then invoking this method will * throw an {@code IllegalStateException}. */ public AllocationDecision getAllocationDecision() { checkDecisionState(); return AllocationDecision.fromAllocationStatus(allocationStatus); }
/** * Returns the {@link AllocationDecision} denoting the result of an allocation attempt. * If {@link #isDecisionTaken()} returns {@code false}, then invoking this method will * throw an {@code IllegalStateException}. */ public AllocationDecision getAllocationDecision() { checkDecisionState(); return AllocationDecision.fromAllocationStatus(allocationStatus); }
private XContentBuilder unassignedInfoToXContent(UnassignedInfo unassignedInfo, XContentBuilder builder) throws IOException { builder.startObject("unassigned_info"); builder.field("reason", unassignedInfo.getReason()); builder.field("at", UnassignedInfo.DATE_TIME_FORMATTER.printer().print(unassignedInfo.getUnassignedTimeInMillis())); if (unassignedInfo.getNumFailedAllocations() > 0) { builder.field("failed_allocation_attempts", unassignedInfo.getNumFailedAllocations()); } String details = unassignedInfo.getDetails(); if (details != null) { builder.field("details", details); } builder.field("last_allocation_status", AllocationDecision.fromAllocationStatus(unassignedInfo.getLastAllocationStatus())); builder.endObject(); return builder; } }
private XContentBuilder unassignedInfoToXContent(UnassignedInfo unassignedInfo, XContentBuilder builder) throws IOException { builder.startObject("unassigned_info"); builder.field("reason", unassignedInfo.getReason()); builder.field("at", UnassignedInfo.DATE_TIME_FORMATTER.format(Instant.ofEpochMilli(unassignedInfo.getUnassignedTimeInMillis()))); if (unassignedInfo.getNumFailedAllocations() > 0) { builder.field("failed_allocation_attempts", unassignedInfo.getNumFailedAllocations()); } String details = unassignedInfo.getDetails(); if (details != null) { builder.field("details", details); } builder.field("last_allocation_status", AllocationDecision.fromAllocationStatus(unassignedInfo.getLastAllocationStatus())); builder.endObject(); return builder; } }
private XContentBuilder unassignedInfoToXContent(UnassignedInfo unassignedInfo, XContentBuilder builder) throws IOException { builder.startObject("unassigned_info"); builder.field("reason", unassignedInfo.getReason()); builder.field("at", UnassignedInfo.DATE_TIME_FORMATTER.printer().print(unassignedInfo.getUnassignedTimeInMillis())); if (unassignedInfo.getNumFailedAllocations() > 0) { builder.field("failed_allocation_attempts", unassignedInfo.getNumFailedAllocations()); } String details = unassignedInfo.getDetails(); if (details != null) { builder.field("details", details); } builder.field("last_allocation_status", AllocationDecision.fromAllocationStatus(unassignedInfo.getLastAllocationStatus())); builder.endObject(); return builder; } }