Database Reference
In-Depth Information
<target name="gen-thrift-java">
<echo>Generating Thrift Java code from ${basedir}/interface/cassandra.thrift
....</echo>
<exec executable="thrift" dir="${basedir}
/interface">
<arg line="--gen java" />
<arg line="-o ${interface.thrift.dir}" />
<arg line="cassandra.thrift" />
</exec>
</target>
<target name="gen-thrift-py">
<echo>Generating Thrift Python code from ${basedir}
/interface/cassandra.thrift ....</echo>
<exec executable="thrift" dir="${basedir}/interface">
<arg line="--gen py" />
<arg line="-o ${interface.thrift.dir}" />
<arg line="cassandra.thrift" />
</exec>
</target>
//etc...
These Ant targets call the Thrift program directly, passing arguments to it for each of the dif-
ferent languages. Note that the distribution ships with generated Java API; these targets are not
called during a regular build. So if you want to get a Perl or Python interface, you need to ex-
ecute these targets directly (or modify the build file to include these targets).
NOTE
To generate Thrift bindings for other languages, pass it to the --gen switch (for example, thrift --
gen php ).
The Ant targets use the libthrift-r917130.jarlocated in Cassandra's libdirectory. Note that the
Thrift JAR version number changes as Cassandra is updated.
Thrift Support for Java
To build Thrift for Java, navigate to the directory <thrift-home>/lib/java. Execute the build.xml
script by typing >ant in a terminal.
Search WWH ::




Custom Search