Hi folks….I am looking to extend the GMS Client to...
# getting-started
n
Hi folks….I am looking to extend the GMS Client to get Datasets by specific version in addition to the Urn i.e.
Dataset get(Dataset urn, int version)
(https://github.com/linkedin/datahub/blob/master/gms/client/src/main/java/com/linkedin/dataset/client/Datasets.java#L62) Is this achievable? Could you guys highlight the high level changes that might be needed to provide this ability….
g
Hey @nutritious-bird-77396!
We added this functionality for getting aspects specifically
take a look at
and
the reason I added this for Aspects but not Entities is that each aspect has its own independent version numbers
so you may have 7 versions of SchemaMetadata but only 1 version of Ownership, etc.
Hope this helps 👍
n
Thanks Gabe! I will take a look and get back.
@green-football-43791 Internally we run on a fork of older version of Datahub (As of Feb-2020). Many of the latest changes we haven’t brought it in. 1. One of it is
EntityService
component….I would like to achieve to introduce the
/aspects
Rest.li endpoint without any of the
EntityService
changes….Instead I was planning on using
Copy code
@Inject
  @Named("aspectDao")
  private BaseReadDAO<Aspect, Urn> _aspectDao;
In that case i don’t get the respec.json’s generated in
api/idl
folder for
aspect
resource… I added a resource, client and modelchanges….. Do i need to introduce factory classes as well? Any idea…. I am not sure if this is clear…if not, we can chat up for 15 mins if you desire to debug this…
g
Hey @nutritious-bird-77396- creating a resource should alone be enough for generating the respec.json files. I would check the annotations at the top of your resource- are those correct?
The other thing to check would be making sure you are building properly
To edit your respec file you often need to run a special build command
you may need to run
./gradlew :gms:impl:build -Prest.model.compatibility=ignore
n
Is that not invoked part of the
./gradlew build
?
g
That specific part is not
It is intended that you run this command manually in order to not inadvertently change the respec API
However, I’m not sure this makes sense- I have not heard of someone inadvertently adding a resource
n
Annotations at the top of the resource looks similar to the OSSone…
Copy code
/**
 * Single unified resource for fetching DataHub Aspects
 */
@RestLiCollection(name = "aspects", namespace = "com.linkedin.aspect")
public class Aspects extends CollectionResourceTaskTemplate<String, VersionedAspect> {

  private final Logger _logger = LoggerFactory.getLogger("Aspects");

  @Inject
  @Named("aspectDao")
  private BaseReadDAO<Aspect, Urn> _aspectDao;
I ran
./gradlew :gms:impl:build -Prest.model.compatibility=ignore
but still the rest spec json’s are not generated. I am not sure if in the old architecture some more components are needed?
g
That should be it- I notice that you are extending a different interface in the code you shared
What if you duplicate everything about the existing resource except the method implementations?
The old architecture did not alter how restli resources are generated
n
I did try removing the
CollectionResourceTaskTemplate<String, VersionedAspect>
no impact…
g
Hey @nutritious-bird-77396 - want to get on a quick call to try and resolve?
👍 1