test_class.declarator: timestamp
test_class.modifier: private
test_class.original_string: private long timestamp;
test_class.type: long
test_class.var_name: timestamp
test_class.declarator: key
test_class.modifier: private
test_class.original_string: private ByteBuffer key;
test_class.type: ByteBuffer
test_class.var_name: key
test_class.declarator: value
test_class.modifier: private
test_class.original_string: private ByteBuffer value;
test_class.type: ByteBuffer
test_class.var_name: value
test_class.declarator: compression
test_class.modifier: private
test_class.original_string: private CompressionType compression;
test_class.type: CompressionType
test_class.var_name: compression
test_class.declarator: record
test_class.modifier: private
test_class.original_string: private Record record;
test_class.type: Record
test_class.var_name: record
test_class.file: clients/src/test/java/org/apache/kafka/common/record/RecordTest.java
test_class.identifier: RecordTest
test_case.body: @Test
      public void testChecksum() {
          assertEquals(record.checksum(), record.computeChecksum());
          assertEquals(record.checksum(), Record.computeChecksum(
              this.timestamp,
              this.key == null ? null : this.key.array(),
              this.value == null ? null : this.value.array(),
              this.compression, 0, -1));
          assertTrue(record.isValid());
          for (int i = Record.CRC_OFFSET + Record.CRC_LENGTH; i < record.size(); i++) {
              Record copy = copyOf(record);
              copy.buffer().put(i, (byte) 69);
              assertFalse(copy.isValid());
              try {
                  copy.ensureValid();
                  fail("Should fail the above test.");
              } catch (InvalidRecordException e) {
                  // this is good
              }
          }
      }
test_case.class_method_signature: RecordTest.testChecksum()
test_case.full_signature: @Test public void testChecksum()
test_case.identifier: testChecksum
test_case.invocations: assertEquals checksum computeChecksum assertEquals checksum computeChecksum array array assertTrue isValid size copyOf put buffer assertFalse isValid ensureValid fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testChecksum()
focal_class.declarator: CRC_OFFSET = 0
focal_class.modifier: public static final
focal_class.original_string: public static final int CRC_OFFSET = 0;
focal_class.type: int
focal_class.var_name: CRC_OFFSET
focal_class.declarator: CRC_LENGTH = 4
focal_class.modifier: public static final
focal_class.original_string: public static final int CRC_LENGTH = 4;
focal_class.type: int
focal_class.var_name: CRC_LENGTH
focal_class.declarator: MAGIC_OFFSET = CRC_OFFSET + CRC_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int MAGIC_OFFSET = CRC_OFFSET + CRC_LENGTH;
focal_class.type: int
focal_class.var_name: MAGIC_OFFSET
focal_class.declarator: MAGIC_LENGTH = 1
focal_class.modifier: public static final
focal_class.original_string: public static final int MAGIC_LENGTH = 1;
focal_class.type: int
focal_class.var_name: MAGIC_LENGTH
focal_class.declarator: ATTRIBUTES_OFFSET = MAGIC_OFFSET + MAGIC_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int ATTRIBUTES_OFFSET = MAGIC_OFFSET + MAGIC_LENGTH;
focal_class.type: int
focal_class.var_name: ATTRIBUTES_OFFSET
focal_class.declarator: ATTRIBUTE_LENGTH = 1
focal_class.modifier: public static final
focal_class.original_string: public static final int ATTRIBUTE_LENGTH = 1;
focal_class.type: int
focal_class.var_name: ATTRIBUTE_LENGTH
focal_class.declarator: TIMESTAMP_OFFSET = ATTRIBUTES_OFFSET + ATTRIBUTE_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int TIMESTAMP_OFFSET = ATTRIBUTES_OFFSET + ATTRIBUTE_LENGTH;
focal_class.type: int
focal_class.var_name: TIMESTAMP_OFFSET
focal_class.declarator: TIMESTAMP_LENGTH = 8
focal_class.modifier: public static final
focal_class.original_string: public static final int TIMESTAMP_LENGTH = 8;
focal_class.type: int
focal_class.var_name: TIMESTAMP_LENGTH
focal_class.declarator: KEY_SIZE_OFFSET_V0 = ATTRIBUTES_OFFSET + ATTRIBUTE_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int KEY_SIZE_OFFSET_V0 = ATTRIBUTES_OFFSET + ATTRIBUTE_LENGTH;
focal_class.type: int
focal_class.var_name: KEY_SIZE_OFFSET_V0
focal_class.declarator: KEY_SIZE_OFFSET_V1 = TIMESTAMP_OFFSET + TIMESTAMP_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int KEY_SIZE_OFFSET_V1 = TIMESTAMP_OFFSET + TIMESTAMP_LENGTH;
focal_class.type: int
focal_class.var_name: KEY_SIZE_OFFSET_V1
focal_class.declarator: KEY_SIZE_LENGTH = 4
focal_class.modifier: public static final
focal_class.original_string: public static final int KEY_SIZE_LENGTH = 4;
focal_class.type: int
focal_class.var_name: KEY_SIZE_LENGTH
focal_class.declarator: KEY_OFFSET_V0 = KEY_SIZE_OFFSET_V0 + KEY_SIZE_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int KEY_OFFSET_V0 = KEY_SIZE_OFFSET_V0 + KEY_SIZE_LENGTH;
focal_class.type: int
focal_class.var_name: KEY_OFFSET_V0
focal_class.declarator: KEY_OFFSET_V1 = KEY_SIZE_OFFSET_V1 + KEY_SIZE_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int KEY_OFFSET_V1 = KEY_SIZE_OFFSET_V1 + KEY_SIZE_LENGTH;
focal_class.type: int
focal_class.var_name: KEY_OFFSET_V1
focal_class.declarator: VALUE_SIZE_LENGTH = 4
focal_class.modifier: public static final
focal_class.original_string: public static final int VALUE_SIZE_LENGTH = 4;
focal_class.type: int
focal_class.var_name: VALUE_SIZE_LENGTH
focal_class.declarator: HEADER_SIZE = CRC_LENGTH + MAGIC_LENGTH + ATTRIBUTE_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int HEADER_SIZE = CRC_LENGTH + MAGIC_LENGTH + ATTRIBUTE_LENGTH;
focal_class.type: int
focal_class.var_name: HEADER_SIZE
focal_class.declarator: RECORD_OVERHEAD = HEADER_SIZE + TIMESTAMP_LENGTH + KEY_SIZE_LENGTH + VALUE_SIZE_LENGTH
focal_class.modifier: public static final
focal_class.original_string: public static final int RECORD_OVERHEAD = HEADER_SIZE + TIMESTAMP_LENGTH + KEY_SIZE_LENGTH + VALUE_SIZE_LENGTH;
focal_class.type: int
focal_class.var_name: RECORD_OVERHEAD
focal_class.declarator: MAGIC_VALUE_V0 = 0
focal_class.modifier: public static final
focal_class.original_string: public static final byte MAGIC_VALUE_V0 = 0;
focal_class.type: byte
focal_class.var_name: MAGIC_VALUE_V0
focal_class.declarator: MAGIC_VALUE_V1 = 1
focal_class.modifier: public static final
focal_class.original_string: public static final byte MAGIC_VALUE_V1 = 1;
focal_class.type: byte
focal_class.var_name: MAGIC_VALUE_V1
focal_class.declarator: CURRENT_MAGIC_VALUE = MAGIC_VALUE_V1
focal_class.modifier: public static final
focal_class.original_string: public static final byte CURRENT_MAGIC_VALUE = MAGIC_VALUE_V1;
focal_class.type: byte
focal_class.var_name: CURRENT_MAGIC_VALUE
focal_class.declarator: COMPRESSION_CODEC_MASK = 0x07
focal_class.modifier: public static final
focal_class.original_string: public static final int COMPRESSION_CODEC_MASK = 0x07;
focal_class.type: int
focal_class.var_name: COMPRESSION_CODEC_MASK
focal_class.declarator: TIMESTAMP_TYPE_MASK = 0x08
focal_class.modifier: public static final
focal_class.original_string: public static final byte TIMESTAMP_TYPE_MASK = 0x08;
focal_class.type: byte
focal_class.var_name: TIMESTAMP_TYPE_MASK
focal_class.declarator: TIMESTAMP_TYPE_ATTRIBUTE_OFFSET = 3
focal_class.modifier: public static final
focal_class.original_string: public static final int TIMESTAMP_TYPE_ATTRIBUTE_OFFSET = 3;
focal_class.type: int
focal_class.var_name: TIMESTAMP_TYPE_ATTRIBUTE_OFFSET
focal_class.declarator: NO_COMPRESSION = 0
focal_class.modifier: public static final
focal_class.original_string: public static final int NO_COMPRESSION = 0;
focal_class.type: int
focal_class.var_name: NO_COMPRESSION
focal_class.declarator: NO_TIMESTAMP = -1L
focal_class.modifier: public static final
focal_class.original_string: public static final long NO_TIMESTAMP = -1L;
focal_class.type: long
focal_class.var_name: NO_TIMESTAMP
focal_class.declarator: buffer
focal_class.modifier: private final
focal_class.original_string: private final ByteBuffer buffer;
focal_class.type: ByteBuffer
focal_class.var_name: buffer
focal_class.declarator: wrapperRecordTimestamp
focal_class.modifier: private final
focal_class.original_string: private final Long wrapperRecordTimestamp;
focal_class.type: Long
focal_class.var_name: wrapperRecordTimestamp
focal_class.declarator: wrapperRecordTimestampType
focal_class.modifier: private final
focal_class.original_string: private final TimestampType wrapperRecordTimestampType;
focal_class.type: TimestampType
focal_class.var_name: wrapperRecordTimestampType
focal_class.file: clients/src/main/java/org/apache/kafka/common/record/Record.java
focal_class.identifier: Record
focal_class.class_method_signature: Record.Record(ByteBuffer buffer)
focal_class.full_signature: public  Record(ByteBuffer buffer)
focal_class.identifier: Record
focal_class.modifiers: public
focal_class.parameters: (ByteBuffer buffer)
focal_class.signature:  Record(ByteBuffer buffer)
focal_class.class_method_signature: Record.Record(ByteBuffer buffer, Long wrapperRecordTimestamp, TimestampType wrapperRecordTimestampType)
focal_class.full_signature:   Record(ByteBuffer buffer, Long wrapperRecordTimestamp, TimestampType wrapperRecordTimestampType)
focal_class.identifier: Record
focal_class.parameters: (ByteBuffer buffer, Long wrapperRecordTimestamp, TimestampType wrapperRecordTimestampType)
focal_class.signature:  Record(ByteBuffer buffer, Long wrapperRecordTimestamp, TimestampType wrapperRecordTimestampType)
focal_class.class_method_signature: Record.Record(long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.full_signature: public  Record(long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.identifier: Record
focal_class.modifiers: public
focal_class.parameters: (long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.signature:  Record(long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.class_method_signature: Record.Record(long timestamp, byte[] key, byte[] value, CompressionType type)
focal_class.full_signature: public  Record(long timestamp, byte[] key, byte[] value, CompressionType type)
focal_class.identifier: Record
focal_class.modifiers: public
focal_class.parameters: (long timestamp, byte[] key, byte[] value, CompressionType type)
focal_class.signature:  Record(long timestamp, byte[] key, byte[] value, CompressionType type)
focal_class.class_method_signature: Record.Record(long timestamp, byte[] value, CompressionType type)
focal_class.full_signature: public  Record(long timestamp, byte[] value, CompressionType type)
focal_class.identifier: Record
focal_class.modifiers: public
focal_class.parameters: (long timestamp, byte[] value, CompressionType type)
focal_class.signature:  Record(long timestamp, byte[] value, CompressionType type)
focal_class.class_method_signature: Record.Record(long timestamp, byte[] key, byte[] value)
focal_class.full_signature: public  Record(long timestamp, byte[] key, byte[] value)
focal_class.identifier: Record
focal_class.modifiers: public
focal_class.parameters: (long timestamp, byte[] key, byte[] value)
focal_class.signature:  Record(long timestamp, byte[] key, byte[] value)
focal_class.class_method_signature: Record.Record(long timestamp, byte[] value)
focal_class.full_signature: public  Record(long timestamp, byte[] value)
focal_class.identifier: Record
focal_class.modifiers: public
focal_class.parameters: (long timestamp, byte[] value)
focal_class.signature:  Record(long timestamp, byte[] value)
focal_class.class_method_signature: Record.write(ByteBuffer buffer, long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.full_signature: public static void write(ByteBuffer buffer, long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.identifier: write
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.return: void
focal_class.signature: void write(ByteBuffer buffer, long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.class_method_signature: Record.write(Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize)
focal_class.full_signature: public static void write(Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize)
focal_class.identifier: write
focal_class.modifiers: public static
focal_class.parameters: (Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize)
focal_class.return: void
focal_class.signature: void write(Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize)
focal_class.class_method_signature: Record.recordSize(byte[] key, byte[] value)
focal_class.full_signature: public static int recordSize(byte[] key, byte[] value)
focal_class.identifier: recordSize
focal_class.modifiers: public static
focal_class.parameters: (byte[] key, byte[] value)
focal_class.return: int
focal_class.signature: int recordSize(byte[] key, byte[] value)
focal_class.class_method_signature: Record.recordSize(int keySize, int valueSize)
focal_class.full_signature: public static int recordSize(int keySize, int valueSize)
focal_class.identifier: recordSize
focal_class.modifiers: public static
focal_class.parameters: (int keySize, int valueSize)
focal_class.return: int
focal_class.signature: int recordSize(int keySize, int valueSize)
focal_class.class_method_signature: Record.buffer()
focal_class.full_signature: public ByteBuffer buffer()
focal_class.identifier: buffer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer buffer()
focal_class.class_method_signature: Record.computeAttributes(CompressionType type)
focal_class.full_signature: public static byte computeAttributes(CompressionType type)
focal_class.identifier: computeAttributes
focal_class.modifiers: public static
focal_class.parameters: (CompressionType type)
focal_class.return: byte
focal_class.signature: byte computeAttributes(CompressionType type)
focal_class.class_method_signature: Record.computeChecksum(ByteBuffer buffer, int position, int size)
focal_class.full_signature: public static long computeChecksum(ByteBuffer buffer, int position, int size)
focal_class.identifier: computeChecksum
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, int position, int size)
focal_class.return: long
focal_class.signature: long computeChecksum(ByteBuffer buffer, int position, int size)
focal_class.class_method_signature: Record.computeChecksum(long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.full_signature: public static long computeChecksum(long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.identifier: computeChecksum
focal_class.modifiers: public static
focal_class.parameters: (long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.return: long
focal_class.signature: long computeChecksum(long timestamp, byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
focal_class.class_method_signature: Record.computeChecksum()
focal_class.full_signature: public long computeChecksum()
focal_class.identifier: computeChecksum
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long computeChecksum()
focal_class.class_method_signature: Record.checksum()
focal_class.full_signature: public long checksum()
focal_class.identifier: checksum
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long checksum()
focal_class.class_method_signature: Record.isValid()
focal_class.full_signature: public boolean isValid()
focal_class.identifier: isValid
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isValid()
focal_class.class_method_signature: Record.ensureValid()
focal_class.full_signature: public void ensureValid()
focal_class.identifier: ensureValid
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void ensureValid()
focal_class.class_method_signature: Record.size()
focal_class.full_signature: public int size()
focal_class.identifier: size
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int size()
focal_class.class_method_signature: Record.keySize()
focal_class.full_signature: public int keySize()
focal_class.identifier: keySize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int keySize()
focal_class.class_method_signature: Record.hasKey()
focal_class.full_signature: public boolean hasKey()
focal_class.identifier: hasKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasKey()
focal_class.class_method_signature: Record.valueSizeOffset()
focal_class.full_signature: private int valueSizeOffset()
focal_class.identifier: valueSizeOffset
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int valueSizeOffset()
focal_class.class_method_signature: Record.valueSize()
focal_class.full_signature: public int valueSize()
focal_class.identifier: valueSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int valueSize()
focal_class.class_method_signature: Record.magic()
focal_class.full_signature: public byte magic()
focal_class.identifier: magic
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte magic()
focal_class.class_method_signature: Record.attributes()
focal_class.full_signature: public byte attributes()
focal_class.identifier: attributes
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte attributes()
focal_class.class_method_signature: Record.timestamp()
focal_class.full_signature: public long timestamp()
focal_class.identifier: timestamp
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long timestamp()
focal_class.class_method_signature: Record.timestampType()
focal_class.full_signature: public TimestampType timestampType()
focal_class.identifier: timestampType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TimestampType
focal_class.signature: TimestampType timestampType()
focal_class.class_method_signature: Record.compressionType()
focal_class.full_signature: public CompressionType compressionType()
focal_class.identifier: compressionType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CompressionType
focal_class.signature: CompressionType compressionType()
focal_class.class_method_signature: Record.value()
focal_class.full_signature: public ByteBuffer value()
focal_class.identifier: value
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer value()
focal_class.class_method_signature: Record.key()
focal_class.full_signature: public ByteBuffer key()
focal_class.identifier: key
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer key()
focal_class.class_method_signature: Record.sliceDelimited(int start)
focal_class.full_signature: private ByteBuffer sliceDelimited(int start)
focal_class.identifier: sliceDelimited
focal_class.modifiers: private
focal_class.parameters: (int start)
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer sliceDelimited(int start)
focal_class.class_method_signature: Record.toString()
focal_class.full_signature: public String toString()
focal_class.identifier: toString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: Record.equals(Object other)
focal_class.full_signature: public boolean equals(Object other)
focal_class.identifier: equals
focal_class.modifiers: public
focal_class.parameters: (Object other)
focal_class.return: boolean
focal_class.signature: boolean equals(Object other)
focal_class.class_method_signature: Record.hashCode()
focal_class.full_signature: public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: public long checksum() {
          return Utils.readUnsignedInt(buffer, CRC_OFFSET);
      }
focal_method.class_method_signature: Record.checksum()
focal_method.full_signature: public long checksum()
focal_method.identifier: checksum
focal_method.invocations: readUnsignedInt
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: long
focal_method.signature: long checksum()