private int toIntWithCheck(long size) { if (size > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write page larger than " + Integer.MAX_VALUE + " bytes: " + size); } return (int)size; }
@Override public final void writeLong(long v) { try { out.writeLong(v); } catch (IOException e) { throw new ParquetEncodingException("could not write long", e); } }
@Override public final void writeFloat(float v) { try { out.writeFloat(v); } catch (IOException e) { throw new ParquetEncodingException("could not write float", e); } }
public static Binary fromString(final String value) { try { return new FromStringBinary(value.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new ParquetEncodingException("UTF-8 not supported.", e); } }
@Override public void writeInteger(int v) { try { this.encoder.writeInt(v); } catch (IOException e) { throw new ParquetEncodingException(e); } }
/** * {@inheritDoc} * @see parquet.column.values.ValuesWriter#writeInteger(int) */ @Override public void writeInteger(int v) { try { bitPackingWriter.write(v); } catch (IOException e) { throw new ParquetEncodingException(e); } }
private void repetitionLevel(int repetitionLevel) { try { repetitionLevelColumn.writeInt(repetitionLevel); } catch (IOException e) { throw new ParquetEncodingException("illegal repetition level " + repetitionLevel + " for column " + path, e); } }
@Override public void writeByte(int value) { try { out.write(value); } catch (IOException e) { throw new ParquetEncodingException("could not write byte", e); } }
/** * {@inheritDoc} */ @Override public void putNext(Tuple tuple) throws IOException { try { this.recordWriter.write(null, tuple); } catch (InterruptedException e) { Thread.interrupted(); throw new ParquetEncodingException("Interrupted while writing", e); } }
@Override public final void writeBoolean(boolean v) { try { bitPackingWriter.write(v ? 1 : 0); } catch (IOException e) { throw new ParquetEncodingException("could not write boolean", e); } }
public BoundedIntColumnWriter(int bound) { if (bound == 0) { throw new ParquetEncodingException("Value bound cannot be 0. Use DevNullColumnWriter instead."); } bitsPerValue = (int)Math.ceil(Math.log(bound + 1)/Math.log(2)); shouldRepeatThreshold = (bitsPerValue + 9)/(1 + bitsPerValue); if (Log.DEBUG) LOG.debug("init column with bit width of " + bitsPerValue + " and repeat threshold of " + shouldRepeatThreshold); }
private void writeMinDelta() { try { BytesUtils.writeZigZagVarInt(minDeltaInCurrentBlock, baos); } catch (IOException e) { throw new ParquetEncodingException("can not write min delta for block", e); } }
@Override public void writeInteger(int v) { try { encoder.writeInt(v); } catch (IOException e) { throw new ParquetEncodingException(e); } }
private void writeBitWidthForMiniBlock(int i) { try { BytesUtils.writeIntLittleEndianOnOneByte(baos, bitWidths[i]); } catch (IOException e) { throw new ParquetEncodingException("can not write bitwith for miniblock", e); } }
@Override public BytesInput getBytes() { try { return encoder.toBytes(); } catch (IOException e) { throw new ParquetEncodingException(e); } }
private void definitionLevel(int definitionLevel) { try { definitionLevelColumn.writeInt(definitionLevel); } catch (IOException e) { throw new ParquetEncodingException("illegal definition level " + definitionLevel + " for column " + path, e); } }
@Override public final void writeInteger(int v) { try { out.writeInt(v); } catch (IOException e) { throw new ParquetEncodingException("could not write int", e); } }
@Override public final void writeDouble(double v) { try { out.writeDouble(v); } catch (IOException e) { throw new ParquetEncodingException("could not write double", e); } }
/** * * {@inheritDoc} * @see parquet.column.primitive.PrimitiveColumnWriter#writeInteger(int) */ @Override public void writeInteger(int v) { try { bitPackingWriter.write(v); } catch (IOException e) { throw new ParquetEncodingException(e); } }
@Override public final void writeDouble(double v) { try { out.writeDouble(v); } catch (IOException e) { throw new ParquetEncodingException("could not write double", e); } }