Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro, mail # user - Namespace issues when using schema with avdl file‏


+
Atin Sood 2013-04-20, 15:14
Copy link to this message
-
RE: Namespace issues when using schema with avdl file‏
Dave McAlpin 2013-04-21, 18:22
Just fully qualify the data type, like this:

@namespace ("com.b2b.camel.service")
protocol CamelEndpointDAOService{

    import schema "camelEndpoint.avsc";

    int persist(com.b2b.camel.endpoint.CamelEndpoint camelEndpoint);
    com.b2b.camel.endpoint.CamelEndpoint fetch(int id);
}

Dave

From: Atin Sood [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 20, 2013 8:15 AM
To: [EMAIL PROTECTED]
Subject: Namespace issues when using schema with avdl file‏
I have a schema file like this

{"namespace" : "com.b2b.camel.endpoint",
         "type" : "record",
         "name" : "CamelEndpoint",
         "fields" : [
            {"name" : "id", "type" : "int"},
            {"name" : "desc", "type" : "string"},
            {"name" : "from", "type" : "string"},
            {"name" : "to", "type" : "string"}
         ]
}

and I want to use the same in the the avdl file where my protocol will be using it

@namespace ("com.b2b.camel.service")
protocol CamelEndpointDAOService{

    import schema "camelEndpoint.avsc";

    int persist(CamelEndpoint);
    CamelEndpoint fetch(int id);

}

Note that the camelEndpoint is in a different namespace compared to the CamelEndpointDAOService.

I am not sure how to make the avdl file look into the namespace of CamelEndpoint. I am importing the schema but not sure how to get the namespace correctly.

Regards
--
Atin Sood
Sent with Sparrow<http://www.sparrowmailapp.com/?sig>