use of org.apache.hadoop.yarn.server.timelineservice.storage.apptoflow.AppToFlowTable in project hadoop by apache.
the class TimelineSchemaCreator method createAllTables.
@VisibleForTesting
public static void createAllTables(Configuration hbaseConf, boolean skipExisting) throws IOException {
Connection conn = null;
try {
conn = ConnectionFactory.createConnection(hbaseConf);
Admin admin = conn.getAdmin();
if (admin == null) {
throw new IOException("Cannot create table since admin is null");
}
try {
new EntityTable().createTable(admin, hbaseConf);
} catch (IOException e) {
if (skipExisting) {
LOG.warn("Skip and continue on: " + e.getMessage());
} else {
throw e;
}
}
try {
new AppToFlowTable().createTable(admin, hbaseConf);
} catch (IOException e) {
if (skipExisting) {
LOG.warn("Skip and continue on: " + e.getMessage());
} else {
throw e;
}
}
try {
new ApplicationTable().createTable(admin, hbaseConf);
} catch (IOException e) {
if (skipExisting) {
LOG.warn("Skip and continue on: " + e.getMessage());
} else {
throw e;
}
}
try {
new FlowRunTable().createTable(admin, hbaseConf);
} catch (IOException e) {
if (skipExisting) {
LOG.warn("Skip and continue on: " + e.getMessage());
} else {
throw e;
}
}
try {
new FlowActivityTable().createTable(admin, hbaseConf);
} catch (IOException e) {
if (skipExisting) {
LOG.warn("Skip and continue on: " + e.getMessage());
} else {
throw e;
}
}
} finally {
if (conn != null) {
conn.close();
}
}
}
use of org.apache.hadoop.yarn.server.timelineservice.storage.apptoflow.AppToFlowTable in project hadoop by apache.
the class HBaseTimelineWriterImpl method serviceInit.
/**
* initializes the hbase connection to write to the entity table.
*/
@Override
protected void serviceInit(Configuration conf) throws Exception {
super.serviceInit(conf);
Configuration hbaseConf = HBaseConfiguration.create(conf);
conn = ConnectionFactory.createConnection(hbaseConf);
entityTable = new EntityTable().getTableMutator(hbaseConf, conn);
appToFlowTable = new AppToFlowTable().getTableMutator(hbaseConf, conn);
applicationTable = new ApplicationTable().getTableMutator(hbaseConf, conn);
flowRunTable = new FlowRunTable().getTableMutator(hbaseConf, conn);
flowActivityTable = new FlowActivityTable().getTableMutator(hbaseConf, conn);
}
Aggregations