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


Java Result.close方法代码示例

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


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

示例1: assertNumResults

import org.apache.gora.query.Result; //导入方法依赖的package包/类
public static<K,T extends Persistent> void assertNumResults(Query<K, T>query
    , long numResults) throws Exception {
  Result<K, T> result = query.execute();
  int actualNumResults = 0;
  while(result.next()) {
    actualNumResults++;
  }
  result.close();
  assertEquals(numResults, actualNumResults);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:11,代码来源:DataStoreTestUtil.java

示例2: assertProgress

import org.apache.gora.query.Result; //导入方法依赖的package包/类
private void assertProgress(Query<String, WebPage> q, float... progress) throws Exception {
  Result<String, WebPage> r = webPageStore.execute(q);
  int i = 0;
  do {
    assertEquals(progress[i++], r.getProgress(), 0.01f);
  } while (r.next());
  r.close();
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:9,代码来源:TestMongoStore.java

示例3: assertNumResults

import org.apache.gora.query.Result; //导入方法依赖的package包/类
public static<K,T extends Persistent> void assertNumResults(Query<K, T>query
    , long numResults) throws IOException, Exception {
  Result<K, T> result = query.execute();
  int actualNumResults = 0;
  while(result.next()) {
    actualNumResults++;
  }
  result.close();
  Assert.assertEquals(numResults, actualNumResults);
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:11,代码来源:DataStoreTestUtil.java

示例4: assertNumResults

import org.apache.gora.query.Result; //导入方法依赖的package包/类
public static<K,T extends Persistent> void assertNumResults(Query<K, T>query
    , long numResults) throws IOException, Exception {
  Result<K, T> result = query.execute();
  int actualNumResults = 0;
  while(result.next()) {
    actualNumResults++;
  }
  result.close();
  assertEquals(numResults, actualNumResults);
}
 
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:11,代码来源:DataStoreTestUtil.java

示例5: assertPartitions

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

  int count = 0, partitionsCount = 0;
  Map<String, Integer> results = new HashMap<>();
  Map<String, Integer> partitionResults = new HashMap<>();

  //execute query and count results
  Result<String, WebPage> result = store.execute(query);
  assertNotNull(result);

  while(result.next()) {
    assertNotNull(result.getKey());
    assertNotNull(result.get());
    results.put(result.getKey(), result.get().hashCode()); //keys are not reused, so this is safe
    count++;
  }
  result.close();

  assertTrue(count > 0); //assert that results is not empty
  assertEquals(count, results.size()); //assert that keys are unique

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

    result = store.execute(partition);
    assertNotNull(result);

    while(result.next()) {
      assertNotNull(result.getKey());
      assertNotNull(result.get());
      partitionResults.put(result.getKey(), result.get().hashCode());
      partitionsCount++;
    }
    result.close();

    assertEquals(partitionsCount, partitionResults.size()); //assert that keys are unique
  }

  assertTrue(partitionsCount > 0);
  assertEquals(count, partitionsCount);

  for(Map.Entry<String, Integer> r : results.entrySet()) {
    Integer p = partitionResults.get(r.getKey());
    assertNotNull(p);
    assertEquals(r.getValue(), p);
  }
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:50,代码来源:DataStoreTestUtil.java

示例6: assertPartitions

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

  int count = 0, partitionsCount = 0;
  Map<String, Integer> results = new HashMap<String, Integer>();
  Map<String, Integer> partitionResults = new HashMap<String, Integer>();

  //execute query and count results
  Result<String, WebPage> result = store.execute(query);
  Assert.assertNotNull(result);

  while(result.next()) {
    Assert.assertNotNull(result.getKey());
    Assert.assertNotNull(result.get());
    results.put(result.getKey(), result.get().hashCode()); //keys are not reused, so this is safe
    count++;
  }
  result.close();

  Assert.assertTrue(count > 0); //assert that results is not empty
  Assert.assertEquals(count, results.size()); //assert that keys are unique

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

    result = store.execute(partition);
    Assert.assertNotNull(result);

    while(result.next()) {
      Assert.assertNotNull(result.getKey());
      Assert.assertNotNull(result.get());
      partitionResults.put(result.getKey(), result.get().hashCode());
      partitionsCount++;
    }
    result.close();

    Assert.assertEquals(partitionsCount, partitionResults.size()); //assert that keys are unique
  }

  Assert.assertTrue(partitionsCount > 0);
  Assert.assertEquals(count, partitionsCount);

  for(Map.Entry<String, Integer> r : results.entrySet()) {
    Integer p = partitionResults.get(r.getKey());
    Assert.assertNotNull(p);
    Assert.assertEquals(r.getValue(), p);
  }
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:50,代码来源:DataStoreTestUtil.java

示例7: assertPartitions

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

  int count = 0, partitionsCount = 0;
  Map<String, Integer> results = new HashMap<String, Integer>();
  Map<String, Integer> partitionResults = new HashMap<String, Integer>();

  //execute query and count results
  Result<String, WebPage> result = store.execute(query);
  assertNotNull(result);

  while(result.next()) {
    assertNotNull(result.getKey());
    assertNotNull(result.get());
    results.put(result.getKey(), result.get().hashCode()); //keys are not reused, so this is safe
    count++;
  }
  result.close();

  assertTrue(count > 0); //assert that results is not empty
  assertEquals(count, results.size()); //assert that keys are unique

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

    result = store.execute(partition);
    assertNotNull(result);

    while(result.next()) {
      assertNotNull(result.getKey());
      assertNotNull(result.get());
      partitionResults.put(result.getKey(), result.get().hashCode());
      partitionsCount++;
    }
    result.close();

    assertEquals(partitionsCount, partitionResults.size()); //assert that keys are unique
  }

  assertTrue(partitionsCount > 0);
  assertEquals(count, partitionsCount);

  for(Map.Entry<String, Integer> r : results.entrySet()) {
    Integer p = partitionResults.get(r.getKey());
    assertNotNull(p);
    assertEquals(r.getValue(), p);
  }
}
 
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:50,代码来源:DataStoreTestUtil.java


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