/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }
/** Returns the length of the input. */ public int getLength() { return buffer.getLength(); }
/** Returns the current position in the input. */ public int getPosition() { return buffer.getPosition(); }
/** Resets the data that the buffer reads. */ public void reset(byte[] input, int start, int length) { buffer.reset(input, start, length); }
/** Resets the data that the buffer reads. */ public void reset(byte[] input, int length) { buffer.reset(input, 0, length); }
/** Resets the data that the buffer reads. */ public void reset(byte[] input, int length) { buffer.reset(input, 0, length); }
/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }
/** Returns the length of the input. */ public int getLength() { return buffer.getLength(); }
/** Returns the current position in the input. */ public int getPosition() { return buffer.getPosition(); }
/** Resets the data that the buffer reads. */ public void reset(byte[] input, int start, int length) { buffer.reset(input, start, length); }
@Override public void merge(AggregationBuffer agg, Object partial) throws HiveException { if (partial == null) { return; } BytesWritable bytes = (BytesWritable) partial; ByteArrayInputStream in = new NonSyncByteArrayInputStream(bytes.getBytes()); // Deserialize the bloom filter try { BloomKFilter bf = BloomKFilter.deserialize(in); ((BloomFilterBuf)agg).bloomFilter.merge(bf); } catch (IOException e) { throw new HiveException(e); } finally { IOUtils.closeStream(in); } }
/** Returns the length of the input. */ public int getLength() { return buffer.getLength(); }
/** Returns the current position in the input. */ public int getPosition() { return buffer.getPosition(); }
/** Resets the data that the buffer reads. */ public void reset(byte[] input, int length) { buffer.reset(input, 0, length); }
private void initValue() { InputStream in = null; try { Object val = bloomFilterDynamicValue.getValue(); if (val != null) { BinaryObjectInspector boi = (BinaryObjectInspector) bloomFilterDynamicValue.getObjectInspector(); byte[] bytes = boi.getPrimitiveJavaObject(val); in = new NonSyncByteArrayInputStream(bytes); bloomFilter = BloomKFilter.deserialize(in); } else { bloomFilter = null; } initialized = true; } catch (Exception err) { throw new RuntimeException(err); } finally { IOUtils.closeStream(in); } }
/** Returns the length of the input. */ public int getLength() { return buffer.getLength(); }
/** Returns the current position in the input. */ public int getPosition() { return buffer.getPosition(); }
/** Resets the data that the buffer reads. */ public void reset(byte[] input, int length) { buffer.reset(input, 0, length); }
byte[] bytes = new byte[bw.getLength()]; System.arraycopy(bw.getBytes(), 0, bytes, 0, bw.getLength()); in = new NonSyncByteArrayInputStream(bytes); bloomFilter = BloomKFilter.deserialize(in); } catch ( IOException e) {
/** Returns the length of the input. */ public int getLength() { return buffer.getLength(); }