HiveProtoParquetWriterWithOffset implements CloseableWriter<MESSAGE_KIND> { public CloseableWriter<MESSAGE_KIND> withHiveSupport(boolean isHiveSuppport) { if (isHiveSuppport) { return this; } else { return protoParquetWriterWithOffset; } } HiveProtoParquetWriterWithOffset(ProtoParquetWriterWithOffset<MESSAGE_KIND> protoParquetWriterWithOffset, HiveClient hiveClient); @Override void write(long timestamp, MESSAGE_KIND msg, Offset offset); @Override Path close(); CloseableWriter<MESSAGE_KIND> withHiveSupport(boolean isHiveSuppport);  }
@Test public void returnHiveProtoParquetWriterWithOffset() { CloseableWriter parquetWriter = new HiveProtoParquetWriterWithOffset<>(protoParquetWriterWithOffset, hiveClient).withHiveSupport(true); assertTrue(parquetWriter instanceof HiveProtoParquetWriterWithOffset); }
@Test public void returnProtoParquetWriterWithOffset() { CloseableWriter parquetWriter = new HiveProtoParquetWriterWithOffset<>(protoParquetWriterWithOffset, hiveClient).withHiveSupport(false); assertTrue(parquetWriter instanceof ProtoParquetWriterWithOffset); }