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


Java LdbcQuery10类代码示例

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


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

示例1: executeOperation

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public void executeOperation(LdbcQuery10 operation,
    DbConnectionState dbConnectionState,
    ResultReporter resultReporter) throws DbException {

  Driver driver = ((Neo4jDbConnectionState) dbConnectionState).getDriver();

  String statement =
      "   MATCH (person:Person {id:{1}})-[:KNOWS*2..2]-(friend:Person)-[:IS_LOCATED_IN]->(city:Place)"
      + " WHERE "
      + "   ((friend.birthday_month = {2} AND friend.birthday_day >= 21) OR"
      + "   (friend.birthday_month = ({2}%12)+1 AND friend.birthday_day < 22))"
      + "   AND not(friend=person)"
      + "   AND not((friend)-[:KNOWS]-(person))"
      + " WITH DISTINCT friend, city, person"
      + " OPTIONAL MATCH (friend)<-[:HAS_CREATOR]-(post:Post)"
      + " WITH friend, city, collect(post) AS posts, person"
      + " WITH "
      + "   friend,"
      + "   city,"
      + "   length(posts) AS postCount,"
      + "   length([p IN posts WHERE (p)-[:HAS_TAG]->(:Tag)<-[:HAS_INTEREST]-(person)]) AS commonPostCount"
      + " RETURN"
      + "   friend.id AS personId,"
      + "   friend.firstName AS personFirstName,"
      + "   friend.lastName AS personLastName,"
      + "   friend.gender AS personGender,"
      + "   city.name AS personCityName,"
      + "   commonPostCount - (postCount - commonPostCount) AS commonInterestScore"
      + " ORDER BY commonInterestScore DESC, toInt(personId) ASC"
      + " LIMIT {3}";
  Value parameters = parameters(
        "1", String.valueOf(operation.personId()), 
        "2", operation.month(), 
        "3", operation.limit());

  // Execute the query and get the results.
  List<LdbcQuery10Result> resultList = new ArrayList<>();
  try (Session session = driver.session(AccessMode.READ)) {
    try (Transaction tx = session.beginTransaction()) {
      StatementResult result = tx.run(statement, parameters);
      tx.success();
      tx.close();

      while (result.hasNext()) {
        Record record = result.next();

        resultList.add(
            new LdbcQuery10Result(
                Long.valueOf(record.get("personId").asString()),
                record.get("personFirstName").asString(),
                record.get("personLastName").asString(),
                record.get("commonInterestScore").asInt(),
                record.get("personGender").asString(),
                record.get("personCityName").asString()));
      }
    }
  }

  resultReporter.report(0, resultList, operation);
}
 
开发者ID:PlatformLab,项目名称:ldbc-snb-impls,代码行数:62,代码来源:Neo4jDb.java

