Examples of payload()


Examples of it.unimi.dsi.mg4j.index.IndexIterator.payload()

              }
              else {
                IndexIterator indexIterator = indexReader[ i ].documents( "#" );
                if ( indexIterator.skipTo( currDoc ) == currDoc ) {
                  if ( ! indexIterator.payload().get().equals( content ) )
                    LOGGER.error( index[ i ] + ": Document " + currDoc + " has payload " + content + " but the index says " + indexIterator.payload().get() );
                }
                else LOGGER.error( index[ i ] + ": Document " + currDoc + " does not appear in the inverted list of term " + t );
              }
            }
            else {
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.payload()

       
        localFrequency[ localIndex ]++;
        numPostings[ localIndex ]++;
        temp[ localIndex ].writeGamma( globalPointer );

        if ( globalIndex.hasPayloads ) payload = indexIterator.payload();
        if ( havePayloads ) payload.write( temp[ localIndex ] );
       
        if ( haveCounts ) {
          count = indexIterator.count();
          temp[ localIndex ].writeGamma( count );
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.payload()

        if ( documentIndex != 0 ) {
          IndexIterator indexIterator = index[ i ].documents( 0 );
          int k = 0;
          while ( indexIterator.hasNext() ) {
            assertEquals( payloadPointers[ i ].getInt( k ), indexIterator.nextDocument() );
            if ( factory.fieldType( field[ i ] ) == FieldType.INT ) assertEquals( ( (Number)payloadContent[ i ].get( k ) ).longValue(), ( (Number)indexIterator.payload().get() )
                .longValue() );
            else assertEquals( payloadContent[ i ].get( k ), indexIterator.payload().get() );
            k++;
          }
          indexIterator.dispose();
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.payload()

          int k = 0;
          while ( indexIterator.hasNext() ) {
            assertEquals( payloadPointers[ i ].getInt( k ), indexIterator.nextDocument() );
            if ( factory.fieldType( field[ i ] ) == FieldType.INT ) assertEquals( ( (Number)payloadContent[ i ].get( k ) ).longValue(), ( (Number)indexIterator.payload().get() )
                .longValue() );
            else assertEquals( payloadContent[ i ].get( k ), indexIterator.payload().get() );
            k++;
          }
          indexIterator.dispose();
          assertEquals( k, payloadContent[ i ].size() );
        }
View Full Code Here

Examples of kafka.message.Message.payload()

                new Partition(Broker.fromString(broker.getBrokerConnectionString()), 0), lastMessageOffset);
        MessageAndOffset messageAndOffset = messageAndOffsets.iterator().next();
        Message kafkaMessage = messageAndOffset.message();
        ByteBuffer messageKeyBuffer = kafkaMessage.key();
        String keyString = null;
        String messageString = new String(Utils.toByteArray(kafkaMessage.payload()));
        if (messageKeyBuffer != null) {
            keyString = new String(Utils.toByteArray(messageKeyBuffer));
        }
        assertEquals(key, keyString);
        assertEquals(message, messageString);
View Full Code Here

Examples of kafka.message.Message.payload()

                new Partition(Broker.fromString(broker.getBrokerConnectionString()), 0), lastMessageOffset);
        MessageAndOffset messageAndOffset = messageAndOffsets.iterator().next();
        Message kafkaMessage = messageAndOffset.message();
        ByteBuffer messageKeyBuffer = kafkaMessage.key();
        String keyString = null;
        String messageString = new String(Utils.toByteArray(kafkaMessage.payload()));
        if (messageKeyBuffer != null) {
            keyString = new String(Utils.toByteArray(messageKeyBuffer));
        }
        assertEquals(key, keyString);
        assertEquals(message, messageString);
View Full Code Here

Examples of kafka.message.Message.payload()

                new Partition(Broker.fromString(broker.getBrokerConnectionString()), 0), lastMessageOffset);
        MessageAndOffset messageAndOffset = messageAndOffsets.iterator().next();
        Message kafkaMessage = messageAndOffset.message();
        ByteBuffer messageKeyBuffer = kafkaMessage.key();
        String keyString = null;
        String messageString = new String(Utils.toByteArray(kafkaMessage.payload()));
        if (messageKeyBuffer != null) {
            keyString = new String(Utils.toByteArray(messageKeyBuffer));
        }
        assertEquals(key, keyString);
        assertEquals(message, messageString);
View Full Code Here

Examples of org.apache.lucene.search.spell.TermFreqPayloadIterator.payload()

          if (hasPayloads) {
            if (surfaceForm.length > (Short.MAX_VALUE-2)) {
              throw new IllegalArgumentException("cannot handle surface form > " + (Short.MAX_VALUE-2) + " in length (got " + surfaceForm.length + ")");
            }
            payload = payloads.payload();
            // payload + surfaceLength (short)
            requiredLength += payload.length + 2;
          } else {
            payload = null;
          }
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentBuilder.payload()

                if (dataLength > 0) {
                    if (response instanceof XContentRestResponse) {
                        // if its a builder based response, and it was created with a CachedStreamOutput, we can release it
                        // after we write the response, and no need to do an extra copy because its not thread safe
                        XContentBuilder builder = ((XContentRestResponse) response).builder();
                        if (builder.payload() instanceof CachedStreamOutput.Entry) {
                            releaseContentListener = new NettyTransport.CacheFutureListener((CachedStreamOutput.Entry) builder.payload());
                            ChannelBuffer buf = ChannelBuffers.wrappedBuffer(builder.unsafeBytes(), 0, builder.unsafeBytesLength());
                            writeBuffer = ChannelBuffers.wrappedBuffer(writeBuffer, buf);
                        } else if (response.contentThreadSafe()) {
                            ChannelBuffer buf = ChannelBuffers.wrappedBuffer(builder.unsafeBytes(), 0, builder.unsafeBytesLength());
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentBuilder.payload()

                    if (response instanceof XContentRestResponse) {
                        // if its a builder based response, and it was created with a CachedStreamOutput, we can release it
                        // after we write the response, and no need to do an extra copy because its not thread safe
                        XContentBuilder builder = ((XContentRestResponse) response).builder();
                        if (builder.payload() instanceof CachedStreamOutput.Entry) {
                            releaseContentListener = new NettyTransport.CacheFutureListener((CachedStreamOutput.Entry) builder.payload());
                            ChannelBuffer buf = ChannelBuffers.wrappedBuffer(builder.unsafeBytes(), 0, builder.unsafeBytesLength());
                            writeBuffer = ChannelBuffers.wrappedBuffer(writeBuffer, buf);
                        } else if (response.contentThreadSafe()) {
                            ChannelBuffer buf = ChannelBuffers.wrappedBuffer(builder.unsafeBytes(), 0, builder.unsafeBytesLength());
                            writeBuffer = ChannelBuffers.wrappedBuffer(writeBuffer, buf);
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.