-
Notifications
You must be signed in to change notification settings - Fork 278
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
Conversation
success = true | ||
sleep( Math.abs(new Random().nextInt() % 600) + 500) | ||
} catch (MetacatNotFoundException e) { | ||
print "ignore transient Exception" |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
To support tags for catalog, database, and table.