Search in sources :

Example 1 with AppToFlowTable

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();
        }
    }
}
Also used : EntityTable(org.apache.hadoop.yarn.server.timelineservice.storage.entity.EntityTable) FlowActivityTable(org.apache.hadoop.yarn.server.timelineservice.storage.flow.FlowActivityTable) AppToFlowTable(org.apache.hadoop.yarn.server.timelineservice.storage.apptoflow.AppToFlowTable) ApplicationTable(org.apache.hadoop.yarn.server.timelineservice.storage.application.ApplicationTable) FlowRunTable(org.apache.hadoop.yarn.server.timelineservice.storage.flow.FlowRunTable) Connection(org.apache.hadoop.hbase.client.Connection) IOException(java.io.IOException) Admin(org.apache.hadoop.hbase.client.Admin) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 2 with AppToFlowTable

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);
}
Also used : EntityTable(org.apache.hadoop.yarn.server.timelineservice.storage.entity.EntityTable) FlowActivityTable(org.apache.hadoop.yarn.server.timelineservice.storage.flow.FlowActivityTable) AppToFlowTable(org.apache.hadoop.yarn.server.timelineservice.storage.apptoflow.AppToFlowTable) ApplicationTable(org.apache.hadoop.yarn.server.timelineservice.storage.application.ApplicationTable) FlowRunTable(org.apache.hadoop.yarn.server.timelineservice.storage.flow.FlowRunTable) Configuration(org.apache.hadoop.conf.Configuration) HBaseConfiguration(org.apache.hadoop.hbase.HBaseConfiguration)

Aggregations

ApplicationTable (org.apache.hadoop.yarn.server.timelineservice.storage.application.ApplicationTable)2 AppToFlowTable (org.apache.hadoop.yarn.server.timelineservice.storage.apptoflow.AppToFlowTable)2 EntityTable (org.apache.hadoop.yarn.server.timelineservice.storage.entity.EntityTable)2 FlowActivityTable (org.apache.hadoop.yarn.server.timelineservice.storage.flow.FlowActivityTable)2 FlowRunTable (org.apache.hadoop.yarn.server.timelineservice.storage.flow.FlowRunTable)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 IOException (java.io.IOException)1 Configuration (org.apache.hadoop.conf.Configuration)1 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)1 Admin (org.apache.hadoop.hbase.client.Admin)1 Connection (org.apache.hadoop.hbase.client.Connection)1