Class LevelDbLogReader

  • All Implemented Interfaces:
    java.util.Iterator<byte[]>

    public final class LevelDbLogReader
    extends java.lang.Object
    implements java.util.Iterator<byte[]>
    Iterator that incrementally parses binary data in LevelDb format into records.

    The input source is automatically closed when all data have been read.

    There are several other implementations of this, none of which appeared suitable for our use case: The original C++ implementation. com.google.appengine.api.files.RecordReadChannel - Exactly what we need but deprecated. The referenced replacement: The App Engine GCS Client - Does not appear to have any support for working with LevelDB. *

    See log_format.md

    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<byte[]>
      • next

        public byte[] next()
        Specified by:
        next in interface java.util.Iterator<byte[]>
      • from

        public static LevelDbLogReader from​(java.nio.file.Path path)
                                     throws java.io.IOException
        Returns a LevelDbLogReader over a file specified by Path.
        Throws:
        java.io.IOException
      • from

        public static LevelDbLogReader from​(java.lang.String filename)
                                     throws java.io.IOException
        Returns a LevelDbLogReader over a file specified by filename.
        Throws:
        java.io.IOException