public static RestStatus readFrom(StreamInput in) throws IOException { return RestStatus.valueOf(in.readString()); }
private static SnapshotShardFailure constructSnapshotShardFailure(Object[] args) { String index = (String) args[0]; String indexUuid = (String) args[1]; String nodeId = (String) args[2]; String reason = (String) args[3]; Integer intShardId = (Integer) args[4]; String status = (String) args[5]; if (index == null) { throw new ElasticsearchParseException("index name was not set"); } if (intShardId == null) { throw new ElasticsearchParseException("index shard was not set"); } ShardId shardId = new ShardId(index, indexUuid != null ? indexUuid : IndexMetaData.INDEX_UUID_NA_VALUE, intShardId); // Workaround for https://github.com/elastic/elasticsearch/issues/25878 // Some old snapshot might still have null in shard failure reasons String nonNullReason; if (reason != null) { nonNullReason = reason; } else { nonNullReason = ""; } RestStatus restStatus; if (status != null) { restStatus = RestStatus.valueOf(status); } else { restStatus = RestStatus.INTERNAL_SERVER_ERROR; } return new SnapshotShardFailure(nodeId, shardId, nonNullReason, restStatus); }
nodeId = parser.text(); } else if (STATUS.equals(currentFieldName)) { status = RestStatus.valueOf(parser.text()); } else if (PRIMARY.equals(currentFieldName)) { primary = parser.booleanValue();
public static RestStatus readFrom(StreamInput in) throws IOException { return RestStatus.valueOf(in.readString()); }
public static RestStatus readFrom(StreamInput in) throws IOException { return RestStatus.valueOf(in.readString()); }
public static RestStatus readFrom(StreamInput in) throws IOException { return RestStatus.valueOf(in.readString()); }
public static RestStatus readFrom(StreamInput in) throws IOException { return RestStatus.valueOf(in.readString()); }
private static SnapshotShardFailure constructSnapshotShardFailure(Object[] args) { String index = (String) args[0]; String indexUuid = (String) args[1]; String nodeId = (String) args[2]; String reason = (String) args[3]; Integer intShardId = (Integer) args[4]; String status = (String) args[5]; if (index == null) { throw new ElasticsearchParseException("index name was not set"); } if (intShardId == null) { throw new ElasticsearchParseException("index shard was not set"); } ShardId shardId = new ShardId(index, indexUuid != null ? indexUuid : IndexMetaData.INDEX_UUID_NA_VALUE, intShardId); // Workaround for https://github.com/elastic/elasticsearch/issues/25878 // Some old snapshot might still have null in shard failure reasons String nonNullReason; if (reason != null) { nonNullReason = reason; } else { nonNullReason = ""; } RestStatus restStatus; if (status != null) { restStatus = RestStatus.valueOf(status); } else { restStatus = RestStatus.INTERNAL_SERVER_ERROR; } return new SnapshotShardFailure(nodeId, shardId, nonNullReason, restStatus); }
nodeId = parser.text(); } else if (STATUS.equals(currentFieldName)) { status = RestStatus.valueOf(parser.text()); } else if (PRIMARY.equals(currentFieldName)) { primary = parser.booleanValue();
snapshotShardFailure.shardId = parser.intValue(); } else if ("status".equals(currentFieldName)) { snapshotShardFailure.status = RestStatus.valueOf(parser.text()); } else { throw new ElasticsearchParseException("unknown parameter [{}]", currentFieldName);
nodeId = parser.text(); } else if (STATUS.equals(currentFieldName)) { status = RestStatus.valueOf(parser.text()); } else if (PRIMARY.equals(currentFieldName)) { primary = parser.booleanValue();
shardId = parser.intValue(); } else if ("status".equals(currentFieldName)) { snapshotShardFailure.status = RestStatus.valueOf(parser.text()); } else { throw new ElasticsearchParseException("unknown parameter [{}]", currentFieldName);
nodeId = parser.text(); } else if (STATUS.equals(currentFieldName)) { status = RestStatus.valueOf(parser.text()); } else if (PRIMARY.equals(currentFieldName)) { primary = parser.booleanValue();