当前位置: 首页>>代码示例>>Java>>正文


Java DatasetRecord类代码示例

本文整理汇总了Java中wherehows.common.schemas.DatasetRecord的典型用法代码示例。如果您正苦于以下问题:Java DatasetRecord类的具体用法?Java DatasetRecord怎么用?Java DatasetRecord使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatasetRecord类属于wherehows.common.schemas包,在下文中一共展示了DatasetRecord类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: insertDataset

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void insertDataset(JsonNode dataset)
  throws Exception {

  ObjectMapper om = new ObjectMapper();
  om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
  DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);

  if (record.getRefDatasetUrn() != null) {
    Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
    // Find ref dataset id
    if (refDataset != null) {
      record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
    }
  }


  DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
  dw.append(record);
  dw.close();
}
 
开发者ID:SirAeroWN,项目名称:premier-wherehows,代码行数:21,代码来源:DatasetDao.java

示例2: setDatasetRecord

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void setDatasetRecord (JsonNode dataset) throws Exception {
  ObjectMapper om = new ObjectMapper();
  om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
  DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);

  if (record != null) {
    Map<String, Object> params = new HashMap<>();
    params.put("urn", record.getUrn());
    if (record.getUrn().indexOf(":///") == -1) {
      throw new Exception("improperly formatted urn: " + record.getUrn() + ", requires ':///'");
    }
    try {
      Map<String, Object> result = JdbcUtil.wherehowsNamedJdbcTemplate.queryForMap(GET_DATASET_BY_URN, params);
      updateDataset(dataset);
    } catch (EmptyResultDataAccessException e) {
      insertDataset(dataset);
    }
  }
}
 
开发者ID:SirAeroWN,项目名称:premier-wherehows,代码行数:20,代码来源:DatasetDao.java

示例3: updateDataset

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void updateDataset(JsonNode dataset)
  throws Exception {
  ObjectMapper om = new ObjectMapper();
  om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
  DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);
  if (record.getRefDatasetUrn() != null) {
    Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
    // Find ref dataset id
    if (refDataset != null) {
      record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
    }
  }

  DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
  dw.update(record.toUpdateDatabaseValue(), record.getUrn());
  dw.close();
}
 
开发者ID:SirAeroWN,项目名称:premier-wherehows,代码行数:18,代码来源:DatasetDao.java

示例4: insertDataset

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void insertDataset(JsonNode dataset)
  throws Exception {

  ObjectMapper om = new ObjectMapper();
  om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
  DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);
  if (record.getRefDatasetUrn() != null) {
    Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
    // Find ref dataset id
    if (refDataset != null) {
      record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
    }
  }


  // Find layout id
  if (record.getSamplePartitionFullPath() != null) {
    PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
    record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
  }

  DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
  dw.append(record);
  dw.close();
}
 
开发者ID:thomas-young-2013,项目名称:wherehowsX,代码行数:26,代码来源:DatasetDao.java

示例5: setDatasetRecord

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void setDatasetRecord (JsonNode dataset)
  throws Exception {
  ObjectMapper om = new ObjectMapper();
  om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
  DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);

  if (record != null) {
    Map<String, Object> params = new HashMap<>();
    params.put("urn", record.getUrn());
    try {
      Map<String, Object> result = JdbcUtil.wherehowsNamedJdbcTemplate.queryForMap(GET_DATASET_BY_URN, params);
      updateDataset(dataset);
    } catch (EmptyResultDataAccessException e) {
      insertDataset(dataset);
    }
  }
}
 
开发者ID:thomas-young-2013,项目名称:wherehowsX,代码行数:18,代码来源:DatasetDao.java

示例6: updateDataset

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void updateDataset(JsonNode dataset)
  throws Exception {
  ObjectMapper om = new ObjectMapper();
  om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
  DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);
  if (record.getRefDatasetUrn() != null) {
    Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
    // Find ref dataset id
    if (refDataset != null) {
      record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
    }
  }
  // Find layout id
  if (record.getSamplePartitionFullPath() != null) {
    PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
    record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
  }

  DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
  dw.update(record.toUpdateDatabaseValue(), record.getUrn());
  dw.close();
}
 
开发者ID:thomas-young-2013,项目名称:wherehowsX,代码行数:23,代码来源:DatasetDao.java

示例7: insertDataset

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void insertDataset(DatasetRecord record) throws Exception {
  if (record.getRefDatasetUrn() != null) {
    Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
    // Find ref dataset id
    if (refDataset != null) {
      record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
    }
  }

  // Find layout id
  if (record.getSamplePartitionFullPath() != null) {
    PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
    record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
  }

  DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
  dw.append(record);
  dw.close();
}
 
开发者ID:linkedin,项目名称:WhereHows,代码行数:20,代码来源:DatasetDao.java

示例8: updateDataset

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void updateDataset(DatasetRecord record) throws Exception {
  if (record.getRefDatasetUrn() != null) {
    Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
    // Find ref dataset id
    if (refDataset != null) {
      record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
    }
  }
  // Find layout id
  if (record.getSamplePartitionFullPath() != null) {
    PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
    record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
  }

  DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
  dw.update(record.toUpdateDatabaseValue(), record.getUrn());
  dw.close();
}
 
开发者ID:linkedin,项目名称:WhereHows,代码行数:19,代码来源:DatasetDao.java

示例9: setDatasetRecord

import wherehows.common.schemas.DatasetRecord; //导入依赖的package包/类
public static void setDatasetRecord (DatasetRecord record)
    throws Exception {
  if (record != null) {
    Map<String, Object> params = new HashMap<>();
    params.put("urn", record.getUrn());
    try {
      Map<String, Object> result = JdbcUtil.wherehowsNamedJdbcTemplate.queryForMap(GET_DATASET_BY_URN, params);
      updateDataset(record);
    } catch (EmptyResultDataAccessException e) {
      insertDataset(record);
    }
  }
}
 
开发者ID:linkedin,项目名称:WhereHows,代码行数:14,代码来源:DatasetDao.java


注:本文中的wherehows.common.schemas.DatasetRecord类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。