Package org.apache.jute

Examples of org.apache.jute.InputArchive


                crc.update(bytes, 0, bytes.length);
                if (crcValue != crc.getValue())
                    throw new IOException(CRC_ERROR);
                if (bytes == null || bytes.length == 0)
                    return false;
                InputArchive iab = BinaryInputArchive
                                    .getArchive(new ByteArrayInputStream(bytes));
                hdr = new TxnHeader();
                record = SerializeUtils.deserializeTxn(iab, hdr);
            } catch (EOFException e) {
                LOG.debug("EOF excepton " + e);
View Full Code Here


                if (bytes.length == 0) {
                    // Since we preallocate, we define EOF to be an
                    // empty transaction
                    throw new EOFException();
                }
                InputArchive ia = BinaryInputArchive
                        .getArchive(new ByteArrayInputStream(bytes));
                TxnHeader hdr = new TxnHeader();
                Record txn = SerializeUtils.deserializeTxn(ia, hdr);
                if (logStream.readByte("EOR") != 'B') {
                    LOG.warn("Last transaction was partial.");
View Full Code Here

            throw new IOException("Invalid snapshots " +
                "or not snapshots in " + snapShotDir);
        }
        InputStream inputstream = new BufferedInputStream(
                new FileInputStream(snapshot));
        InputArchive ia = BinaryInputArchive.getArchive(inputstream);
        deserializeSnapshot(oldDataTree, ia, sessionsWithTimeouts);
        //ok done with the snapshot
        // now apply the logs
        long snapshotZxid = oldDataTree.lastProcessedZxid;
        File[] files = FileTxnLog.getLogFiles(
View Full Code Here

            if (bytes.length == 0) {
                // Since we preallocate, we define EOF to be an
                // empty transaction
                throw new EOFException();
            }
            InputArchive ia = BinaryInputArchive
                    .getArchive(new ByteArrayInputStream(bytes));
            TxnHeader hdr = new TxnHeader();
            hdr.deserialize(ia, "hdr");
            System.out.println(DateFormat.getDateTimeInstance(DateFormat.SHORT,
                    DateFormat.LONG).format(new Date(hdr.getTime()))
View Full Code Here

            if (bytes.length == 0) {
                // Since we preallocate, we define EOF to be an
                // empty transaction
                throw new EOFException();
            }
            InputArchive ia = BinaryInputArchive
                    .getArchive(new ByteArrayInputStream(bytes));
            TxnHeader hdr = new TxnHeader();
            hdr.deserialize(ia, "hdr");
            System.out.println(DateFormat.getDateTimeInstance(DateFormat.SHORT,
                    DateFormat.LONG).format(new Date(hdr.getTime()))
View Full Code Here

                if (bytes.length == 0) {
                    // Since we preallocate, we define EOF to be an
                    // empty transaction
                    throw new EOFException();
                }
                InputArchive ia = BinaryInputArchive
                        .getArchive(new ByteArrayInputStream(bytes));
                TxnHeader hdr = new TxnHeader();
                Record txn = SerializeUtils.deserializeTxn(ia, hdr);
                if (logStream.readByte("EOR") != 'B') {
                    LOG.warn("Last transaction was partial.");
View Full Code Here

            throw new IOException("Invalid snapshots " +
                "or not snapshots in " + snapShotDir);
        }
        InputStream inputstream = new BufferedInputStream(
                new FileInputStream(snapshot));
        InputArchive ia = BinaryInputArchive.getArchive(inputstream);
        deserializeSnapshot(oldDataTree, ia, sessionsWithTimeouts);
        //ok done with the snapshot
        // now apply the logs
        long snapshotZxid = oldDataTree.lastProcessedZxid;
        File[] files = FileTxnLog.getLogFiles(
View Full Code Here

            CheckedInputStream crcIn = null;
            try {
                LOG.info("Reading snapshot " + snap);
                snapIS = new BufferedInputStream(new FileInputStream(snap));
                crcIn = new CheckedInputStream(snapIS, new Adler32());
                InputArchive ia = BinaryInputArchive.getArchive(crcIn);
                deserialize(dt,sessions, ia);
                long checkSum = crcIn.getChecksum().getValue();
                long val = ia.readLong("val");
                if (val != checkSum) {
                    throw new IOException("CRC corruption in snapshot :  " + snap);
                }
                foundValid = true;
                break;
View Full Code Here

     */
    private static FileHeader readHeader(File file) throws IOException {
        InputStream is =null;
        try {
            is = new BufferedInputStream(new FileInputStream(file));
            InputArchive ia=BinaryInputArchive.getArchive(is);
            FileHeader hdr = new FileHeader();
            hdr.deserialize(ia, "fileheader");
            return hdr;
         } finally {
             try {
View Full Code Here

                crc.update(bytes, 0, bytes.length);
                if (crcValue != crc.getValue())
                    throw new IOException(CRC_ERROR);
                if (bytes == null || bytes.length == 0)
                    return false;
                InputArchive iab = BinaryInputArchive
                                    .getArchive(new ByteArrayInputStream(bytes));
                hdr = new TxnHeader();
                record = SerializeUtils.deserializeTxn(iab, hdr);
            } catch (EOFException e) {
                LOG.debug("EOF excepton " + e);
View Full Code Here

TOP

Related Classes of org.apache.jute.InputArchive

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.