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

Add setTags() api in tagController #264

Merged
merged 4 commits into from
Jun 6, 2018
Merged

Add setTags() api in tagController #264

merged 4 commits into from
Jun 6, 2018

Conversation

zhljen
Copy link
Contributor

@zhljen zhljen commented Jun 4, 2018

To support tags for catalog, database, and table.

@zhljen zhljen added this to the 1.2.0 milestone Jun 4, 2018
@zhljen zhljen self-assigned this Jun 4, 2018
@zhljen zhljen requested a review from ajoymajumdar June 4, 2018 16:28
success = true
sleep( Math.abs(new Random().nextInt() % 600) + 500)
} catch (MetacatNotFoundException e) {
print "ignore transient Exception"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we getting transient exception?

assert ret2_new.size() == 0

cleanup:
api.deleteTable(catalogName, databaseName, tableName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this cleanup the metadata/tags too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to include these databses in metacat.definition.metadata.delete.enableDeleteForQualifiedNames option in docker-compose.yml so that the metadata gets deleted too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete the metadata of them as part of the tag tests? For testing cleanup purpose?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for test cleanup.

final QualifiedName name = tagCreateRequestDto.getName();
final Set<String> tags = new HashSet<>(tagCreateRequestDto.getTags());
final MetacatRequestContext metacatRequestContext = MetacatContextManager.getContext();
if (name.getType().equals(QualifiedName.Type.TABLE)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use a switch statement. If none of the type matches throw an exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. think we need a qualifiedName validation function.

final MetacatRequestContext metacatRequestContext = MetacatContextManager.getContext();
final QualifiedName name = tagRemoveRequestDto.getName();

if (name.getType().equals(QualifiedName.Type.TABLE)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above.

@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Set<String> setTags(
TagCreateRequestDto tagCreateRequestDto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. We should start following this pattern of creating dtos for post objects.

environment:
- TARGETS=postgresql:5432,cassandra:9042,hive-metastore-db:3306,druid:8081
- TARGETS=postgresql:5432,hive-metastore-db:3306
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments that we will reinstate the cassandra and druid tests once we figure a lightweight docker image for the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do.

ajoymajumdar
ajoymajumdar previously approved these changes Jun 5, 2018
@zhljen zhljen merged commit b4e5166 into Netflix:master Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants