Skip to content

Conversation

@oschwald
Copy link
Member

  • Prefer @MaxMindDbConstructor; fallback to record canonical or single
    public constructor
  • Infer parameter names: annotation > record component > Java parameter
    when -parameters is set; throw ParameterNotFoundException if names
    unavailable
  • Enable -parameters in maven-compiler-plugin

oschwald and others added 7 commits October 23, 2025 11:30
- Prefer @MaxMindDbConstructor; fallback to record canonical or single
  public constructor
- Infer parameter names: annotation > record component > Java parameter
  when `-parameters` is set; throw ParameterNotFoundException if names
  unavailable
- Enable -parameters in maven-compiler-plugin
Add coercion for INT32/UINT16/UINT32 to target primitives with range
checks.
We need both useDefault and defaultValue as otherwise there is no way
to distinguish between the default value being the empty string and
no default being set. If defaultValue is not set but useDefault is, we
will use the Java default value, e.g., 0 or the empty string.
This adds support for marking static factory methods with @MaxMindDbCreator
to enable custom deserialization logic, similar to Jackson's @JsonCreator.

The decoder now automatically invokes creator methods when decoding values
to target types, allowing for custom type conversions such as string-to-enum
mappings with non-standard representations.

This eliminates the need for redundant constructors that only perform type
conversions, as the decoder can now apply conversions automatically via
annotated static factory methods.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
oschwald and others added 3 commits October 23, 2025 11:52
The previous implementation attempted to allocate a temporary I/O buffer
equal to chunkSize (~2GB), causing OutOfMemoryError even with increased
heap settings. This was a bug introduced when BufferHolder was refactored
to use DEFAULT_CHUNK_SIZE for the I/O buffer.

Changes:
- Use separate IO_BUFFER_SIZE constant (16KB) for reading from streams
- Use ByteArrayOutputStream to accumulate data into chunkSize-sized chunks
- Guarantee all non-final chunks are exactly chunkSize bytes
- Support databases >2GB by creating multiple chunks
- Use chunks.size() to determine SingleBuffer vs MultiBuffer
- Consistent with pre-MultiBuffer approach but with >2GB support

This fixes macOS CI failures and supports databases of any size with
minimal memory overhead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant