Examples of LZFInputStream


Examples of com.ning.compress.lzf.LZFInputStream

  }

  public static void decompress(InputStream in, OutputStream out)
      throws IOException
  {
    LZFInputStream decompressor = null;

    try {
      decompressor = new LZFInputStream(in);
      byte[] buf = ThreadLocalByteBuffer.getBuffer();
      int len;

      while ((len = decompressor.read(buf)) != -1) {
        out.write(buf, 0, len);
      }
    } finally {
      if (decompressor != null) {
        decompressor.close();
      }
    }
  }
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

            }

            assert remoteFile.estimatedKeys > 0;
            SSTableReader reader = null;
            logger.debug("Estimated keys {}", remoteFile.estimatedKeys);
            DataInputStream dis = new DataInputStream(new LZFInputStream(socket.getInputStream()));
            try
            {
                reader = streamIn(dis, localFile, remoteFile);
                session.finished(remoteFile, reader);
            }
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

            }

            assert remoteFile.estimatedKeys > 0;
            SSTableReader reader = null;
            logger.debug("Estimated keys {}", remoteFile.estimatedKeys);
            DataInputStream dis = new DataInputStream(new LZFInputStream(socket.getInputStream()));
            try
            {
                reader = streamIn(dis, localFile, remoteFile);
            }
            catch (IOException ex)
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        localFile = remoteFile != null ? StreamIn.getContextMapping(remoteFile) : null;

        if (remoteFile != null)
        {
            if (remoteFile.compressionInfo == null)
                underliningStream = new LZFInputStream(socket.getInputStream());
            else
                underliningStream = new CompressedInputStream(socket.getInputStream(), remoteFile.compressionInfo);
        }
        else
        {
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

            }

            assert remoteFile.estimatedKeys > 0;
            SSTableReader reader = null;
            logger.debug("Estimated keys {}", remoteFile.estimatedKeys);
            DataInputStream dis = new DataInputStream(new LZFInputStream(socket.getInputStream()));
            try
            {
                reader = streamIn(dis, localFile, remoteFile);
            }
            catch (IOException ex)
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        Pair<String, String> kscf = Schema.instance.getCF(cfId);
        ColumnFamilyStore cfs = Keyspace.open(kscf.left).getColumnFamilyStore(kscf.right);

        SSTableWriter writer = createWriter(cfs, totalSize, repairedAt);
        DataInputStream dis = new DataInputStream(new LZFInputStream(Channels.newInputStream(channel)));
        BytesReadTracker in = new BytesReadTracker(dis);
        try
        {
            while (in.getBytesRead() < totalSize)
            {
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        Pair<String, String> kscf = Schema.instance.getCF(cfId);
        ColumnFamilyStore cfs = Keyspace.open(kscf.left).getColumnFamilyStore(kscf.right);

        SSTableWriter writer = createWriter(cfs, totalSize, repairedAt);
        DataInputStream dis = new DataInputStream(new LZFInputStream(Channels.newInputStream(channel)));
        BytesReadTracker in = new BytesReadTracker(dis);
        try
        {
            while (in.getBytesRead() < totalSize)
            {
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

    {
        InputStream in = new FileInputStream(_file);
       
        // First: LZF has special optimization to use, if we are to copy the whole thing:
        if ((_compression == Compression.LZF) && (_dataOffset < 0L)) {
              LZFInputStream lzfIn = new LZFInputStream(in);
              try {
                  lzfIn.readAndWrite(out);
              } finally {
                  _close(lzfIn);
              }
              return;
        }
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

                    combined = in;
                }

                final long start = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
                CountingInputStream counter = new CountingInputStream(combined);
                LZFInputStream lzfIn = new LZFInputStream(counter);
                try {
                     lzfIn.readAndWrite(out);
                } finally {
                    _close(lzfIn);
                    if (_diagnostics != null) {
                        final long totalSpent = _timeMaster.nanosForDiagnostics() - start;
                        // Not good, but need to try avoiding double-booking so assume 1/4 for response write
                        long respTime = (totalSpent >> 2);
                        _diagnostics.addResponseWriteTime(respTime);
                        _diagnostics.addFileReadAccess(start, start, start + totalSpent - respTime,
                                counter.readCount());
                    }
                }
                return null;
            }
        });

        // Fast case is out of file-access lock so must be handled here
        if (fullBuffer != null) {
            final long start = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
            LZFInputStream lzfIn = new LZFInputStream(new BufferBackedInputStream(fullBuffer));
            try {
                lzfIn.readAndWrite(out);
            } finally {
                _close(lzfIn);
                 if (_diagnostics != null) {
                     _diagnostics.addResponseWriteTime(start, _timeMaster);
                 }
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        Pair<String, String> kscf = Schema.instance.getCF(cfId);
        ColumnFamilyStore cfs = Keyspace.open(kscf.left).getColumnFamilyStore(kscf.right);

        SSTableWriter writer = createWriter(cfs, totalSize, repairedAt);
        DataInputStream dis = new DataInputStream(new LZFInputStream(Channels.newInputStream(channel)));
        BytesReadTracker in = new BytesReadTracker(dis);
        try
        {
            while (in.getBytesRead() < totalSize)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.