tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}// k
inserters[i].insert(new BytesWritable(("key1" + i).getBytes()), tuple);
}// i
}// b
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}
writer.close();
/*
* create 2nd basic table;
*/
pathTable2 = new Path(pathWorking, "2");
System.out.println("pathTable2 =" + pathTable2);
writer = new BasicTable.Writer(pathTable2, STR_SCHEMA2, STR_STORAGE2,
conf);
schema = writer.getSchema();
tuple = TypesUtils.createTuple(schema);
inserters = new TableInserter[numsInserters];
for (int i = 0; i < numsInserters; i++) {
inserters[i] = writer.getInserter("ins" + i, false);
}
for (int b = 0; b < numsBatch; b++) {
for (int i = 0; i < numsInserters; i++) {
TypesUtils.resetTuple(tuple);
for (int k = 0; k < tuple.size(); ++k) {
try {
tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}
inserters[i].insert(new BytesWritable(("key2" + i).getBytes()), tuple);
}
}
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}
writer.close();
/*
* create 3rd basic table;
*/
pathTable3 = new Path(pathWorking, "3");
System.out.println("pathTable3 =" + pathTable3);
writer = new BasicTable.Writer(pathTable3, STR_SCHEMA3, STR_STORAGE3,
conf);
schema = writer.getSchema();
tuple = TypesUtils.createTuple(schema);
inserters = new TableInserter[numsInserters];
for (int i = 0; i < numsInserters; i++) {
inserters[i] = writer.getInserter("ins" + i, false);
}
for (int b = 0; b < numsBatch; b++) {
for (int i = 0; i < numsInserters; i++) {
TypesUtils.resetTuple(tuple);
for (int k = 0; k < tuple.size(); ++k) {
try {
tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}
inserters[i].insert(new BytesWritable(("key3" + i).getBytes()), tuple);
}
}
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}
writer.close();
/*
* create 4th basic table;
*/
pathTable4 = new Path(pathWorking, "4");
System.out.println("pathTable4 =" + pathTable4);
writer = new BasicTable.Writer(pathTable4, STR_SCHEMA4, STR_STORAGE4,
conf);
schema = writer.getSchema();
tuple = TypesUtils.createTuple(schema);
inserters = new TableInserter[numsInserters];
for (int i = 0; i < numsInserters; i++) {
inserters[i] = writer.getInserter("ins" + i, false);
}
for (int b = 0; b < numsBatch; b++) {
for (int i = 0; i < numsInserters; i++) {
TypesUtils.resetTuple(tuple);
for (int k = 0; k < tuple.size(); ++k) {
try {
tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}
inserters[i].insert(new BytesWritable(("key4" + i).getBytes()), tuple);
}
}
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}
writer.close();
/*
* create 5th basic table;
*/
pathTable5 = new Path(pathWorking, "5");
System.out.println("pathTable5 =" + pathTable5);
writer = new BasicTable.Writer(pathTable5, STR_SCHEMA5, STR_STORAGE5,
conf);
schema = writer.getSchema();
tuple = TypesUtils.createTuple(schema);
inserters = new TableInserter[numsInserters];
for (int i = 0; i < numsInserters; i++) {
inserters[i] = writer.getInserter("ins" + i, false);
}
for (int b = 0; b < numsBatch; b++) {
for (int i = 0; i < numsInserters; i++) {
TypesUtils.resetTuple(tuple);
for (int k = 0; k < tuple.size(); ++k) {
try {
tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}
inserters[i].insert(new BytesWritable(("key5" + i).getBytes()), tuple);
}
}
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}