Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] fast serialization path for String KV map #2026

Open
chaokunyang opened this issue Jan 26, 2025 · 0 comments
Open

[Java] fast serialization path for String KV map #2026

chaokunyang opened this issue Jan 26, 2025 · 0 comments

Comments

@chaokunyang
Copy link
Collaborator

Feature Request

Map<String, String> is very common in java, we can provide a fast serialization path for it to provide faster performance.

Is your feature request related to a problem? Please describe

No response

Describe the solution you'd like

Add a StringMapSerialization util class in org.apache.fury.serializer.collection package:

class StringMapSerialization {
  /**
   * Write string chunk until there isn't any entry left.
   */
  public static void writeStringChunks(
    MemoryBuffer buffer,
    Entry<String, String> entry,
    Iterator<Entry<String, String>> iterator) {

  }
  /**
   * Write string chunk until there isn't any entry left or chunk size reached max value..
   */
  public static Entry<String, String> writeStringChunk(
    MemoryBuffer buffer,
    Entry<String, String> entry,
    Iterator<Entry<String, String>> iterator) {

  }

  /**
   * Write string chunk until next entry is not string type.
   */
  public static Entry writeChunk(
    MemoryBuffer buffer,
    Entry<String, String> entry,
    Iterator<Entry> iterator) {

  }

  /**
   * Read all string kv chunks and put it into map until all chunks are read.
   */
  public static void readChunks(
    MemoryBuffer buffer, Map<String, String> map, long size, int chunkHeader) {

  }

  public static int readChunk(
    MemoryBuffer buffer, Map<String, String> map, long size, int chunkHeader) {

  }
}

Add fast path in AbstractMapSerializer to forward implementation into StringMapSerialization

Describe alternatives you've considered

No response

Additional context

#2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant