cassandra - Check if a certain file exists in CFS from Java code -


after online example tried following:

configuration config = new configuration(); config.set("fs.default.name","cfs://x.x.x.x:9000/"); // actual ip in here config.set("fs.cfs.impl","org.apache.cassandra.hadoop.fs.cassandrafilesystem"); filesystem fs = filesystem.get(config); system.out.println(fs.exists(new path("cfs:///path/to/file"))); 

but can't find jar containing cassandrafilesystem. wonder if it's old version or something. have cql driver in classpath, i.e., gradle dependency com.datastax.cassandra:cassandra-driver-core:2.0.1, class cassandrafilesystem not ship artifact.

what's idiom check file existence in cfs? using datastax enterprise 4.0.1.

edit: clear, problem here seems finding class cassandrafilesystem. can't find anywhere in dse jar although usage documented. deprecated? in other jar besides com.datastax.cassandra:cassandra-driver-core:2.0.1?

if have maven project add following maven dependency pom.xml

   <dependency>       <groupid>com.datastax.cassandra</groupid>       <artifactid>cassandra-driver-core</artifactid>       <version>${cassandra.driver.version}</version>       <scope>provided</scope>     </dependency> 

otherwise add jar project class path.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -