Package org.elasticsearch.common.bytes

Examples of org.elasticsearch.common.bytes.BytesReference.writeTo()


        log.debug("DLS is enabled and request contains valid xcontent");       
        BytesReference modifiedContent = applyDls((BytesRestResponse)response);       
        int contentLength = modifiedContent.length();
        resp.setContentLength(contentLength);
        final ServletOutputStream out = resp.getOutputStream();
        modifiedContent.writeTo(out);
        out.close();
     
      } else {
        log.debug("DLS is not enabled or response does not contain valid xcontent")
        int contentLength = response.content().length();
View Full Code Here


                    XContentBuilder builder = XContentFactory.contentBuilder(formatContentType, CompressorFactory.defaultCompressor().streamOutput(bStream));
                    builder.copyCurrentStructure(XContentFactory.xContent(contentType).createParser(source));
                    builder.close();
                } else {
                    StreamOutput streamOutput = CompressorFactory.defaultCompressor().streamOutput(bStream);
                    source.writeTo(streamOutput);
                    streamOutput.close();
                }
                source = bStream.bytes();
                // update the data in the context, so it can be compressed and stored compressed outside...
                context.source(source);
View Full Code Here

            writeInt(spare.length());
            write(spare.bytes(), 0, spare.length());
        } else {
            BytesReference bytes = text.bytes();
            writeInt(bytes.length());
            bytes.writeTo(this);
        }
    }

    public void writeTextArray(Text[] array) throws IOException {
        writeVInt(array.length);
View Full Code Here

        builder.endArray();
        builder.endObject();
        builder.close();
        BytesReference bRef = bStream.bytes();
        try (OutputStream output = snapshotsBlobContainer.createOutput(SNAPSHOTS_FILE)) {
            bRef.writeTo(output);
        }
    }

    /**
     * Reads snapshot index file
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.