• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PartitionQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query){
  List<InputSplit> splits = null;
  List<PartitionQuery<K, T>> queries = null;
  try{
    splits = GoraMapReduceUtils.getSplits(getConf(), inputPath);
    queries = new ArrayList<>(splits.size());

    for(InputSplit split : splits) {
      queries.add(new FileSplitPartitionQuery<>(query, (FileSplit) split));
    }
  }catch(IOException ex){
    LOG.error(ex.getMessage(), ex);
  }
  return queries;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:17,代码来源:FileBackedDataStoreBase.java


示例2: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query){
  List<InputSplit> splits = null;
  List<PartitionQuery<K, T>> queries = null;
  try{
    splits = GoraMapReduceUtils.getSplits(getConf(), inputPath);
    queries = new ArrayList<PartitionQuery<K,T>>(splits.size());

    for(InputSplit split : splits) {
      queries.add(new FileSplitPartitionQuery<K, T>(query, (FileSplit) split));
    }
  }catch(IOException ex){
    LOG.error(ex.getMessage());
    LOG.error(ex.getStackTrace().toString());
  }
  return queries;
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:18,代码来源:FileBackedDataStoreBase.java


示例3: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query)
    throws IOException {
  // TODO: implement this using Hadoop DB support

  ArrayList<PartitionQuery<K, T>> partitions = new ArrayList<>();
  PartitionQueryImpl<K, T> pqi = new PartitionQueryImpl<>(query);
  pqi.setConf(getConf());
  partitions.add(pqi);

  return partitions;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:13,代码来源:SolrStore.java


示例4: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
/**
 * Returns a single partition containing the original query
 */
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query){
  List<PartitionQuery<K, T>> list = new ArrayList<>();
  PartitionQueryImpl<K, T> pqi = new PartitionQueryImpl<>(query);
  pqi.setConf(getConf());
  list.add(pqi);
  return list;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:12,代码来源:MemStore.java


示例5: setInputPath

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private void setInputPath(PartitionQuery<K,T> partitionQuery
    , TaskAttemptContext context) throws IOException {
  //if the data store is file based
  if(partitionQuery instanceof FileSplitPartitionQuery) {
    FileSplit split = ((FileSplitPartitionQuery<K,T>)partitionQuery).getSplit();
    //set the input path to FileSplit's path.
    ((FileBackedDataStore)partitionQuery.getDataStore()).setInputPath(
        split.getPath().toString());
  }
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:12,代码来源:GoraInputFormat.java


示例6: createRecordReader

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public RecordReader<K, T> createRecordReader(InputSplit split,
    TaskAttemptContext context) throws IOException, InterruptedException {
  PartitionQuery<K,T> partitionQuery = (PartitionQuery<K, T>)
    ((GoraInputSplit)split).getQuery();

  setInputPath(partitionQuery, context);
  return new GoraRecordReader<>(partitionQuery, context);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:11,代码来源:GoraInputFormat.java


示例7: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
public List<PartitionQuery<String, MockPersistent>> getPartitions(
    Query<String, MockPersistent> query) throws IOException {

  ArrayList<PartitionQuery<String, MockPersistent>> list =
    new ArrayList<>();

  for(int i=0; i<NUM_PARTITIONS; i++) {
    list.add(new PartitionQueryImpl<>(query, LOCATIONS[i]));
  }

  return list;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:14,代码来源:MockDataStore.java


示例8: testGetSplits

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
/**
 * First, asserts that the attempt to obtain splits results in 
 * greater than 0 splits which can be used for computation.
 * We then check that the partition query (obtained by using the 
 * splits) has the same fields as we would expect by directly 
 * accessing the fields of an Employee object.
 * @throws IOException
 * @throws InterruptedException
 */
@Test
@SuppressWarnings("rawtypes")
public void testGetSplits() throws IOException, InterruptedException {
  List<InputSplit> splits = getInputSplits();

  assertTrue(splits.size() > 0);

  InputSplit split = splits.get(0);
  PartitionQuery query = ((GoraInputSplit)split).getQuery();
  assertTrue(Arrays.equals(getEmployeeFieldNames(), query.getFields()));
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:21,代码来源:TestGoraInputFormat.java


示例9: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
private List<PartitionQuery<String, MockPersistent>> 
  getPartitions() throws IOException {
  MockDataStore store = MockDataStore.get();
  MockQuery query = store.newQuery();

  List<PartitionQuery<String, MockPersistent>> partitions =
    store.getPartitions(query);
  return partitions;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:10,代码来源:TestGoraInputSplit.java


示例10: testGetLocations

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Test
public void testGetLocations() throws IOException {
  List<PartitionQuery<String, MockPersistent>> partitions = 
    getPartitions();

  int i=0;
  for(PartitionQuery<String, MockPersistent> partition : partitions) {
    GoraInputSplit split = new GoraInputSplit(conf, partition);
    assertEquals(split.getLocations().length, 1);
    assertEquals(split.getLocations()[0], MockDataStore.LOCATIONS[i++]);
  }
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:13,代码来源:TestGoraInputSplit.java


示例11: testReadWrite

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Test
public void testReadWrite() throws Exception {
  
  List<PartitionQuery<String, MockPersistent>> partitions = 
    getPartitions();

  for(PartitionQuery<String, MockPersistent> partition : partitions) {
    GoraInputSplit split = new GoraInputSplit(conf, partition);
    TestWritable.testWritable(split);
  }
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:12,代码来源:TestGoraInputSplit.java


示例12: testGetPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
public static void testGetPartitions(DataStore<String, WebPage> store
    , Query<String, WebPage> query) throws Exception {
  List<PartitionQuery<String, WebPage>> partitions = store.getPartitions(query);

  assertNotNull(partitions);
  assertTrue(partitions.size() > 0);

  for(PartitionQuery<String, WebPage> partition:partitions) {
    assertNotNull(partition);
  }

  assertPartitions(store, query, partitions);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:14,代码来源:DataStoreTestUtil.java


示例13: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query)
    throws IOException {
  // TODO GORA-298 Implement CassandraStore#getPartitions
  List<PartitionQuery<K,T>> partitions = new ArrayList<>();
  PartitionQueryImpl<K, T> pqi = new PartitionQueryImpl<>(query);
  pqi.setConf(getConf());
  partitions.add(pqi);
  return partitions;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:11,代码来源:CassandraStore.java


示例14: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
/**
 * Partitions the given query and returns a list of PartitionQuerys, which
 * will execute on local data.
 */
@Override
public List<PartitionQuery<K, T>> getPartitions(final Query<K, T> query)
    throws IOException {
  // FIXME: for now, there is only one partition as we do not handle
  // MongoDB sharding configuration
  List<PartitionQuery<K, T>> partitions = new ArrayList<>();
  PartitionQueryImpl<K, T> partitionQuery = new PartitionQueryImpl<>(
      query);
  partitionQuery.setConf(getConf());
  partitions.add(partitionQuery);
  return partitions;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:17,代码来源:MongoStore.java


示例15: setInputPath

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private void setInputPath(PartitionQuery<K, T> partitionQuery) throws IOException {
  //if the data store is file based
  if(partitionQuery instanceof FileSplitPartitionQuery) {
    FileSplit split = ((FileSplitPartitionQuery<K,T>)partitionQuery).getSplit();
    //set the input path to FileSplit's path.
    ((FileBackedDataStore)partitionQuery.getDataStore()).setInputPath(
        split.getPath().toString());
  }
}
 
开发者ID:apache,项目名称:gora,代码行数:11,代码来源:GoraInputFormat.java


示例16: createRecordReader

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public RecordReader<K, T> createRecordReader(InputSplit split,
    TaskAttemptContext context) throws IOException, InterruptedException {
  PartitionQuery<K,T> partitionQuery = (PartitionQuery<K, T>)
    ((GoraInputSplit)split).getQuery();

  setInputPath(partitionQuery);
  return new GoraRecordReader<>(partitionQuery, context);
}
 
开发者ID:apache,项目名称:gora,代码行数:11,代码来源:GoraInputFormat.java


示例17: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws IOException {
  List<PartitionQuery<K, T>> partitions = new ArrayList<>();
  PartitionWSQueryImpl<K, T> pqi = new PartitionWSQueryImpl<>(query);
  pqi.setDataStore(this);
  partitions.add(pqi);
  return partitions;
}
 
开发者ID:apache,项目名称:gora,代码行数:12,代码来源:CassandraStore.java


示例18: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws IOException {

  final List<PartitionQuery<K, T>> list = new ArrayList<>();
  final PartitionQueryImpl<K, T> pqi = new PartitionQueryImpl<>(query);

  pqi.setConf(getConf());
  list.add(pqi);
  return list;
}
 
开发者ID:apache,项目名称:gora,代码行数:11,代码来源:CouchDBStore.java


示例19: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * As the Aerospike does not support query key ranges as at the moment, only the single partition
 * is retrieved with this method.
 *
 * @param query the query to execute.
 * @return the list of partitions, one partion at the list as at the moment
 */
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws IOException {
  List<PartitionQuery<K, T>> partitions = new ArrayList<>();
  PartitionQueryImpl<K, T> partitionQuery = new PartitionQueryImpl<>(
          query);
  partitionQuery.setConf(getConf());
  partitions.add(partitionQuery);
  return partitions;
}
 
开发者ID:apache,项目名称:gora,代码行数:18,代码来源:AerospikeStore.java


示例20: getPartitions

import org.apache.gora.query.PartitionQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws IOException {
  // TODO : Improve code on OrientDB clusters
  List<PartitionQuery<K, T>> partitions = new ArrayList<>();
  PartitionQueryImpl<K, T> partitionQuery = new PartitionQueryImpl<>(
          query);
  partitionQuery.setConf(this.getConf());
  partitions.add(partitionQuery);
  return partitions;
}
 
开发者ID:apache,项目名称:gora,代码行数:14,代码来源:OrientDBStore.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RDFParserRegistry类代码示例发布时间:2022-05-23
下一篇:
Java DefaultBeanNameGenerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap