Examples of LZFInputStream


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);
        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

            }

            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

        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

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

        SSTableWriter writer = createWriter(cfs, totalSize);
        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

            }

            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

            }

            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

            return;
        }
        InputStream in = new FileInputStream(_file);
        // First: LZF has special optimization to use, if we are to copy the whole thing:
        if ((_compression == Compression.LZF) && (_dataLength == -1)) {
              LZFInputStream lzfIn = new LZFInputStream(in);
              try {
                  lzfIn.readAndWrite(out);
              } finally {
                  try {
                      lzfIn.close();
                  } catch (IOException e) { }
              }
              return;
        }
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

            return;
        }
        InputStream in = new FileInputStream(_file);
        // First: LZF has special optimization to use, if we are to copy the whole thing:
        if ((_compression == Compression.LZF) && (_dataLength == -1)) {
              LZFInputStream lzfIn = new LZFInputStream(in);
              try {
                  lzfIn.readAndWrite(out);
              } finally {
                  try {
                      lzfIn.close();
                  } catch (IOException e) { }
              }
              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 (rest != null) {
            final long start = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
            LZFInputStream lzfIn = new LZFInputStream(new BufferBackedInputStream(rest));
            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

        public IndexIterator(File file) {
            Preconditions.checkArgument(file.exists(), "file %s does not exist", file);
            try {
                if (this.in == null) {
                    InputStream fin = new BufferedInputStream(new FileInputStream(file), 64 * 1024);
                    fin = new LZFInputStream(fin);
                    this.in = new DataInputStream(fin);
                }

            } catch (IOException e) {
                throw Throwables.propagate(e);
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.