示例2: getQuery10

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
public String getQuery10(LdbcQuery10 operation) {
	int nextMonth=operation.month()+1;
	if(nextMonth==13) { nextMonth=1;}
	return getSql(QueryType.Query10, 
			operation.personId(), 
			operation.month(),
			nextMonth);
	
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:10,代码来源:InteractiveQueryStore.java

示例3: getStmtQuery10

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
public PreparedStatement getStmtQuery10(LdbcQuery10 operation, Connection con) {
	int nextMonth=operation.month()+1;
	if(nextMonth==13) { nextMonth=1;}
	return getStmt(QueryType.Query10, con,
			operation.personId(), 
			operation.month(),
			nextMonth);
	
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:10,代码来源:InteractiveQueryStore.java

示例4: onInit

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
	protected void onInit(Map<String, String> properties, LoggingService loggingService) throws DbException {
		try {
//			dbs = new JdbcCustomPoolingDbConnectionStore<InteractiveQueryStore>(properties, new InteractiveQueryStore(properties.get("queryDir")));
			dbs = new JdbcPoolingDbConnectionStore<InteractiveQueryStore>(properties, new InteractiveQueryStore(properties.get("queryDir")));
		} catch (ClassNotFoundException | SQLException e) {
			throw new DbException(e);
		}
		
		registerOperationHandler(LdbcQuery1.class, Query1.class); //ARRAY RESULT
		registerOperationHandler(LdbcQuery2.class, Query2.class);
		registerOperationHandler(LdbcQuery3.class, Query3.class);
		registerOperationHandler(LdbcQuery4.class, Query4.class);
		registerOperationHandler(LdbcQuery5.class, Query5.class);
		registerOperationHandler(LdbcQuery6.class, Query6.class);
		registerOperationHandler(LdbcQuery7.class, Query7.class);
		registerOperationHandler(LdbcQuery8.class, Query8.class);
		registerOperationHandler(LdbcQuery9.class, Query9.class);
		registerOperationHandler(LdbcQuery10.class, Query10.class);
		registerOperationHandler(LdbcQuery11.class, Query11.class);
		registerOperationHandler(LdbcQuery12.class, Query12.class); //ARRAY RESULT
		registerOperationHandler(LdbcQuery13.class, Query13.class); //NESTED WITH
		registerOperationHandler(LdbcQuery14.class, Query14.class); //NESTED WITH
		registerOperationHandler(LdbcShortQuery1PersonProfile.class, ShortQuery1PersonProfile.class);
		registerOperationHandler(LdbcShortQuery2PersonPosts.class, ShortQuery2PersonPosts.class); //BUG
		registerOperationHandler(LdbcShortQuery3PersonFriends.class, ShortQuery3PersonFriends.class);
		registerOperationHandler(LdbcShortQuery4MessageContent.class, ShortQuery4MessageContent.class);
		registerOperationHandler(LdbcShortQuery5MessageCreator.class, ShortQuery5MessageCreator.class);
		registerOperationHandler(LdbcShortQuery6MessageForum.class, ShortQuery6MessageForum.class);
		registerOperationHandler(LdbcShortQuery7MessageReplies.class, ShortQuery7MessageReplies.class);
		registerOperationHandler(LdbcUpdate1AddPerson.class, Update1AddPerson.class);
		registerOperationHandler(LdbcUpdate2AddPostLike.class, Update2AddPostLike.class);
		registerOperationHandler(LdbcUpdate3AddCommentLike.class, Update3AddCommentLike.class);
		registerOperationHandler(LdbcUpdate4AddForum.class, Update4AddForum.class);
		registerOperationHandler(LdbcUpdate5AddForumMembership.class, Update5AddForumMembership.class);
		registerOperationHandler(LdbcUpdate6AddPost.class, Update6AddPost.class);
		registerOperationHandler(LdbcUpdate7AddComment.class, Update7AddComment.class);
		registerOperationHandler(LdbcUpdate8AddFriendship.class, Update8AddFriendship.class);
	}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:40,代码来源:InteractiveDb.java

示例5: executeOperation

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public void executeOperation( LdbcQuery10 operation, DummyDbConnectionState dbConnectionState,
        ResultReporter resultReporter ) throws DbException
{
    sleep( operation, sleepDurationAsNano );
    resultReporter.report( 0, LDBC_QUERY_10_RESULTS, operation );
}
 
开发者ID:ldbc,项目名称:ldbc_snb_driver,代码行数:8,代码来源:DummyLdbcSnbInteractiveDb.java

示例6: executeOperation

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public void executeOperation(final LdbcQuery10 operation,
    DbConnectionState dbConnectionState,
    ResultReporter resultReporter) throws DbException {

}
 
开发者ID:PlatformLab,项目名称:ldbc-snb-impls,代码行数:7,代码来源:TitanDb.java

示例7: onInit

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
protected void onInit(Map<String, String> properties,
    LoggingService loggingService) throws DbException {

  connectionState = new Neo4jDbConnectionState(properties);

  /*
   * Register operation handlers with the benchmark.
   */
  registerOperationHandler(LdbcQuery1.class,
      LdbcQuery1Handler.class);
  registerOperationHandler(LdbcQuery2.class,
      LdbcQuery2Handler.class);
  registerOperationHandler(LdbcQuery3.class,
      LdbcQuery3Handler.class);
  registerOperationHandler(LdbcQuery4.class,
      LdbcQuery4Handler.class);
  registerOperationHandler(LdbcQuery5.class,
      LdbcQuery5Handler.class);
  registerOperationHandler(LdbcQuery6.class,
      LdbcQuery6Handler.class);
  registerOperationHandler(LdbcQuery7.class,
      LdbcQuery7Handler.class);
  registerOperationHandler(LdbcQuery8.class,
      LdbcQuery8Handler.class);
  registerOperationHandler(LdbcQuery9.class,
      LdbcQuery9Handler.class);
  registerOperationHandler(LdbcQuery10.class,
      LdbcQuery10Handler.class);
  registerOperationHandler(LdbcQuery11.class,
      LdbcQuery11Handler.class);
  registerOperationHandler(LdbcQuery12.class,
      LdbcQuery12Handler.class);
  registerOperationHandler(LdbcQuery13.class,
      LdbcQuery13Handler.class);
  registerOperationHandler(LdbcQuery14.class,
      LdbcQuery14Handler.class);

  registerOperationHandler(LdbcShortQuery1PersonProfile.class,
      LdbcShortQuery1PersonProfileHandler.class);
  registerOperationHandler(LdbcShortQuery2PersonPosts.class,
      LdbcShortQuery2PersonPostsHandler.class);
  registerOperationHandler(LdbcShortQuery3PersonFriends.class,
      LdbcShortQuery3PersonFriendsHandler.class);
  registerOperationHandler(LdbcShortQuery4MessageContent.class,
      LdbcShortQuery4MessageContentHandler.class);
  registerOperationHandler(LdbcShortQuery5MessageCreator.class,
      LdbcShortQuery5MessageCreatorHandler.class);
  registerOperationHandler(LdbcShortQuery6MessageForum.class,
      LdbcShortQuery6MessageForumHandler.class);
  registerOperationHandler(LdbcShortQuery7MessageReplies.class,
      LdbcShortQuery7MessageRepliesHandler.class);

  registerOperationHandler(LdbcUpdate1AddPerson.class,
      LdbcUpdate1AddPersonHandler.class);
  registerOperationHandler(LdbcUpdate2AddPostLike.class,
      LdbcUpdate2AddPostLikeHandler.class);
  registerOperationHandler(LdbcUpdate3AddCommentLike.class,
      LdbcUpdate3AddCommentLikeHandler.class);
  registerOperationHandler(LdbcUpdate4AddForum.class,
      LdbcUpdate4AddForumHandler.class);
  registerOperationHandler(LdbcUpdate5AddForumMembership.class,
      LdbcUpdate5AddForumMembershipHandler.class);
  registerOperationHandler(LdbcUpdate6AddPost.class,
      LdbcUpdate6AddPostHandler.class);
  registerOperationHandler(LdbcUpdate7AddComment.class,
      LdbcUpdate7AddCommentHandler.class);
  registerOperationHandler(LdbcUpdate8AddFriendship.class,
      LdbcUpdate8AddFriendshipHandler.class);
}
 
开发者ID:PlatformLab,项目名称:ldbc-snb-impls,代码行数:71,代码来源:Neo4jDb.java

示例8: onInit

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
protected void onInit(Map<String, String> properties,
    LoggingService loggingService) throws DbException {

  connectionState = new TorcDbConnectionState(properties);

  if (properties.containsKey("txReads")) {
    doTransactionalReads = true;
  }

  /*
   * Register operation handlers with the benchmark.
   */
  registerOperationHandler(LdbcQuery1.class,
      LdbcQuery1Handler.class);
  registerOperationHandler(LdbcQuery2.class,
      LdbcQuery2Handler.class);
  registerOperationHandler(LdbcQuery7.class,
      LdbcQuery7Handler.class);
  registerOperationHandler(LdbcQuery8.class,
      LdbcQuery8Handler.class);
  registerOperationHandler(LdbcQuery10.class,
      LdbcQuery10Handler.class);
  registerOperationHandler(LdbcQuery11.class,
      LdbcQuery11Handler.class);
  registerOperationHandler(LdbcQuery13.class,
      LdbcQuery13Handler.class);

  registerOperationHandler(LdbcShortQuery1PersonProfile.class,
      LdbcShortQuery1PersonProfileHandler.class);
  registerOperationHandler(LdbcShortQuery2PersonPosts.class,
      LdbcShortQuery2PersonPostsHandler.class);
  registerOperationHandler(LdbcShortQuery3PersonFriends.class,
      LdbcShortQuery3PersonFriendsHandler.class);
  registerOperationHandler(LdbcShortQuery4MessageContent.class,
      LdbcShortQuery4MessageContentHandler.class);
  registerOperationHandler(LdbcShortQuery5MessageCreator.class,
      LdbcShortQuery5MessageCreatorHandler.class);
  registerOperationHandler(LdbcShortQuery6MessageForum.class,
      LdbcShortQuery6MessageForumHandler.class);
  registerOperationHandler(LdbcShortQuery7MessageReplies.class,
      LdbcShortQuery7MessageRepliesHandler.class);

  registerOperationHandler(LdbcUpdate1AddPerson.class,
      LdbcUpdate1AddPersonHandler.class);
  registerOperationHandler(LdbcUpdate2AddPostLike.class,
      LdbcUpdate2AddPostLikeHandler.class);
  registerOperationHandler(LdbcUpdate3AddCommentLike.class,
      LdbcUpdate3AddCommentLikeHandler.class);
  registerOperationHandler(LdbcUpdate4AddForum.class,
      LdbcUpdate4AddForumHandler.class);
  registerOperationHandler(LdbcUpdate5AddForumMembership.class,
      LdbcUpdate5AddForumMembershipHandler.class);
  registerOperationHandler(LdbcUpdate6AddPost.class,
      LdbcUpdate6AddPostHandler.class);
  registerOperationHandler(LdbcUpdate7AddComment.class,
      LdbcUpdate7AddCommentHandler.class);
  registerOperationHandler(LdbcUpdate8AddFriendship.class,
      LdbcUpdate8AddFriendshipHandler.class);
}
 
开发者ID:PlatformLab,项目名称:ldbc-snb-impls,代码行数:61,代码来源:TorcDb.java

示例9: getStatement

import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public PreparedStatement getStatement(Connection con, JdbcDbConnectionStore<InteractiveQueryStore> state, LdbcQuery10 operation) {
	return state.getQueryStore().getStmtQuery10(operation,con);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:5,代码来源:InteractiveDb.java


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