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

com.datastrato.gravitino.proto.TableEntitySerde 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.TableEntity;

public class TableEntitySerde implements ProtoSerDe {
  @Override
  public Table serialize(TableEntity tableEntity) {
    return Table.newBuilder()
        .setId(tableEntity.id())
        .setName(tableEntity.name())
        .setAuditInfo(new AuditInfoSerDe().serialize(tableEntity.auditInfo()))
        .build();
  }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy