/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }
/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }
@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); } }
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); } }
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) {
/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }
/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }
/** Constructs a new empty buffer. */ public NonSyncDataInputBuffer() { this(new NonSyncByteArrayInputStream()); }