Database Reference
In-Depth Information
4.
Now let's have a look at the Java implementation:
if (args.length == 0)
{
filename = " CSVInput.csv";
}
else
{
filename = args[0];
}
BufferedReader reader = new
BufferedReader( new FileReader( filename ));
String keyspace = "Cql3Demo";
String columnFamily = "Users";
// create cassandra type structure default is
data/KEYSPACE/users
File directory = new File("data");
if (!directory.exists())
{
directory.mkdir();
}
directory = new
File(directory.getPath() + "/" + keyspace);
if (!directory.exists())
directory.mkdir();
directory = new
File(directory.getPath() + "/" +
columnFamily);
if (!directory.exists())
directory.mkdir();
Search WWH ::




Custom Search