/** * Returns bytes reference, also uncompress the source if needed. */ public BytesReference getSourceRef() { if (this.source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ public BytesReference sourceRef() { if (source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ public BytesReference sourceRef() { try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ public BytesReference getSourceRef() { if (this.source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ public BytesReference sourceRef() { if (source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also uncompress the source if needed. */ public BytesReference getSourceRef() { if (this.source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ public BytesReference sourceRef() { if (source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ public BytesReference sourceRef() { if (source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also uncompress the source if needed. */ public BytesReference getSourceRef() { if (this.source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
/** * Returns bytes reference, also un compress the source if needed. */ @Override public BytesReference sourceRef() { if (this.source == null) { return null; } try { this.source = CompressorFactory.uncompressIfNeeded(this.source); return this.source; } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } }
@Override public Object cqlValue(Object value) { if (value == null) { return null; } BytesReference br; if (value instanceof BytesRef) { br = new BytesArray((BytesRef) value); } else if (value instanceof ByteBuffer) { ByteBuffer bb = (ByteBuffer)value; br = new BytesArray(bb.array(), bb.position(), bb.limit() - bb.position()); } else{ br = (BytesReference) value; } try { br = CompressorFactory.uncompressIfNeeded(br); } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } return ByteBuffer.wrap(BytesReference.toBytes(br)); } }
@Override public byte[] value(Object value) { if (value == null) { return null; } BytesReference bValue; if (value instanceof BytesRef) { bValue = new BytesArray((BytesRef) value); } else { bValue = (BytesReference) value; } try { return CompressorFactory.uncompressIfNeeded(bValue).toBytes(); } catch (IOException e) { throw new ElasticsearchParseException("failed to decompress source", e); } } }
if (tryUncompressing) { // backcompat behavior try { return CompressorFactory.uncompressIfNeeded(bytes); } catch (NotXContentException e) {