@Test(timeout = 1000 * 60) @Ignore("Flaky test") public void pos() throws Exception { long blockSize = CHUNK_SIZE * 2 + CHUNK_SIZE / 3; try (DataWriter writer = create(blockSize, CHUNK_SIZE)) { byte[] data = new byte[1]; Future<WriteSummary> actualUfs = getUfsWrite(mClient); for (long pos = 0; pos < blockSize; pos++) { assertEquals(pos, writer.pos()); ByteBuf buf = Unpooled.wrappedBuffer(data); writer.writeChunk(buf); } actualUfs.get(); } }
@Override public long pos() { if (mIsWritingToLocal) { return mLocalFileDataWriter.pos(); } else { return mGrpcDataWriter.pos(); } }
UfsFallbackLocalFileDataWriter implements DataWriter { @Override public long pos() { if (mIsWritingToLocal) { return mLocalFileDataWriter.pos(); } else { return mGrpcDataWriter.pos(); } } }
UfsFallbackLocalFileDataWriter implements DataWriter { @Override public long pos() { if (mIsWritingToLocal) { return mLocalFileDataWriter.pos(); } else { return mGrpcDataWriter.pos(); } } UfsFallbackLocalFileDataWriter(DataWriter localFileDataWriter,
      GrpcDataWriter grpcDataWriter, FileSystemContext context,
      final WorkerNetAddress address, long blockId, long blockSize, OutStreamOptions options); }
UfsFallbackLocalFileDataWriter implements DataWriter { @Override public long pos() { if (mIsWritingToLocal) { return mLocalFileDataWriter.pos(); } else { return mGrpcDataWriter.pos(); } } UfsFallbackLocalFileDataWriter(DataWriter localFileDataWriter,
      GrpcDataWriter grpcDataWriter, FileSystemContext context,
      final WorkerNetAddress address, long blockId, long blockSize, OutStreamOptions options); static UfsFallbackLocalFileDataWriter create(FileSystemContext context,
      WorkerNetAddress address, long blockId, long blockSize, OutStreamOptions options); @Override void writeChunk(ByteBuf chunk); @Override void flush(); @Override int chunkSize(); @Override long pos(); @Override void cancel(); @Override void close(); }
UfsFallbackLocalFileDataWriter implements DataWriter { @Override public long pos() { if (mIsWritingToLocal) { return mLocalFileDataWriter.pos(); } else { return mGrpcDataWriter.pos(); } } UfsFallbackLocalFileDataWriter(DataWriter localFileDataWriter,
      GrpcDataWriter grpcDataWriter, FileSystemContext context,
      final WorkerNetAddress address, long blockId, long blockSize, OutStreamOptions options); static UfsFallbackLocalFileDataWriter create(FileSystemContext context,
      WorkerNetAddress address, long blockId, long blockSize, OutStreamOptions options); @Override void writeChunk(ByteBuf chunk); @Override void flush(); @Override int chunkSize(); @Override long pos(); @Override void cancel(); @Override void close();  }