@@ -0,0 +1,1394 @@
+package cassandra.tests;%0A%0Aimport java.util.Arrays;%0A%0Aimport me.prettyprint.cassandra.service.CassandraHostConfigurator;%0Aimport me.prettyprint.cassandra.service.ThriftKsDef;%0Aimport me.prettyprint.hector.api.Cluster;%0Aimport me.prettyprint.hector.api.ddl.ColumnFamilyDefinition;%0Aimport me.prettyprint.hector.api.ddl.KeyspaceDefinition;%0Aimport me.prettyprint.hector.api.factory.HFactory;%0A%0Apublic class BulkInsert %7B%0A%09public static String CLUSTER_NAME = %22dcim-cluster%22;%0A%09public static String CASSANDRA_HOST = %22192.168.0.78:9160%22;%0A%09public static String MONITORDB_KEYSPACE = %22monitordb%22;%0A%09public static int REPLICATION_FACTOR = 3;%0A%09public static String COLUMN_FAMILY_HISTORY_AI = %22history_ai%22;%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Cluster cluster = HFactory.getOrCreateCluster(CLUSTER_NAME, new CassandraHostConfigurator(CASSANDRA_HOST));%0A%09%09KeyspaceDefinition keyspaceDef = cluster.describeKeyspace(MONITORDB_KEYSPACE);%0A%09%09if (keyspaceDef == null) %7B%0A%09%09%09createSchema(cluster);%0A%09%09%7D%0A%09%7D%0A%0A%09private static void createSchema(Cluster cluster) %7B%0A%09%09ColumnFamilyDefinition columnFamilyDef = HFactory.createColumnFamilyDefinition(MONITORDB_KEYSPACE,%0A%09%09%09%09COLUMN_FAMILY_HISTORY_AI);%0A%09%09KeyspaceDefinition keyspace = HFactory.createKeyspaceDefinition(MONITORDB_KEYSPACE,%0A%09%09%09%09ThriftKsDef.NETWORK_TOPOLOGY_STRATEGY, REPLICATION_FACTOR, Arrays.asList(columnFamilyDef));%0A%09%09cluster.addKeyspace(keyspace, true);%0A%09%7D%0A%0A%7D%0A

test connection.