@Override public ExecutingJobQueue getExecutingJobQueue(Config config) { return new MongoExecutingJobQueue(config); }
public MongoExecutingJobQueue(Config config) { super(config); // table name (Collection name) for single table setTableName(JobQueueUtils.EXECUTING_JOB_QUEUE); // create table DBCollection dbCollection = template.getCollection(); List<DBObject> indexInfo = dbCollection.getIndexInfo(); // create index if not exist if (CollectionUtils.sizeOf(indexInfo) <= 1) { template.ensureIndex("idx_jobId", "jobId", true, true); template.ensureIndex("idx_taskId_taskTrackerNodeGroup", "taskId, taskTrackerNodeGroup", true, true); template.ensureIndex("idx_realTaskId_taskTrackerNodeGroup", "realTaskId, taskTrackerNodeGroup"); template.ensureIndex("idx_jobType", "jobType"); template.ensureIndex("idx_taskTrackerIdentity", "taskTrackerIdentity"); template.ensureIndex("idx_gmtCreated", "gmtCreated"); } }
public MongoExecutingJobQueue(Config config) { super(config); // table name (Collection name) for single table setTableName(JobQueueUtils.EXECUTING_JOB_QUEUE); // create table DBCollection dbCollection = template.getCollection(); List<DBObject> indexInfo = dbCollection.getIndexInfo(); // create index if not exist if (CollectionUtils.sizeOf(indexInfo) <= 1) { template.ensureIndex("idx_jobId", "jobId", true, true); template.ensureIndex("idx_taskId_taskTrackerNodeGroup", "taskId, taskTrackerNodeGroup", true, true); template.ensureIndex("idx_realTaskId_taskTrackerNodeGroup", "realTaskId, taskTrackerNodeGroup"); template.ensureIndex("idx_jobType", "jobType"); template.ensureIndex("idx_taskTrackerIdentity", "taskTrackerIdentity"); template.ensureIndex("idx_gmtCreated", "gmtCreated"); } }
@Override public ExecutingJobQueue getExecutingJobQueue(Config config) { return new MongoExecutingJobQueue(config); }
public MongoExecutingJobQueue(Config config) { super(config); // table name (Collection name) for single table setTableName(JobQueueUtils.EXECUTING_JOB_QUEUE); // create table DBCollection dbCollection = template.getCollection(); List<DBObject> indexInfo = dbCollection.getIndexInfo(); // create index if not exist if (CollectionUtils.sizeOf(indexInfo) <= 1) { template.ensureIndex("idx_jobId", "jobId", true, true); template.ensureIndex("idx_taskId_taskTrackerNodeGroup", "taskId, taskTrackerNodeGroup", true, true); template.ensureIndex("idx_realTaskId_taskTrackerNodeGroup", "realTaskId, taskTrackerNodeGroup"); template.ensureIndex("idx_jobType", "jobType"); template.ensureIndex("idx_taskTrackerIdentity", "taskTrackerIdentity"); template.ensureIndex("idx_gmtCreated", "gmtCreated"); } }
@Override public ExecutingJobQueue getExecutingJobQueue(Config config) { return new MongoExecutingJobQueue(config); }