Package com.fasterxml.clustermate.service.util

Examples of com.fasterxml.clustermate.service.util.BufferBackedInputStream


                    if (leftovers == 0) {
                        return offHeap;
                    }
                    // if not, read+write; much longer. But starting with buffered, if any
                    Vector<InputStream> coll = new Vector<InputStream>(3);
                    coll.add(new BufferBackedInputStream(offHeap));
                    coll.add(new ByteArrayInputStream(copyBuffer, 0, leftovers));
                    coll.add(in);
                    combined = new SequenceInputStream(coll.elements());
                } else {
                    // otherwise, just read from input
                    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) {
View Full Code Here


                    if (leftovers == 0) {
                        return offHeap;
                    }
                    // if not, read+write; much longer. But starting with buffered, if any
                    Vector<InputStream> coll = new Vector<InputStream>(3);
                    coll.add(new BufferBackedInputStream(offHeap));
                    coll.add(new ByteArrayInputStream(copyBuffer, 0, leftovers));
                    coll.add(in);
                    combined = new SequenceInputStream(coll.elements());
                } else {
                    // otherwise, just read from input
                    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) {
View Full Code Here

                    if (leftovers == 0) {
                        return offHeap;
                    }
                    // if not, read+write; much longer. But starting with buffered, if any
                    Vector<InputStream> coll = new Vector<InputStream>(3);
                    coll.add(new BufferBackedInputStream(offHeap));
                    coll.add(new ByteArrayInputStream(copyBuffer, 0, leftovers));
                    coll.add(in);
                    combined = new SequenceInputStream(coll.elements());
                } else {
                    // otherwise, just read from input
                    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) {
View Full Code Here

                    if (leftovers == 0) {
                        return offHeap;
                    }
                    // if not, read+write; much longer. But starting with buffered, if any
                    Vector<InputStream> coll = new Vector<InputStream>(3);
                    coll.add(new BufferBackedInputStream(offHeap));
                    coll.add(new ByteArrayInputStream(copyBuffer, 0, leftovers));
                    coll.add(in);
                    combined = new SequenceInputStream(coll.elements());
                } else {
                    // otherwise, just read from input
                    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) {
View Full Code Here

                    if (leftovers == 0) {
                        return offHeap;
                    }
                    // if not, read+write; much longer. But starting with buffered, if any
                    Vector<InputStream> coll = new Vector<InputStream>(3);
                    coll.add(new BufferBackedInputStream(offHeap));
                    coll.add(new ByteArrayInputStream(copyBuffer, 0, leftovers));
                    coll.add(in);
                    combined = new SequenceInputStream(coll.elements());
                } else {
                    // otherwise, just read from input
                    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) {
View Full Code Here

                    if (leftovers == 0) {
                        return offHeap;
                    }
                    // if not, read+write; much longer. But starting with buffered, if any
                    Vector<InputStream> coll = new Vector<InputStream>(3);
                    coll.add(new BufferBackedInputStream(offHeap));
                    coll.add(new ByteArrayInputStream(copyBuffer, 0, leftovers));
                    coll.add(in);
                    combined = new SequenceInputStream(coll.elements());
                } else {
                    // otherwise, just read from input
                    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) {
View Full Code Here

TOP

Related Classes of com.fasterxml.clustermate.service.util.BufferBackedInputStream

Copyright © 2018 www.massapicom. 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.