You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Suresh Marru <sm...@apache.org> on 2015/06/11 17:01:11 UTC

Thrift file naming convention

Hi,

Is there is a thrift file naming convention, especially for long file names?

I changed a thrift file from a name like computeResourceModel.thrift to compute-resource-model.thrift and the imports do not work. Just wondering if there is a suggested naming convention? 

Thanks,
Suresh



Re: Thrift file naming convention

Posted by Ronny Andersson <ro...@andersson.tk>.
> I changed a thrift file from a name like computeResourceModel.thrift to compute-resource-model.thrift and the imports do not work. 

You do not specify which language you are targeting but I am going to guess that it is python. If that is the case then modules cannot have a hypen ”-” in the name, so in your example compute-resource-model.py is not a valid module name that you can import. If you really need to do this, I would suggest underscores instead, compute_resource_model

/Ronny

Re: Thrift file naming convention

Posted by Randy Abernethy <ra...@gmail.com>.
@Jens: Yes!

Name Apache Thrift IDL source files with only letters and numbers (never
spaces or punctuation), always begin the file name with a letter and use
the suffix .thrift

Example: PacificNorthwestFish.thrift

On Thu, Jun 11, 2015 at 2:42 PM, Jens Geyer <je...@hotmail.com> wrote:

> Hi,
>
> There is no convention that I'm aware of, but sticking to "conventional"
> file names is not such a bad idea with Thrift indeed. Otherwise you may run
> into issues, as these file names are sometimes used for various purposes,
> such as default namespaces. One example is THRIFT-1383. In some cases it is
> possible to get rid of these issue by specifying a proper namespace within
> the IDL.
>
> @Randy: Is that something for your list?
>
> Have fun,
> JensG
>
>
> -----Ursprüngliche Nachricht----- From: Suresh Marru
> Sent: Thursday, June 11, 2015 5:01 PM
> To: user@thrift.apache.org
> Subject: Thrift file naming convention
>
>
> Hi,
>
> Is there is a thrift file naming convention, especially for long file
> names?
>
> I changed a thrift file from a name like computeResourceModel.thrift to
> compute-resource-model.thrift and the imports do not work. Just wondering
> if there is a suggested naming convention?
>
> Thanks,
> Suresh
>
>
>

Re: Thrift file naming convention

Posted by Jens Geyer <je...@hotmail.com>.
Hi,

There is no convention that I'm aware of, but sticking to "conventional" 
file names is not such a bad idea with Thrift indeed. Otherwise you may run 
into issues, as these file names are sometimes used for various purposes, 
such as default namespaces. One example is THRIFT-1383. In some cases it is 
possible to get rid of these issue by specifying a proper namespace within 
the IDL.

@Randy: Is that something for your list?

Have fun,
JensG


-----Ursprüngliche Nachricht----- 
From: Suresh Marru
Sent: Thursday, June 11, 2015 5:01 PM
To: user@thrift.apache.org
Subject: Thrift file naming convention

Hi,

Is there is a thrift file naming convention, especially for long file names?

I changed a thrift file from a name like computeResourceModel.thrift to 
compute-resource-model.thrift and the imports do not work. Just wondering if 
there is a suggested naming convention?

Thanks,
Suresh