Package org.elasticsearch.common.xcontent

Examples of org.elasticsearch.common.xcontent.XContentBuilder.endObject()


                if (prettyPrint) {
                    xContentBuilder.prettyPrint();
                }
                xContentBuilder.startObject();
                LocalGatewayStartedShards.Builder.toXContent(stateToWrite, xContentBuilder, ToXContent.EMPTY_PARAMS);
                xContentBuilder.endObject();
                xContentBuilder.close();

                fos.close();

                FileSystemUtils.syncFile(stateFile);
View Full Code Here


                os = new LZFOutputStream(os);
            }
            XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON, os);
            builder.startObject();
            MetaData.Builder.toXContent(metaData, builder, ToXContent.EMPTY_PARAMS);
            builder.endObject();
            builder.close();
            metaDataBlobContainer.writeBlob(newMetaData, new ByteArrayInputStream(out.unsafeByteArray(), 0, out.size()), out.size());
        } catch (IOException e) {
            throw new GatewayException("Failed to write metadata [" + newMetaData + "]", e);
        }
View Full Code Here

            builder.field("physical_name", fileInfo.physicalName());
            builder.field("length", fileInfo.length());
            if (fileInfo.checksum() != null) {
                builder.field("checksum", fileInfo.checksum());
            }
            builder.endObject();
        }
        builder.endObject();

        builder.startObject("translog_files");
        for (CommitPoint.FileInfo fileInfo : commitPoint.translogFiles()) {
View Full Code Here

            if (fileInfo.checksum() != null) {
                builder.field("checksum", fileInfo.checksum());
            }
            builder.endObject();
        }
        builder.endObject();

        builder.startObject("translog_files");
        for (CommitPoint.FileInfo fileInfo : commitPoint.translogFiles()) {
            builder.startObject(fileInfo.name());
            builder.field("physical_name", fileInfo.physicalName());
View Full Code Here

        builder.startObject("translog_files");
        for (CommitPoint.FileInfo fileInfo : commitPoint.translogFiles()) {
            builder.startObject(fileInfo.name());
            builder.field("physical_name", fileInfo.physicalName());
            builder.field("length", fileInfo.length());
            builder.endObject();
        }
        builder.endObject();

        builder.endObject();
        return builder.copiedBytes();
View Full Code Here

            builder.startObject(fileInfo.name());
            builder.field("physical_name", fileInfo.physicalName());
            builder.field("length", fileInfo.length());
            builder.endObject();
        }
        builder.endObject();

        builder.endObject();
        return builder.copiedBytes();
    }
View Full Code Here

            builder.field("length", fileInfo.length());
            builder.endObject();
        }
        builder.endObject();

        builder.endObject();
        return builder.copiedBytes();
    }

    public static CommitPoint fromXContent(byte[] data) throws Exception {
        XContentParser parser = XContentFactory.xContent(XContentType.JSON).createParser(data);
View Full Code Here

                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
                            .field("ok", true)
                            .field("acknowledged", response.acknowledged());
                    builder.endObject();
                    channel.sendResponse(new XContentRestResponse(request, OK, builder));
                } catch (IOException e) {
                    onFailure(e);
                }
            }
View Full Code Here

            @Override public void onResponse(DeleteMappingResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
                            .field("ok", true);
                    builder.endObject();
                    channel.sendResponse(new XContentRestResponse(request, OK, builder));
                } catch (IOException e) {
                    onFailure(e);
                }
            }
View Full Code Here

                        if (!state.blocks().global().isEmpty()) {
                            builder.startObject("global");
                            for (ClusterBlock block : state.blocks().global()) {
                                block.toXContent(builder, request);
                            }
                            builder.endObject();
                        }

                        if (!state.blocks().indices().isEmpty()) {
                            builder.startObject("indices");
                            for (Map.Entry<String, ImmutableSet<ClusterBlock>> entry : state.blocks().indices().entrySet()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.