scylla-code-samples
scylla-code-samples copied to clipboard
Sata machine import data single thread is very slow
I install scylla with this doc:docs, withe developer mode on. and i insert data single thread the data writing speed is "3M/min" is there any reason ? ` public static void createTable() { // a,b为复合主键 a:分区键,b:集群键 String cql = "CREATE TABLE if not exists mydb.test (a text,PRIMARY KEY (a))"; session.execute(cql); } public static void close(){ session.close(); cluster.close(); System.out.println("close."); } public static void insert(String value) { String cql = "INSERT INTO mydb.test (a ) VALUES ('" + value + "');"; session.execute(cql); }
public static void createKeyspace()
{
// 单数据中心 复制策略 :1
String cql = "CREATE KEYSPACE if not exists mydb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}";
session.execute(cql);
}
public static void main(String[] args) throws IOException {
connect();
String fileName = "vertex_person";
File file = new File(fileName);
BufferedReader reader = null;
StringBuffer sbf = new StringBuffer();
createKeyspace();
createTable();
try {
reader = new BufferedReader(new FileReader(file));
String tempStr;
int count =0;
while ((tempStr = reader.readLine()) != null) {
insert(tempStr);
count += 1;
System.out.println(count);
}
}catch (Exception e){
e.printStackTrace();
}
close();
}
`
Better open the issue in https://github.com/scylladb/scylla