@Test public void testLocateCompressionTrunk() throws IOException { CompressionTrunk compressionTrunk; compressionTrunk = compressionFileState.locateCompressionTrunk(false, 12); Assert.assertEquals(1, compressionTrunk.getIndex()); Assert.assertEquals(10L, compressionTrunk.getOriginOffset()); Assert.assertEquals(10L, compressionTrunk.getOriginLength()); Assert.assertEquals(4L, compressionTrunk.getCompressedOffset()); Assert.assertEquals(6L, compressionTrunk.getCompressedLength()); compressionTrunk = compressionFileState.locateCompressionTrunk(false, 40); Assert.assertEquals(4, compressionTrunk.getIndex()); Assert.assertEquals(40L, compressionTrunk.getOriginOffset()); Assert.assertEquals(10L, compressionTrunk.getOriginLength()); Assert.assertEquals(19L, compressionTrunk.getCompressedOffset()); Assert.assertEquals(3L, compressionTrunk.getCompressedLength()); compressionTrunk = compressionFileState.locateCompressionTrunk(false, 85); Assert.assertEquals(8, compressionTrunk.getIndex()); Assert.assertEquals(80L, compressionTrunk.getOriginOffset()); Assert.assertEquals(6L, compressionTrunk.getOriginLength()); Assert.assertEquals(32L, compressionTrunk.getCompressedOffset()); Assert.assertEquals(2L, compressionTrunk.getCompressedLength()); compressionTrunk = compressionFileState.locateCompressionTrunk(true, 6); Assert.assertEquals(1, compressionTrunk.getIndex()); Assert.assertEquals(10L, compressionTrunk.getOriginOffset()); Assert.assertEquals(10L, compressionTrunk.getOriginLength()); Assert.assertEquals(4L, compressionTrunk.getCompressedOffset()); Assert.assertEquals(6L, compressionTrunk.getCompressedLength()); compressionTrunk = compressionFileState.locateCompressionTrunk(true, 19); Assert.assertEquals(4, compressionTrunk.getIndex()); Assert.assertEquals(40L, compressionTrunk.getOriginOffset()); Assert.assertEquals(10L, compressionTrunk.getOriginLength()); Assert.assertEquals(19L, compressionTrunk.getCompressedOffset()); Assert.assertEquals(3L, compressionTrunk.getCompressedLength()); compressionTrunk = compressionFileState.locateCompressionTrunk(true, 33); Assert.assertEquals(8, compressionTrunk.getIndex()); Assert.assertEquals(80L, compressionTrunk.getOriginOffset()); Assert.assertEquals(6L, compressionTrunk.getOriginLength()); Assert.assertEquals(32L, compressionTrunk.getCompressedOffset()); Assert.assertEquals(2L, compressionTrunk.getCompressedLength()); }
public CompressionTrunk locateCompressionTrunk(boolean compressed, long offset) throws IOException { int index = compressed ? getPosIndexByCompressedOffset(offset) : getPosIndexByOriginalOffset(offset); CompressionTrunk compressionTrunk = new CompressionTrunk(index); compressionTrunk.setCompressionImpl(compressionImpl); compressionTrunk.setOriginOffset(originalPos[index]); compressionTrunk.setOriginLength(getOriginTrunkSize(index)); compressionTrunk.setCompressedOffset(compressedPos[index]); compressionTrunk.setCompressedLength(getCompressedTrunkSize(index)); return compressionTrunk; }
CompressionFileState extends FileState implements Serializable { public CompressionTrunk locateCompressionTrunk(boolean compressed, long offset) throws IOException { int index = compressed ? getPosIndexByCompressedOffset(offset) : getPosIndexByOriginalOffset(offset); CompressionTrunk compressionTrunk = new CompressionTrunk(index); compressionTrunk.setCompressionImpl(compressionImpl); compressionTrunk.setOriginOffset(originalPos[index]); compressionTrunk.setOriginLength(getOriginTrunkSize(index)); compressionTrunk.setCompressedOffset(compressedPos[index]); compressionTrunk.setCompressedLength(getCompressedTrunkSize(index)); return compressionTrunk; } }
CompressionFileState extends FileState implements Serializable { public CompressionTrunk locateCompressionTrunk(boolean compressed, long offset) throws IOException { int index = compressed ? getPosIndexByCompressedOffset(offset) : getPosIndexByOriginalOffset(offset); CompressionTrunk compressionTrunk = new CompressionTrunk(index); compressionTrunk.setCompressionImpl(compressionImpl); compressionTrunk.setOriginOffset(originalPos[index]); compressionTrunk.setOriginLength(getOriginTrunkSize(index)); compressionTrunk.setCompressedOffset(compressedPos[index]); compressionTrunk.setCompressedLength(getCompressedTrunkSize(index)); return compressionTrunk; } CompressionFileState(String fileName, FileStage stage);  CompressionFileState(String fileName, int bufferSize);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              Long[] originalPos, Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength);  CompressionFileState(String fileName, int bufferSize, String compressionImpl);  CompressionFileState(String fileName, int bufferSize,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize,
                              Long[] originalPos, Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos, FileStage stage); }
CompressionFileState extends FileState implements Serializable { public CompressionTrunk locateCompressionTrunk(boolean compressed, long offset) throws IOException { int index = compressed ? getPosIndexByCompressedOffset(offset) : getPosIndexByOriginalOffset(offset); CompressionTrunk compressionTrunk = new CompressionTrunk(index); compressionTrunk.setCompressionImpl(compressionImpl); compressionTrunk.setOriginOffset(originalPos[index]); compressionTrunk.setOriginLength(getOriginTrunkSize(index)); compressionTrunk.setCompressedOffset(compressedPos[index]); compressionTrunk.setCompressedLength(getCompressedTrunkSize(index)); return compressionTrunk; } CompressionFileState(String fileName, FileStage stage);  CompressionFileState(String fileName, int bufferSize);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              Long[] originalPos, Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength);  CompressionFileState(String fileName, int bufferSize, String compressionImpl);  CompressionFileState(String fileName, int bufferSize,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize,
                              Long[] originalPos, Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos, FileStage stage); int getBufferSize(); void setBufferSize(int bufferSize); long getOriginalLength(); long getCompressedLength(); void setOriginalLength(long length); void setCompressedLength(long length); Long[] getOriginalPos(); Long[] getCompressedPos(); String getCompressionImpl(); void setCompressionImpl(String compressionImpl); int getPosIndexByOriginalOffset(long offset); int getPosIndexByCompressedOffset(long offset); CompressionTrunk locateCompressionTrunk(boolean compressed,
      long offset); long getOriginTrunkSize(int index); long getCompressedTrunkSize(int index); void setPositionMapping(Long[] originalPos, Long[] compressedPos); static Builder newBuilder(); }
CompressionFileState extends FileState implements Serializable { public CompressionTrunk locateCompressionTrunk(boolean compressed, long offset) throws IOException { int index = compressed ? getPosIndexByCompressedOffset(offset) : getPosIndexByOriginalOffset(offset); CompressionTrunk compressionTrunk = new CompressionTrunk(index); compressionTrunk.setCompressionImpl(compressionImpl); compressionTrunk.setOriginOffset(originalPos[index]); compressionTrunk.setOriginLength(getOriginTrunkSize(index)); compressionTrunk.setCompressedOffset(compressedPos[index]); compressionTrunk.setCompressedLength(getCompressedTrunkSize(index)); return compressionTrunk; } CompressionFileState(String fileName, FileStage stage);  CompressionFileState(String fileName, int bufferSize);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              Long[] originalPos, Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength);  CompressionFileState(String fileName, int bufferSize, String compressionImpl);  CompressionFileState(String fileName, int bufferSize,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize,
                              Long[] originalPos, Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos);  CompressionFileState(String fileName, int bufferSize, String compressionImpl,
                              long originalLength, long compressedLength, Long[] originalPos,
                              Long[] compressedPos, FileStage stage); int getBufferSize(); void setBufferSize(int bufferSize); long getOriginalLength(); long getCompressedLength(); void setOriginalLength(long length); void setCompressedLength(long length); Long[] getOriginalPos(); Long[] getCompressedPos(); String getCompressionImpl(); void setCompressionImpl(String compressionImpl); int getPosIndexByOriginalOffset(long offset); int getPosIndexByCompressedOffset(long offset); CompressionTrunk locateCompressionTrunk(boolean compressed,
      long offset); long getOriginTrunkSize(int index); long getCompressedTrunkSize(int index); void setPositionMapping(Long[] originalPos, Long[] compressedPos); static Builder newBuilder();  }