dbConnectionPool); if (created) { DBHelper.createDerbyIndex(dbConnectionPool, "clusters_account_index", "clusters", "tenant_id", "owner_id", "id"); DBHelper.createDerbyIndex(dbConnectionPool, "clusters_ctime_index", "clusters", "create_time"); DBHelper.createDerbyIndex(dbConnectionPool, "clusters_status_index", "clusters", "status"); dbConnectionPool); if (created) { DBHelper.createDerbyIndex(dbConnectionPool, "jobs_ctime_index", "jobs", "create_time"); DBHelper.createDerbyIndex(dbConnectionPool, "jobs_status_index", "jobs", "status"); dbConnectionPool); if (created) { DBHelper.createDerbyIndex(dbConnectionPool, "tasks_status_time_index", "tasks", "status_time"); DBHelper.createDerbyIndex(dbConnectionPool, "tasks_submit_time_index", "tasks", "submit_time"); DBHelper.createDerbyIndex(dbConnectionPool, "tasks_status_index", "tasks", "status"); dbConnectionPool); if (created) { DBHelper.createDerbyIndex(dbConnectionPool, "nodes_cluster_index", "nodes", "cluster_id", "id");
@Override protected void startUp() throws Exception { if (dbConnectionPool.isEmbeddedDerbyDB()) { LOG.warn("Initializing Derby DB... Tables are not optimized for performance."); boolean created = DBHelper.createDerbyTableIfNotExists("CREATE TABLE nodes ( " + "cluster_id BIGINT, " + "id VARCHAR(64), " + "node BLOB, " + "PRIMARY KEY (id) )", dbConnectionPool ); if (created) { DBHelper.createDerbyIndex(dbConnectionPool, "nodes_cluster_index", "nodes", "cluster_id", "id"); } } }
@Override protected void startUp() throws Exception { if (dbConnectionPool.isEmbeddedDerbyDB()) { boolean created = DBHelper.createDerbyTableIfNotExists( "CREATE TABLE pluginMeta (" + "tenant_id VARCHAR(255), " + "plugin_type VARCHAR(16), " + "plugin_name VARCHAR(255), " + "resource_type VARCHAR(255), " + "name VARCHAR(255), " + "version INTEGER, " + "live BOOLEAN, " + "slated BOOLEAN, " + "deleted BOOLEAN, " + "create_time TIMESTAMP," + "delete_time TIMESTAMP," + "PRIMARY KEY(tenant_id, plugin_type, plugin_name, resource_type, name, version) )", dbConnectionPool); if (created) { DBHelper.createDerbyIndex(dbConnectionPool, "plugin_meta_index", "pluginMeta", "tenant_id", "plugin_type", "plugin_name", "resource_type", "name", "version"); } } }
@Override protected void startUp() throws Exception { if (dbConnectionPool.isEmbeddedDerbyDB()) { DBHelper.createDerbyTableIfNotExists("CREATE TABLE provisioners (" + "id VARCHAR(255), " + "last_heartbeat TIMESTAMP, " + "capacity_total INTEGER, " + "capacity_free INTEGER, " + "provisioner BLOB, " + "PRIMARY KEY (id) )", dbConnectionPool); DBHelper.createDerbyIndex(dbConnectionPool, "provisioners_heartbeat_index", "provisioners", "last_heartbeat"); DBHelper.createDerbyTableIfNotExists("CREATE TABLE provisionerWorkers (" + "provisioner_id VARCHAR(255), " + "tenant_id VARCHAR(255), " + "num_assigned INTEGER, " + "num_live INTEGER, " + "PRIMARY KEY (tenant_id, provisioner_id) )", dbConnectionPool); } }