Examples of LZFStreamInput


Examples of org.elasticsearch.common.io.stream.LZFStreamInput

        XContentParser parser = source.parser();
        try {
            if (parser == null) {
                if (LZF.isCompressed(source.source())) {
                    BytesStreamInput siBytes = new BytesStreamInput(source.source());
                    LZFStreamInput siLzf = CachedStreamInput.cachedLzf(siBytes);
                    XContentType contentType = XContentFactory.xContentType(siLzf);
                    siLzf.resetToBufferStart();
                    parser = XContentFactory.xContent(contentType).createParser(siLzf);
                } else {
                    parser = XContentFactory.xContent(source.source()).createParser(source.source());
                }
            }
View Full Code Here

Examples of org.elasticsearch.common.io.stream.LZFStreamInput

    private LocalGatewayMetaState readMetaState(byte[] data) throws IOException {
        XContentParser parser = null;
        try {
            if (LZF.isCompressed(data)) {
                BytesStreamInput siBytes = new BytesStreamInput(data);
                LZFStreamInput siLzf = CachedStreamInput.cachedLzf(siBytes);
                parser = XContentFactory.xContent(XContentType.JSON).createParser(siLzf);
            } else {
                parser = XContentFactory.xContent(XContentType.JSON).createParser(data);
            }
            return LocalGatewayMetaState.Builder.fromXContent(parser);
View Full Code Here

Examples of org.elasticsearch.common.io.stream.LZFStreamInput

    private LocalGatewayStartedShards readStartedShards(byte[] data) throws IOException {
        XContentParser parser = null;
        try {
            if (LZF.isCompressed(data)) {
                BytesStreamInput siBytes = new BytesStreamInput(data);
                LZFStreamInput siLzf = CachedStreamInput.cachedLzf(siBytes);
                parser = XContentFactory.xContent(XContentType.JSON).createParser(siLzf);
            } else {
                parser = XContentFactory.xContent(XContentType.JSON).createParser(data);
            }
            return LocalGatewayStartedShards.Builder.fromXContent(parser);
View Full Code Here

Examples of org.elasticsearch.common.io.stream.LZFStreamInput

    private MetaData readMetaData(byte[] data) throws IOException {
        XContentParser parser = null;
        try {
            if (LZF.isCompressed(data)) {
                BytesStreamInput siBytes = new BytesStreamInput(data);
                LZFStreamInput siLzf = CachedStreamInput.cachedLzf(siBytes);
                parser = XContentFactory.xContent(XContentType.JSON).createParser(siLzf);
            } else {
                parser = XContentFactory.xContent(XContentType.JSON).createParser(data);
            }
            return MetaData.Builder.fromXContent(parser);
View Full Code Here

Examples of org.elasticsearch.common.io.stream.LZFStreamInput

    public static Map<String, Object> sourceAsMap(byte[] bytes, int offset, int length) {
        XContentParser parser = null;
        try {
            if (LZF.isCompressed(bytes, offset, length)) {
                BytesStreamInput siBytes = new BytesStreamInput(bytes, offset, length);
                LZFStreamInput siLzf = CachedStreamInput.cachedLzf(siBytes);
                XContentType contentType = XContentFactory.xContentType(siLzf);
                siLzf.resetToBufferStart();
                parser = XContentFactory.xContent(contentType).createParser(siLzf);
                return parser.map();
            } else {
                parser = XContentFactory.xContent(bytes, offset, length).createParser(bytes, offset, length);
                return parser.map();
View Full Code Here

Examples of org.elasticsearch.common.io.stream.LZFStreamInput

    }

    public static void restDocumentSource(byte[] source, int offset, int length, XContentBuilder builder, ToXContent.Params params) throws IOException {
        if (LZF.isCompressed(source, offset, length)) {
            BytesStreamInput siBytes = new BytesStreamInput(source, offset, length);
            LZFStreamInput siLzf = CachedStreamInput.cachedLzf(siBytes);
            XContentType contentType = XContentFactory.xContentType(siLzf);
            siLzf.resetToBufferStart();
            if (contentType == builder.contentType()) {
                builder.rawField("_source", siLzf);
            } else {
                XContentParser parser = XContentFactory.xContent(contentType).createParser(siLzf);
                try {
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.