@Override public String toString() { StringBuilder builder = new StringBuilder(); if (metadata.containsKey(INDEX_METADATA_KEY)) { builder.append(getIndex()); if (metadata.containsKey(SHARD_METADATA_KEY)) { builder.append('[').append(getShardId()).append(']'); } builder.append(' '); } return builder.append(ExceptionsHelper.detailedMessage(this).trim()).toString(); }
public ShardId getShardId() { List<String> shard = getMetadata(SHARD_METADATA_KEY); if (shard != null && shard.isEmpty() == false) { return new ShardId(getIndex(), Integer.parseInt(shard.get(0))); } return null; }
GroupBy(ShardOperationFailedException failure) { Throwable cause = failure.getCause(); //the index name from the failure contains the cluster alias when using CCS. Ideally failures should be grouped by //index name and cluster alias. That's why the failure index name has the precedence over the one coming from the cause, //which does not include the cluster alias. String indexName = failure.index(); if (indexName == null) { if (cause instanceof ElasticsearchException) { final Index index = ((ElasticsearchException) cause).getIndex(); if (index != null) { indexName = index.getName(); } } } this.index = indexName; this.reason = cause.getMessage(); this.causeType = cause.getClass(); }
public GroupBy(Throwable t) { if (t instanceof ElasticsearchException) { index = ((ElasticsearchException) t).getIndex(); } else { index = null; } reason = t.getMessage(); causeType = t.getClass(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); if (metadata.containsKey(INDEX_METADATA_KEY)) { builder.append(getIndex()); if (metadata.containsKey(SHARD_METADATA_KEY)) { builder.append('[').append(getShardId()).append(']'); } builder.append(' '); } return builder.append(ExceptionsHelper.detailedMessage(this).trim()).toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); if (metadata.containsKey(INDEX_METADATA_KEY)) { builder.append(getIndex()); if (metadata.containsKey(SHARD_METADATA_KEY)) { builder.append('[').append(getShardId()).append(']'); } builder.append(' '); } return builder.append(ExceptionsHelper.detailedMessage(this).trim()).toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); if (headers.containsKey(INDEX_HEADER_KEY)) { builder.append('[').append(getIndex()).append(']'); if (headers.containsKey(SHARD_HEADER_KEY)) { builder.append('[').append(getShardId()).append(']'); } builder.append(' '); } return builder.append(ExceptionsHelper.detailedMessage(this).trim()).toString(); }
GroupBy(Throwable t) { if (t instanceof ElasticsearchException) { final Index index = ((ElasticsearchException) t).getIndex(); if (index != null) { this.index = index.getName(); } else { this.index = null; } } else { index = null; } reason = t.getMessage(); causeType = t.getClass(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); if (metadata.containsKey(INDEX_METADATA_KEY)) { builder.append(getIndex()); if (metadata.containsKey(SHARD_METADATA_KEY)) { builder.append('[').append(getShardId()).append(']'); } builder.append(' '); } return builder.append(ExceptionsHelper.detailedMessage(this).trim()).toString(); }
public ShardId getShardId() { List<String> shard = getMetadata(SHARD_METADATA_KEY); if (shard != null && shard.isEmpty() == false) { return new ShardId(getIndex(), Integer.parseInt(shard.get(0))); } return null; }
public ShardId getShardId() { List<String> shard = getMetadata(SHARD_METADATA_KEY); if (shard != null && shard.isEmpty() == false) { return new ShardId(getIndex(), Integer.parseInt(shard.get(0))); } return null; }
public ShardId getShardId() { List<String> shard = getHeader(SHARD_HEADER_KEY); if (shard != null && shard.isEmpty() == false) { return new ShardId(getIndex(), Integer.parseInt(shard.get(0))); } return null; }
public ShardId getShardId() { List<String> shard = getMetadata(SHARD_METADATA_KEY); if (shard != null && shard.isEmpty() == false) { return new ShardId(getIndex(), Integer.parseInt(shard.get(0))); } return null; }
public DefaultShardOperationFailedException(ElasticsearchException e) { Index index = e.getIndex(); this.index = index == null ? null : index.getName(); ShardId shardId = e.getShardId(); this.shardId = shardId == null ? -1 : shardId.id(); this.reason = e; this.status = e.status(); }
GroupBy(ShardOperationFailedException failure) { Throwable cause = failure.getCause(); //the index name from the failure contains the cluster alias when using CCS. Ideally failures should be grouped by //index name and cluster alias. That's why the failure index name has the precedence over the one coming from the cause, //which does not include the cluster alias. String indexName = failure.index(); if (indexName == null) { if (cause instanceof ElasticsearchException) { final Index index = ((ElasticsearchException) cause).getIndex(); if (index != null) { indexName = index.getName(); } } } this.index = indexName; this.reason = cause.getMessage(); this.causeType = cause.getClass(); }
GroupBy(ShardOperationFailedException failure) { Throwable cause = failure.getCause(); //the index name from the failure contains the cluster alias when using CCS. Ideally failures should be grouped by //index name and cluster alias. That's why the failure index name has the precedence over the one coming from the cause, //which does not include the cluster alias. String indexName = failure.index(); if (indexName == null) { if (cause instanceof ElasticsearchException) { final Index index = ((ElasticsearchException) cause).getIndex(); if (index != null) { indexName = index.getName(); } } } this.index = indexName; if (cause == null) { this.reason = failure.reason(); this.causeType = null; } else { this.reason = cause.getMessage(); this.causeType = cause.getClass(); } }
public DefaultShardOperationFailedException(ElasticsearchException e) { this.index = e.getIndex(); this.shardId = e.getShardId().id(); this.reason = e; this.status = e.status(); }