Skip to content

Commit

Permalink
Add two more APIs that were on another file.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Nov 27, 2024
1 parent 86c8a73 commit 13629dd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 14 additions & 2 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ func (g *Group) Dump(recurse bool) (string, error) {
return C.GoString(cOutput), nil
}

// SerializeGroupMetadata gets and serializes the group metadata
func SerializeGroupMetadata(g *Group, serializationType SerializationType) ([]byte, error) {
// SerializeGroupMetadata gets and serializes the group metadata and returns a Buffer object containing the payload
func SerializeGroupMetadataToBuffer(g *Group, serializationType SerializationType) (*Buffer, error) {
buffer := Buffer{context: g.context}
freeOnGC(&buffer)

Expand All @@ -446,6 +446,18 @@ func SerializeGroupMetadata(g *Group, serializationType SerializationType) ([]by
return nil, fmt.Errorf("Error serializing group metadata: %s", g.context.LastError())
}

return &buffer, nil
}

// SerializeGroupMetadata gets and serializes the group metadata
//
// Deprecated: Use SerializeGroupMetadataToBuffer instead.
func SerializeGroupMetadata(g *Group, serializationType SerializationType) ([]byte, error) {
buffer, err := SerializeGroupMetadataToBuffer(g, serializationType)
if err != nil {
return nil, err
}

return buffer.Serialize(serializationType)
}

Expand Down
16 changes: 14 additions & 2 deletions serialize_array_schema_evolution.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"fmt"
)

// SerializeArraySchemaEvolution serializes the given array schema evolution.
func SerializeArraySchemaEvolution(arraySchemaEvolution *ArraySchemaEvolution, serializationType SerializationType, clientSide bool) ([]byte, error) {
// SerializeArraySchemaEvolution serializes the given array schema evolution and serializes the group metadata and returns a Buffer object containing the payload.
func SerializeArraySchemaEvolutionToBuffer(arraySchemaEvolution *ArraySchemaEvolution, serializationType SerializationType, clientSide bool) (*Buffer, error) {
var cClientSide C.int32_t
if clientSide {
cClientSide = 1
Expand All @@ -32,6 +32,18 @@ func SerializeArraySchemaEvolution(arraySchemaEvolution *ArraySchemaEvolution, s
arraySchemaEvolution.context.LastError())
}

return &buffer, nil
}

// SerializeArraySchemaEvolution serializes the given array schema evolution.
//
// Deprecated: Use SerializeArraySchemaEvolutionToBuffer instead.
func SerializeArraySchemaEvolution(arraySchemaEvolution *ArraySchemaEvolution, serializationType SerializationType, clientSide bool) ([]byte, error) {
buffer, err := SerializeArraySchemaEvolutionToBuffer(arraySchemaEvolution, serializationType, clientSide)
if err != nil {
return nil, err
}

return buffer.Serialize(serializationType)
}

Expand Down

0 comments on commit 13629dd

Please sign in to comment.