forked from apache/gravitino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apache#1838] feat(client): Add Java client support for fileset
- Loading branch information
Showing
1 changed file
with
105 additions
and
0 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
...ts/client-java/src/main/java/com/datastrato/gravitino/client/GravitinoFilesetCatalog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright 2023 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.gravitino.client; | ||
|
||
import com.datastrato.gravitino.NameIdentifier; | ||
import com.datastrato.gravitino.Namespace; | ||
import com.datastrato.gravitino.dto.AuditDTO; | ||
import com.datastrato.gravitino.dto.CatalogDTO; | ||
import com.datastrato.gravitino.exceptions.FilesetAlreadyExistsException; | ||
import com.datastrato.gravitino.exceptions.NoSuchCatalogException; | ||
import com.datastrato.gravitino.exceptions.NoSuchFilesetException; | ||
import com.datastrato.gravitino.exceptions.NoSuchSchemaException; | ||
import com.datastrato.gravitino.exceptions.NonEmptySchemaException; | ||
import com.datastrato.gravitino.exceptions.SchemaAlreadyExistsException; | ||
import com.datastrato.gravitino.file.Fileset; | ||
import com.datastrato.gravitino.file.FilesetCatalog; | ||
import com.datastrato.gravitino.file.FilesetChange; | ||
import com.datastrato.gravitino.rel.Schema; | ||
import com.datastrato.gravitino.rel.SchemaChange; | ||
import com.datastrato.gravitino.rel.SupportsSchemas; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Fileset catalog is a catalog implementation that supports fileset like metadata | ||
* operations, for example, schemas and filesets list, creation, update and deletion. A Fileset | ||
* catalog is under the metalake. | ||
*/ | ||
public class GravitinoFilesetCatalog extends CatalogDTO implements FilesetCatalog, SupportsSchemas { | ||
|
||
private final RESTClient restClient; | ||
|
||
public GravitinoFilesetCatalog(String name, | ||
Type type, | ||
String provider, | ||
String comment, | ||
Map<String, String> properties, | ||
AuditDTO auditDTO, | ||
RESTClient restClient) { | ||
super(name, type, provider, comment, properties, auditDTO); | ||
this.restClient = restClient; | ||
} | ||
|
||
@Override | ||
public SupportsSchemas asSchemas() throws UnsupportedOperationException { | ||
return this; | ||
} | ||
|
||
@Override | ||
public FilesetCatalog asFilesetCatalog() throws UnsupportedOperationException { | ||
return this; | ||
} | ||
|
||
@Override | ||
public NameIdentifier[] listFilesets(Namespace namespace) throws NoSuchSchemaException { | ||
return new NameIdentifier[0]; | ||
} | ||
|
||
@Override | ||
public Fileset loadFileset(NameIdentifier ident) throws NoSuchFilesetException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Fileset createFileset(NameIdentifier ident, String comment, Fileset.Type type, String storageLocation, Map<String, String> properties) throws NoSuchSchemaException, FilesetAlreadyExistsException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Fileset alterFileset(NameIdentifier ident, FilesetChange... changes) throws NoSuchFilesetException, IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean dropFileset(NameIdentifier ident) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public NameIdentifier[] listSchemas(Namespace namespace) throws NoSuchCatalogException { | ||
return new NameIdentifier[0]; | ||
} | ||
|
||
@Override | ||
public Schema createSchema(NameIdentifier ident, String comment, Map<String, String> properties) throws NoSuchCatalogException, SchemaAlreadyExistsException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Schema loadSchema(NameIdentifier ident) throws NoSuchSchemaException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Schema alterSchema(NameIdentifier ident, SchemaChange... changes) throws NoSuchSchemaException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean dropSchema(NameIdentifier ident, boolean cascade) throws NonEmptySchemaException { | ||
return false; | ||
} | ||
} |