test_class.declarator: validPeriodAfterAccess = Duration.ofSeconds(3)
test_class.modifier: private static final
test_class.original_string: private static final Duration validPeriodAfterAccess = Duration.ofSeconds(3);
test_class.type: Duration
test_class.var_name: validPeriodAfterAccess
test_class.declarator: expectedInsertions = 1000000
test_class.modifier: private static final
test_class.original_string: private static final int expectedInsertions = 1000000;
test_class.type: int
test_class.var_name: expectedInsertions
test_class.declarator: fpp = 0.0001
test_class.modifier: private static final
test_class.original_string: private static final double fpp = 0.0001;
test_class.type: double
test_class.var_name: fpp
test_class.declarator: creation = ZonedDateTime.now(ZoneOffset.UTC)
test_class.modifier: private static final
test_class.original_string: private static final ZonedDateTime creation = ZonedDateTime.now(ZoneOffset.UTC);
test_class.type: ZonedDateTime
test_class.var_name: creation
test_class.declarator: expiration = creation.plus(Duration.ofSeconds(10))
test_class.modifier: private static final
test_class.original_string: private static final ZonedDateTime expiration = creation.plus(Duration.ofSeconds(10));
test_class.type: ZonedDateTime
test_class.var_name: expiration
test_class.declarator: testingFilterName = "testing_filter"
test_class.modifier: private static final
test_class.original_string: private static final String testingFilterName = "testing_filter";
test_class.type: String
test_class.var_name: testingFilterName
test_class.declarator: tempFile
test_class.modifier: private
test_class.original_string: private File tempFile;
test_class.type: File
test_class.var_name: tempFile
test_class.declarator: tempDir
test_class.modifier: private
test_class.original_string: private String tempDir;
test_class.type: String
test_class.var_name: tempDir
test_class.file: filter-service-core/src/test/java/cn/leancloud/filter/service/FilterRecordTest.java
test_class.identifier: FilterRecordTest
test_case.body: @Test
      public void testReadWriteFilterRecord() throws Exception {
          final GuavaBloomFilter filter = new GuavaBloomFilter(
                  expectedInsertions,
                  fpp,
                  creation,
                  expiration,
                  validPeriodAfterAccess);
          final FilterRecord<GuavaBloomFilter> record = new FilterRecord<>(testingFilterName, filter);
          final FileChannel channel = FileChannel.open(tempFile.toPath(), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.READ);
  
          record.writeFullyTo(channel);
  
          final FilterRecordInputStream<GuavaBloomFilter> stream = new FilterRecordInputStream<>(tempFile.toPath(), new GuavaBloomFilterFactory());
          assertThat(stream.nextFilterRecord()).isEqualTo(new FilterRecord<>(testingFilterName, filter));
      }
test_case.class_method_signature: FilterRecordTest.testReadWriteFilterRecord()
test_case.full_signature: @Test public void testReadWriteFilterRecord()
test_case.identifier: testReadWriteFilterRecord
test_case.invocations: open toPath writeFullyTo toPath isEqualTo assertThat nextFilterRecord
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReadWriteFilterRecord()
focal_class.declarator: BODY_LENGTH_OFFSET = 0
focal_class.modifier: static final
focal_class.original_string: static final int BODY_LENGTH_OFFSET = 0;
focal_class.type: int
focal_class.var_name: BODY_LENGTH_OFFSET
focal_class.declarator: BODY_LENGTH_LENGTH = 4
focal_class.modifier: static final
focal_class.original_string: static final int BODY_LENGTH_LENGTH = 4;
focal_class.type: int
focal_class.var_name: BODY_LENGTH_LENGTH
focal_class.declarator: MAGIC_OFFSET = BODY_LENGTH_OFFSET + BODY_LENGTH_LENGTH
focal_class.modifier: static final
focal_class.original_string: static final int MAGIC_OFFSET = BODY_LENGTH_OFFSET + BODY_LENGTH_LENGTH;
focal_class.type: int
focal_class.var_name: MAGIC_OFFSET
focal_class.declarator: MAGIC_LENGTH = 1
focal_class.modifier: static final
focal_class.original_string: static final int MAGIC_LENGTH = 1;
focal_class.type: int
focal_class.var_name: MAGIC_LENGTH
focal_class.declarator: CRC_OFFSET = MAGIC_OFFSET + MAGIC_LENGTH
focal_class.modifier: static final
focal_class.original_string: static final int CRC_OFFSET = MAGIC_OFFSET + MAGIC_LENGTH;
focal_class.type: int
focal_class.var_name: CRC_OFFSET
focal_class.declarator: CRC_LENGTH = 4
focal_class.modifier: static final
focal_class.original_string: static final int CRC_LENGTH = 4;
focal_class.type: int
focal_class.var_name: CRC_LENGTH
focal_class.declarator: HEADER_OVERHEAD = CRC_OFFSET + CRC_LENGTH
focal_class.modifier: static final
focal_class.original_string: static final int HEADER_OVERHEAD = CRC_OFFSET + CRC_LENGTH;
focal_class.type: int
focal_class.var_name: HEADER_OVERHEAD
focal_class.declarator: DEFAULT_MAGIC = (byte) 0
focal_class.modifier: static final
focal_class.original_string: static final byte DEFAULT_MAGIC = (byte) 0;
focal_class.type: byte
focal_class.var_name: DEFAULT_MAGIC
focal_class.declarator: name
focal_class.modifier: private final
focal_class.original_string: private final String name;
focal_class.type: String
focal_class.var_name: name
focal_class.declarator: filter
focal_class.modifier: private final
focal_class.original_string: private final F filter;
focal_class.type: F
focal_class.var_name: filter
focal_class.file: filter-service-core/src/main/java/cn/leancloud/filter/service/FilterRecord.java
focal_class.identifier: FilterRecord
focal_class.class_method_signature: FilterRecord.FilterRecord(String name, F filter)
focal_class.full_signature: public  FilterRecord(String name, F filter)
focal_class.identifier: FilterRecord
focal_class.modifiers: public
focal_class.parameters: (String name, F filter)
focal_class.signature:  FilterRecord(String name, F filter)
focal_class.class_method_signature: FilterRecord.name()
focal_class.full_signature: public String name()
focal_class.identifier: name
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String name()
focal_class.class_method_signature: FilterRecord.filter()
focal_class.full_signature: public F filter()
focal_class.identifier: filter
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: F
focal_class.signature: F filter()
focal_class.class_method_signature: FilterRecord.writeFullyTo(FileChannel channel)
focal_class.full_signature: public int writeFullyTo(FileChannel channel)
focal_class.identifier: writeFullyTo
focal_class.modifiers: public
focal_class.parameters: (FileChannel channel)
focal_class.return: int
focal_class.signature: int writeFullyTo(FileChannel channel)
focal_class.class_method_signature: FilterRecord.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: FilterRecord.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: FilterRecord.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: FilterRecord.writeBody(OutputStream out)
focal_class.full_signature: private void writeBody(OutputStream out)
focal_class.identifier: writeBody
focal_class.modifiers: private
focal_class.parameters: (OutputStream out)
focal_class.return: void
focal_class.signature: void writeBody(OutputStream out)
focal_class.class_method_signature: FilterRecord.writeBufferTo(GatheringByteChannel channel, ByteBuffer buffer)
focal_class.full_signature: private int writeBufferTo(GatheringByteChannel channel, ByteBuffer buffer)
focal_class.identifier: writeBufferTo
focal_class.modifiers: private
focal_class.parameters: (GatheringByteChannel channel, ByteBuffer buffer)
focal_class.return: int
focal_class.signature: int writeBufferTo(GatheringByteChannel channel, ByteBuffer buffer)
focal_method.body: public int writeFullyTo(FileChannel channel) throws IOException {
          final long startPos = channel.position();
          // write body first then we can know how large the body is
          channel.position(startPos + HEADER_OVERHEAD);
  
          // we don't need to close this stream. it'll be effectively closed when the underlying channel closed
          final ChecksumedBufferedOutputStream stream = new ChecksumedBufferedOutputStream(
                  Channels.newOutputStream(channel),
                  Configuration.channelBufferSizeForFilterPersistence());
          writeBody(stream);
          stream.flush();
  
          // write header
          int bodyLen = (int) (channel.position() - startPos - HEADER_OVERHEAD);
          channel.position(startPos);
  
          final ByteBuffer headerBuffer = ByteBuffer.allocate(HEADER_OVERHEAD);
          headerBuffer.putInt(BODY_LENGTH_OFFSET, bodyLen);
          headerBuffer.put(MAGIC_OFFSET, DEFAULT_MAGIC);
          headerBuffer.putInt(CRC_OFFSET, (int) stream.checksum());
          writeBufferTo(channel, headerBuffer);
  
          // move position forward to the end of this record
          channel.position(startPos + HEADER_OVERHEAD + bodyLen);
          return HEADER_OVERHEAD + bodyLen;
      }
focal_method.class_method_signature: FilterRecord.writeFullyTo(FileChannel channel)
focal_method.full_signature: public int writeFullyTo(FileChannel channel)
focal_method.identifier: writeFullyTo
focal_method.invocations: position position newOutputStream channelBufferSizeForFilterPersistence writeBody flush position position allocate putInt put putInt checksum writeBufferTo position
focal_method.modifiers: public
focal_method.parameters: (FileChannel channel)
focal_method.return: int
focal_method.signature: int writeFullyTo(FileChannel channel)