Examples of readDelta()


Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readDelta()

        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        reader.readDelta(new ByteArrayInputStream(delta));

        Assert.assertEquals(3, listener.getRemovedValuesSize());
        Assert.assertEquals(2, listener.getRemovedValueOrdinal(3));
        Assert.assertEquals(2, listener.getAddedValuesSize());
        Assert.assertEquals(10, listener.getAddedValueOrdinal(11));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readDelta()

        try {
            /// first read the snapshot
            reader.readSnapshot(snapshotStream);
            /// then apply the delta
            reader.readDelta(deltaStream);
        } catch (IOException e) {
            /// either of these methods throws an exception if the FastBlobReader
            /// is unable to read from the provided stream.
        } finally {
            /// it is your responsibility to close the streams.  The FastBlobReader will not do this.
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readDelta()

        try {
            /// first read the snapshot
            reader.readSnapshot(snapshotStream);
            /// then apply the delta
            reader.readDelta(deltaStream);
        } catch (IOException e) {
            /// either of these methods throws an exception if the FastBlobReader
            /// is unable to read from the provided stream.
        } finally {
            /// it is your responsibility to close the streams.  The FastBlobReader will not do this.
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

      ibs.position( 0 );

      currDoc = -1;
      for( int j = totalFrequency; j-- != 0; ) {
        obs = indexWriter.newDocumentRecord();
        indexWriter.writeDocumentPointer( obs, currDoc = ibs.readDelta() + currDoc + 1 );
        if ( hasCounts ) {
          count = ibs.readGamma();
          indexWriter.writePositionCount( obs, count );
          if ( hasPositions ) {
            position[ 0 ] = ibs.readDelta();
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

        indexWriter.writeDocumentPointer( obs, currDoc = ibs.readDelta() + currDoc + 1 );
        if ( hasCounts ) {
          count = ibs.readGamma();
          indexWriter.writePositionCount( obs, count );
          if ( hasPositions ) {
            position[ 0 ] = ibs.readDelta();
            for( int k = 1; k < count; k++ ) position[ k ] = position[ k - 1 ] + ibs.readDelta() + 1;
            indexWriter.writeDocumentPositions( obs, position, 0, count, size != null ? size[ currDoc ] : -1 );
          }
        }
      }
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

        if ( hasCounts ) {
          count = ibs.readGamma();
          indexWriter.writePositionCount( obs, count );
          if ( hasPositions ) {
            position[ 0 ] = ibs.readDelta();
            for( int k = 1; k < count; k++ ) position[ k ] = position[ k - 1 ] + ibs.readDelta() + 1;
            indexWriter.writeDocumentPositions( obs, position, 0, count, size != null ? size[ currDoc ] : -1 );
          }
        }
      }
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

          // We sort position by pointed document pointer.
          LongArrays.quickSort( position, 0, documentCount, new AbstractLongComparator() {
            public int compare( final long position0, final long position1 ) {
              try {
                ibs.position( position0 );
                final int d0 = ibs.readDelta();
                ibs.position( position1 );
                return d0 - ibs.readDelta();
              }
              catch ( IOException e ) {
                throw new RuntimeException( e );
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

            public int compare( final long position0, final long position1 ) {
              try {
                ibs.position( position0 );
                final int d0 = ibs.readDelta();
                ibs.position( position1 );
                return d0 - ibs.readDelta();
              }
              catch ( IOException e ) {
                throw new RuntimeException( e );
              }
            }
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

            }
          } );
          for ( int i = 0; i < documentCount; i++ ) {
            obs = indexWriter.newDocumentRecord();
            ibs.position( position[ i ] );
            indexWriter.writeDocumentPointer( obs, ibs.readDelta() );
            payload.read( ibs );
            indexWriter.writePayload( obs, payload );
          }

          maxDocInBatch = 0;
View Full Code Here

Examples of it.unimi.dsi.io.InputBitStream.readDelta()

          frequency = bapl.frequency; // This could be much more than the actual frequency in virtual indices

          // Calculate posting bit positions and corresponding pointers
          for ( int j = 0; j < frequency; j++ ) {
            bitPos[ j ] = ibs.readBits(); // Cache bit poisition
            pointer[ j ] = ibs.readDelta(); // Cache pointer
            if ( hasCounts ) count = ibs.readGamma() + 1;
            if ( hasPositions ) ibs.skipDeltas( count ); // Skip document positions
          }

          // Sort stably pointers and positions by increasing pointer
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.