public static JobQueueDataset getJobQueue(DatasetContext context, DatasetFramework dsFramework, CConfiguration cConf) { try { return DatasetsUtil.getOrCreateDataset( context, dsFramework, JOB_QUEUE_DATASET_ID, JobQueueDataset.class.getName(), () -> DatasetProperties.of( Collections.singletonMap(Constants.Scheduler.JOB_QUEUE_NUM_PARTITIONS, cConf.get(Constants.Scheduler.JOB_QUEUE_NUM_PARTITIONS)))); } catch (DatasetManagementException | IOException e) { throw Throwables.propagate(e); } }
public static JobQueueDataset getJobQueue(DatasetContext context, DatasetFramework dsFramework, CConfiguration cConf) { try { return DatasetsUtil.getOrCreateDataset( context, dsFramework, JOB_QUEUE_DATASET_ID, JobQueueDataset.class.getName(), () -> DatasetProperties.of( Collections.singletonMap(Constants.Scheduler.JOB_QUEUE_NUM_PARTITIONS, cConf.get(Constants.Scheduler.JOB_QUEUE_NUM_PARTITIONS)))); } catch (DatasetManagementException | IOException e) { throw Throwables.propagate(e); } }
/** * strip schema from the properties sent to the underlying table, since ObjectStore allows schema that tables do not */ private DatasetProperties checkAndRemoveSchema(DatasetProperties properties) { Preconditions.checkArgument(properties.getProperties().containsKey("type")); Preconditions.checkArgument(properties.getProperties().containsKey("schema")); Map<String, String> tableProperties = Maps.newHashMap(properties.getProperties()); tableProperties.remove("type"); tableProperties.remove("schema"); return DatasetProperties.of(tableProperties); }
/** * strip schema from the properties sent to the underlying table, since ObjectStore allows schema that tables do not */ private DatasetProperties checkAndRemoveSchema(DatasetProperties properties) { Preconditions.checkArgument(properties.getProperties().containsKey("type")); Preconditions.checkArgument(properties.getProperties().containsKey("schema")); Map<String, String> tableProperties = Maps.newHashMap(properties.getProperties()); tableProperties.remove("type"); tableProperties.remove("schema"); return DatasetProperties.of(tableProperties); }
private static DatasetProperties parseBodyAsProps(HttpServiceRequest request) { String body = Bytes.toString(request.getContent()); if (body.isEmpty()) { return DatasetProperties.EMPTY; } Map<String, String> props = GSON.fromJson(body, new TypeToken<Map<String, String>>() { }.getType()); return DatasetProperties.of(props); } }
updatedProperties.remove(Constants.AppFabric.WORKFLOW_KEEP_LOCAL); datasetFramework.updateInstance(new DatasetId(TEST_NAMESPACE1, summary.getName()), DatasetProperties.of(updatedProperties));
DatasetProperties datasetProperties = DatasetProperties.of(properties); DatasetCreationResponse response = opExecutorClient.update(instance, typeMeta, datasetProperties, existing); DatasetSpecification spec = response.getSpec();
DatasetProperties datasetProperties = DatasetProperties.of(properties); DatasetCreationResponse response = opExecutorClient.update(instance, typeMeta, datasetProperties, existing); DatasetSpecification spec = response.getSpec();