当前位置: 首页>>代码示例>>Java>>正文


Java ElasticsearchException.generateThrowableXContent方法代码示例

本文整理汇总了Java中org.elasticsearch.ElasticsearchException.generateThrowableXContent方法的典型用法代码示例。如果您正苦于以下问题:Java ElasticsearchException.generateThrowableXContent方法的具体用法?Java ElasticsearchException.generateThrowableXContent怎么用?Java ElasticsearchException.generateThrowableXContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.ElasticsearchException的用法示例。


在下文中一共展示了ElasticsearchException.generateThrowableXContent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject();
    if (index != null) {
        builder.field("index", index);
    }
    if (shardId != null) {
        builder.field("shard", shardId);
    }
    if (nodeId != null) {
        builder.field("node", nodeId);
    }
    builder.field("reason");
    {
        builder.startObject();
        ElasticsearchException.generateThrowableXContent(builder, params, reason);
        builder.endObject();
    }
    builder.endObject();
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:ScrollableHitSource.java

示例2: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject();
    builder.startObject(opType.getLowercase());
    if (failure == null) {
        response.innerToXContent(builder, params);
        builder.field(STATUS, response.status().getStatus());
    } else {
        builder.field(_INDEX, failure.getIndex());
        builder.field(_TYPE, failure.getType());
        builder.field(_ID, failure.getId());
        builder.field(STATUS, failure.getStatus().getStatus());
        builder.startObject(ERROR);
        ElasticsearchException.generateThrowableXContent(builder, params, failure.getCause());
        builder.endObject();
    }
    builder.endObject();
    builder.endObject();
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:21,代码来源:BulkItemResponse.java

示例3: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
private static BytesReference toXContent(Exception error) throws IOException {
    try (XContentBuilder builder = XContentFactory.contentBuilder(Requests.INDEX_CONTENT_TYPE)) {
        builder.startObject();
        ElasticsearchException.generateThrowableXContent(builder, ToXContent.EMPTY_PARAMS, error);
        builder.endObject();
        return builder.bytes();
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:TaskResult.java

示例4: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject("store");
    {
        if (matchingBytes < 0) {
            // dealing with a primary shard
            if (allocationId == null && storeException == null) {
                // there was no information we could obtain of any shard data on the node
                builder.field("found", false);
            } else {
                builder.field("in_sync", inSync);
            }
        }
        if (allocationId != null) {
            builder.field("allocation_id", allocationId);
        }
        if (matchingBytes >= 0) {
            if (hasMatchingSyncId()) {
                builder.field("matching_sync_id", true);
            } else {
                builder.byteSizeField("matching_size_in_bytes", "matching_size", matchingBytes);
            }
        }
        if (storeException != null) {
            builder.startObject("store_exception");
            ElasticsearchException.generateThrowableXContent(builder, params, storeException);
            builder.endObject();
        }
    }
    builder.endObject();
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:33,代码来源:NodeAllocationResult.java

示例5: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    node.toXContent(builder, params);
    if (allocationId != null) {
        builder.field(Fields.ALLOCATION_ID, allocationId);
    }
    builder.field(Fields.ALLOCATED, allocationStatus.value());
    if (storeException != null) {
        builder.startObject(Fields.STORE_EXCEPTION);
        ElasticsearchException.generateThrowableXContent(builder, params, storeException);
        builder.endObject();
    }
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:IndicesShardStoresResponse.java

示例6: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field(SHARD_FIELD, shardId());
    builder.field(INDEX_FIELD, index());
    if (shardTarget != null) {
        builder.field(NODE_FIELD, shardTarget.getNodeId());
    }
    if (cause != null) {
        builder.field(REASON_FIELD);
        builder.startObject();
        ElasticsearchException.generateThrowableXContent(builder, params, cause);
        builder.endObject();
    }
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:ShardSearchFailure.java

示例7: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field("task_id", getTaskId());
    builder.field("node_id", getNodeId());
    builder.field("status", status.name());
    if (reason != null) {
        builder.field("reason");
        builder.startObject();
        ElasticsearchException.generateThrowableXContent(builder, params, reason);
        builder.endObject();
    }
    return builder;

}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:TaskOperationFailure.java

示例8: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject();
    builder.field(_INDEX, shardId.getIndexName());
    builder.field(_SHARD, shardId.id());
    builder.field(_NODE, nodeId);
    builder.field(REASON);
    builder.startObject();
    ElasticsearchException.generateThrowableXContent(builder, params, cause);
    builder.endObject();
    builder.field(STATUS, status);
    builder.field(PRIMARY, primary);
    builder.endObject();
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:ReplicationResponse.java

示例9: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field("shard", shardId());
    builder.field("index", index());
    builder.field("status", status.name());
    if (reason != null) {
        builder.field("reason");
        builder.startObject();
        ElasticsearchException.generateThrowableXContent(builder, params, reason);
        builder.endObject();
    }
    return builder;

}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:DefaultShardOperationFailedException.java

示例10: toXContent

import org.elasticsearch.ElasticsearchException; //导入方法依赖的package包/类
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    if (exception == null) {
        status.toXContent(builder, params);
    } else {
        builder.startObject();
        ElasticsearchException.generateThrowableXContent(builder, params, exception);
        builder.endObject();
    }
    return builder;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:BulkByScrollTask.java


注:本文中的org.elasticsearch.ElasticsearchException.generateThrowableXContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。