All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastrato.gravitino.proto.SchemaEntitySerDe Maven / Gradle / Ivy

Go to download

Gravitino is a high-performance, geo-distributed and federated metadata lake.

There is a newer version: 0.5.1
Show newest version
/*
 * Copyright 2023 Datastrato Pvt Ltd.
 * This software is licensed under the Apache License version 2.
 */
package com.datastrato.gravitino.proto;

import com.datastrato.gravitino.meta.SchemaEntity;

public class SchemaEntitySerDe implements ProtoSerDe {
  @Override
  public Schema serialize(SchemaEntity schemaEntity) {
    return Schema.newBuilder()
        .setId(schemaEntity.id())
        .setName(schemaEntity.name())
        .setAuditInfo(new AuditInfoSerDe().serialize(schemaEntity.auditInfo()))
        .build();
  }

  @Override
  public SchemaEntity deserialize(Schema p) {
    return new SchemaEntity.Builder()
        .withId(p.getId())
        .withName(p.getName())
        .withAuditInfo(new AuditInfoSerDe().deserialize(p.getAuditInfo()))
        .build();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy